Flex / Row / Col#

Layout components for building flexible layouts with gap, alignment, and justify controls.

Import#

TSX
import { Flex, Row, Col } from '@sigx/daisyui';

Basic Usage#

Row (Horizontal)#

Row arranges children horizontally.

TSX
Loading preview...

Col (Vertical)#

Col arranges children vertically.

TSX
Loading preview...

Flex (Generic)#

Flex is the base component with configurable direction.

TSX
Loading preview...

Gap#

Control spacing between items with the gap prop.

TSX
Loading preview...

Alignment#

Use align to control cross-axis alignment.

TSX
Loading preview...

Justify#

Use justify to control main-axis distribution.

TSX
Loading preview...

Wrap#

Enable wrapping when items overflow.

TSX
Loading preview...

Reverse Direction#

Use the reverse prop to reverse the order of items.

TSX
Loading preview...

Inline#

Use inline prop for inline-flex behavior.

TSX
Loading preview...

Styling Props#

Row and Col components include built-in styling props for common patterns.

TSX
Loading preview...

Width & Height#

Control dimensions with width, height, minWidth, minHeight, maxWidth, maxHeight props.

Supports both Tailwind presets and arbitrary CSS values.

TSX
Loading preview...

Common Patterns#

Header with Actions#

TSX
Loading preview...

Form Layout#

TSX
Loading preview...

Centered Content#

TSX
Loading preview...

Props#

Flex Props#

PropTypeDefaultDescription
direction'row' | 'col' | 'row-reverse' | 'col-reverse''row'Flex direction
gapSpacingValue | SpacingObject-Gap between items. Can be a single value "4" or object {{ x: "4", y: "2" }}
align'start' | 'center' | 'end' | 'stretch' | 'baseline'-Cross-axis alignment
justify'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'-Main-axis distribution
wrapbooleanfalseEnable flex wrap
inlinebooleanfalseUse inline-flex instead of flex
paddingSpacingValue | SpacingObject-Padding. Can be "4" or {{ x: "2", y: "4" }} or {{ top: "2", left: "4" }}
marginSpacingValue | SpacingObject-Margin. Same format as padding
widthSizeValue-Width (e.g., "full", "screen", "48", "1/2")
heightSizeValue-Height (e.g., "full", "screen", "48", "1/2")
minWidthSizeValue-Minimum width
minHeightSizeValue-Minimum height
maxWidthSizeValue-Maximum width
maxHeightSizeValue-Maximum height
roundedboolean | 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' | 'box'-Border radius (true = rounded-box)
background'base-100' | 'base-200' | 'base-300' | 'primary' | 'secondary' | 'accent' | 'neutral' | 'info' | 'success' | 'warning' | 'error'-Background color (auto sets text color for semantic colors)
growbooleanfalseEnable flex-grow
shrinkbooleanfalseEnable flex-shrink
classstring-Additional CSS classes

SpacingValue#

'0' | '1' | '2' | '3' | '4' | '5' | '6' | '8' | '10' | '12'

SpacingObject#

TSX
{
    all?: SpacingValue;
    x?: SpacingValue;
    y?: SpacingValue;
    top?: SpacingValue;
    right?: SpacingValue;
    bottom?: SpacingValue;
    left?: SpacingValue;
}

SizeValue#

Accepts Tailwind presets or arbitrary CSS values:

TSX
// Tailwind presets
width="48"       // → w-48 (12rem)
width="full"     // → w-full (100%)
width="1/2"      // → w-1/2 (50%)
width="screen"   // → w-screen (100vw)

// Arbitrary CSS values (auto-wrapped in [])
width="400px"    // → w-[400px]
width="70%"      // → w-[70%]
width="calc(100% - 2rem)"  // → w-[calc(100%-2rem)]

Tailwind presets:

  • Numeric: '0' through '96'
  • Special: 'auto' | 'full' | 'screen' | 'min' | 'max' | 'fit'
  • Fractions: '1/2' | '1/3' | '2/3' | '1/4' | '2/4' | '3/4' | '1/5' | '2/5' | '3/5' | '4/5' | '1/6' | '5/6'

Row Props#

Same as Flex props, but without direction. Adds:

PropTypeDefaultDescription
reversebooleanfalseReverse row direction

Col Props#

Same as Flex props, but without direction. Adds:

PropTypeDefaultDescription
reversebooleanfalseReverse column direction