Skip to main content

Spacer

A fixed-size empty View with no background or styling. Use it to add predictable whitespace between elements without reaching for margin props on every child.

Preview

import { Spacer, Row } from '@devraj-labs/vajra-ui-core';

<Row align="center">
<Avatar />
<Spacer w={16} />
<Name />
</Row>

Usage

import { Spacer } from '@devraj-labs/vajra-ui-core';

// Vertical gap between sections
<SectionA />
<Spacer h={24} />
<SectionB />

// Horizontal gap inside a Row
<Row align="center">
<Avatar />
<Spacer w={12} />
<Name />
</Row>

API

PropTypeDescription
wDimensionValueWidth of the spacer
hDimensionValueHeight of the spacer

Example

Spacer example