Layout Components
A flexible layout component that arranges its children with consistent spacing. It can be used for both vertical and horizontal layouts.
A flexible layout container that arranges children vertically by default.
BasicStack.tsx
<Stack gap> <div className="p-4 bg-gray-100 rounded">Item 1</div> <div className="p-4 bg-gray-100 rounded">Item 2</div> <div className="p-4 bg-gray-100 rounded">Item 3</div></Stack>Use row for horizontal layout, default is column (vertical).
Column (default)
Row
StackDirection.tsx
<Row flexWrap gap> <Col> <Text semibold>Column (default)</Text> <Stack gap> <div className="p-4 bg-gray-100 rounded">Item 1</div> <div className="p-4 bg-gray-100 rounded">Item 2</div> </Stack> </Col> <Col> <Text semibold>Row</Text> <Stack gap row> <div className="p-4 bg-gray-100 rounded">Item 1</div> <div className="p-4 bg-gray-100 rounded">Item 2</div> </Stack> </Col></Row>Use gap for spacing between items, noGap to remove it. Size props (sm, lg) control the gap amount.
Small Gap
Large Gap
StackSpacing.tsx
<Row flexWrap gap> <Col> <Text semibold>Small Gap</Text> <Stack gap sm> <div className="p-3 bg-gray-100 rounded">Item 1</div> <div className="p-3 bg-gray-100 rounded">Item 2</div> </Stack> </Col> <Col> <Text semibold>Large Gap</Text> <Stack gap lg> <div className="p-3 bg-gray-100 rounded">Item 1</div> <div className="p-3 bg-gray-100 rounded">Item 2</div> </Stack> </Col></Row>Control alignment with justifyCenter, justifyBetween, itemsCenter, etc.
Justify Center
Justify Between
StackAlignment.tsx
<Row flexWrap gap> <Col> <Text semibold>Justify Center</Text> <Stack className="h-32 border-2 border-dashed border-gray-300" justifyCenter> <div className="p-4 bg-gray-100 rounded">Centered</div> </Stack> </Col> <Col> <Text semibold>Justify Between</Text> <Stack className="h-32 border-2 border-dashed border-gray-300" justifyBetween > <div className="p-4 bg-gray-100 rounded">Top</div> <div className="p-4 bg-gray-100 rounded">Bottom</div> </Stack> </Col></Row>Use filled or outline with appearance props for styled containers.
StackVariants.tsx
<Row flexWrap gap> <Stack filled gap primary> <div className="p-4 bg-white/80 rounded">Filled Primary</div> <div className="p-4 bg-white/80 rounded">Item 2</div> </Stack> <Stack gap outline success> <div className="p-4 rounded">Outline Success</div> <div className="p-4 rounded">Item 2</div> </Stack></Row>Use textCenter, textLeft, textRight, or textJustify to control text alignment within the stack.
Left Aligned
Content aligned to the left.
Center Aligned
Content centered within the stack.
Right Aligned
Content aligned to the right.
TextAlignment.tsx
<Row flexWrap gap> <Stack className="flex-1 border-2 border-dashed border-gray-300 p-4" textLeft> <Text semibold>Left Aligned</Text> <Text>Content aligned to the left.</Text> </Stack> <Stack className="flex-1 border-2 border-dashed border-gray-300 p-4" textCenter > <Text semibold>Center Aligned</Text> <Text>Content centered within the stack.</Text> </Stack> <Stack className="flex-1 border-2 border-dashed border-gray-300 p-4" textRight> <Text semibold>Right Aligned</Text> <Text>Content aligned to the right.</Text> </Stack></Row>Use mobileCol or tabletCol to switch between row and column layouts responsively.
Column 1
Horizontal on desktop, stacked on tablet and below.
Column 2
Resize to see the responsive behavior.
ResponsiveLayout.tsx
<Stack gap row tabletCol> <div className="p-4 bg-primary-100 rounded flex-1"> <Text semibold>Column 1</Text> <Text>Horizontal on desktop, stacked on tablet and below.</Text> </div> <div className="p-4 bg-primary-100 rounded flex-1"> <Text semibold>Column 2</Text> <Text>Resize to see the responsive behavior.</Text> </div></Stack>Size props for controlling component dimensions
xs
Extra small size
sm
Small size
md
Medium size (default)
lg
Large size
xl
Extra large size
Hide props for responsive element visibility
mobileHide
Hide element on mobile devices and below (max-mobile: 48rem)
tabletHide
Hide element on tablet devices and below (max-tablet: 64rem)
desktopHide
Hide element on desktop devices and below (max-desktop: 80rem)
Items props for controlling flex item alignment (align-items)
itemsStart
Align items to start (top/left)
itemsEnd
Align items to end (bottom/right)
itemsCenter
Align items to center
itemsBaseline
Align items to baseline
itemsStretch
Stretch items to fill container
Justify props for controlling flex content alignment (justify-content)
justifyStart
Pack items toward the start of the main axis
justifyEnd
Pack items toward the end of the main axis
justifyCenter
Center items along the main axis
justifyBetween
Distribute items with space between them
justifyAround
Distribute items with space around them
justifyEvenly
Distribute items with equal space around them
justifyStretch
Stretch items to fill the main axis
justifyBaseline
Align items along their baseline on main axis
Position props for controlling CSS position property
relative
Relative positioning
absolute
Absolute positioning
fixed
Fixed positioning
sticky
Sticky positioning
static
Static positioning
Display props for controlling CSS display property
inline
Inline display - flows with text
block
Block display - takes full width, new line
inlineBlock
Inline-block display - inline but with block properties
flex
Flex display - flexbox container
inlineFlex
Inline-flex display - inline flexbox container
grid
Grid display - CSS grid container
inlineGrid
Inline-grid display - inline grid container
contents
Contents display - element's box is removed, children display as if parent didn't exist
table
Table display - behaves like table element
tableCell
Table-cell display - behaves like td element
hidden
Hidden display - element is not visible
Overflow props for controlling content overflow behavior
overflowAuto
Auto overflow - show scrollbars if needed
overflowHidden
Hidden overflow - clip content without scrollbars
overflowClip
Clip overflow - hard clip without scrollbars
overflowVisible
Visible overflow - content extends beyond bounds
overflowScroll
Scroll overflow - always show scrollbars
overflowXAuto
Auto overflow on X-axis only
overflowYAuto
Auto overflow on Y-axis only
overflowXHidden
Hidden overflow on X-axis only
overflowYHidden
Hidden overflow on Y-axis only
overflowXClip
Clip overflow on X-axis only
overflowYClip
Clip overflow on Y-axis only
overflowXVisible
Visible overflow on X-axis only
overflowYVisible
Visible overflow on Y-axis only
overflowXScroll
Scroll overflow on X-axis only
overflowYScroll
Scroll overflow on Y-axis only
Wrap props for controlling flex wrapping behavior
flexWrap
Allow flex items to wrap to new lines when container is too narrow
flexNoWrap
Force flex items to stay on single line (may overflow)
flexWrapReverse
Wrap flex items in reverse order (last items wrap first)
Gap props for controlling spacing between children
gap
Enable gap spacing between children
noGap
Disable gap spacing
Flex direction props for controlling flex layout direction
row
Flex direction row (horizontal)
column
Flex direction column (vertical)
rowReverse
Flex direction row-reverse
columnReverse
Flex direction column-reverse
Breakpoint props for responsive layout changes
mobileCol
Switch to column layout on mobile and below (max-mobile: 48rem)
tabletCol
Switch to column layout on tablet and below (max-tablet: 64rem)
desktopCol
Switch to column layout on desktop and below (max-desktop: 80rem)
Padding props for controlling internal spacing
padding
Enable internal padding
noPadding
Disable internal padding
Appearance props for controlling component colors
primary
Primary color appearance (gray)
brand
Brand color appearance (blue)
accent
Accent color appearance (rose)
secondary
Secondary color appearance (gray)
tertiary
Tertiary color appearance
success
Success color appearance (green)
danger
Danger color appearance (red)
warning
Warning color appearance (amber)
info
Info color appearance (cyan)
link
Link color appearance (blue, for hyperlinks)
Border props for controlling component borders
border
Enable border on all sides
borderT
Enable border on top
borderB
Enable border on bottom
borderL
Enable border on left
borderR
Enable border on right
borderX
Enable border on left and right
borderY
Enable border on top and bottom
noBorder
Disable all borders
Shape props for controlling component border radius
pill
Fully rounded corners (circular)
sharp
No rounded corners (square)
rounded
Medium rounded corners (default)
Variant props for controlling component style variations
filled
Filled variant - solid background with contrasting text color
outline
Outline variant - transparent background with border and colored text (default)
Transparent prop for disabling background color
transparent
Disable background color - makes component background transparent
Responsive prop for enabling breakpoint-specific sizing
responsive
Enable responsive sizing - uses breakpoint-specific classes for font size, padding, and gap
Text alignment props for controlling text position
textLeft
Align text to left
textCenter
Align text to center
textRight
Align text to right
textJustify
Justify text