Inset
The Inset component is a component that creates a container with additional space around its content. This extra space, also known as padding, can be customized via props.
Example
<Stack space={2}>
<Inset space={4}>
<Placeholder label="space = 4" />
</Inset>
<Placeholder />
<Inset horizontal={4}>
<Placeholder label="horizontal = 4" />
</Inset>
<Placeholder />
<Inset vertical={4}>
<Placeholder label="vertical = 4" />
</Inset>
<Placeholder />
<Inset bottom={4}>
<Placeholder label="bottom = 4" />
</Inset>
<Placeholder />
<Inset top={4}>
<Placeholder label="top = 4" />
</Inset>
<Inset left={4}>
<Placeholder label="left = 4" />
</Inset>
<Inset right={4}>
<Placeholder label="right = 4" />
</Inset>
</Stack>Props
The Inset component is created using the Box component. It extends all the props* supported by Box, as well as React Native View (opens in a new tab), and the props mentioned below.
Unavailable Box props: padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, paddingStart, paddingEnd
space
ResponsiveProp<number>Add padding to all sides.
horizontal
ResponsiveProp<number>Adds padding horizontally.
vertical
ResponsiveProp<number>Adds padding vertically.
top
ResponsiveProp<number>Adds padding to the top.
right
ResponsiveProp<number>Adds padding to the right.
bottom
ResponsiveProp<number>Adds padding to the bottom.
left
ResponsiveProp<number>Adds padding to the left.
start
ResponsiveProp<number>Adds padding to the left for the ltr direction, otherwise to the right.
end
ResponsiveProp<number>Adds padding to the right for the ltr direction, otherwise to the left.