Skip to content

Spacer

function Spacer(__namedParameters): Element;

Flexible spacer that pushes siblings apart.

Renders an invisible Box with flexGrow. Drop it between elements in a row or column to push them to opposite edges, or use multiple spacers to distribute space evenly.

ParameterType
__namedParametersSpacerProps

Element

// Push "Save" to the right edge
<Box style={{ flexDirection: "row" }}>
<Text>Title</Text>
<Spacer />
<Button label="Save" onPress={save} />
</Box>

PropertyTypeDescription
size?numberFlex grow factor. Default 1. Set higher values to take proportionally more space.