Stack
Versatile utility for seamlessly handling flexbox layouts ensures smooth alignment and responsiveness.
Code Editor
Features
Flexible layout options for responsiveness.
Easy alignment and justification of items.
Precise sizing control.
Internal spacing and negative margin options.
Text alignment, background, border, and overflow control.
Flexible positioning options within parent container.
Customizes HTML tag for better accessibility and semantics.
Reference Links
A Complete Guide to Flexbox
Anatomy
Import all parts and combine them together.
import { Stack } from '@vortex-kit/vortex';
import type { StackProps, StackItemProps } from '@vortex-kit/vortex';
<Stack padding={6} borderColor="default">
{children}
</Stack>
Flex Properties
The Stack component offers customizable flex properties like , , and for creating responsive layouts.
direction
gap
wrap
Code Editor
Additionally, items within the Stack can be aligned vertically using the property and horizontally using the property.
align
justify
Code Editor
Dimension Properties
Control the size of the Stack component with properties like , , , , , and .
width
height
minWidth
minHeight
maxWidth
maxHeight
Code Editor
Moreover, you can maintain a specific aspect ratio for the Stack using the property, ensuring consistent width-to-height proportions.
aspectRatio
Code Editor
Layout Properties
Customize spacing and negative margin using , , , , , , , and .
padding
paddingTop
paddingBottom
paddingStart
paddingEnd
paddingInline
paddingBlock
bleed
Code Editor
Adjust text alignment within the Stack using the property.
textAlign
Code Editor
Styling Properties
Control background color, border color, and border radius properties using , , and .
backgroundColor
borderColor
borderRadius
Code Editor
Position Properties
Position elements within parent containers using , , , , , and properties.
position
inset
insetStart
insetEnd
insetTop
insetBottom
Code Editor
Manage the stacking order of elements within the Stack using the property.
zIndex
Code Editor
Column Layout
Stack allows for creating layouts with up to 12 columns. You can control the number of columns using the property within the component.
columns
Stack.Item
Code Editor
Responsive Properties
All properties within the Stack component can be customized for responsive layouts using the , , , , and breakpoints if you pass an object within the property.
xs
sm
md
lg
xl
Code Editor
Accessibility
Key | Description |
---|---|
! | Customize the HTML tag using the as |