Column
Column arranges children vertically in a single column, mirroring Flutter's Column widget. It provides precise control over vertical alignment, spacing, and layout behavior using a declarative API built on CSS Flexbox.

Tsx

import { Column } from '@dynshift/layr';

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
1. Basic Usage
1a. Simple Vertical Layout

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
1b. With Spacing

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2. Main Axis Alignment
The mainAxisAlignment prop controls how children are distributed along the vertical axis.
2a. Start (Default)
Children are placed at the top of the column:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2b. Center
Children are centered vertically:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
Notice that you will need to define Column's boundaries. In this example, we used Container.
2c. End
Children are placed at the bottom:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
Notice that you will need to define Column's boundaries. In this example, we used Container.
2d. Space Between
Remaining space is distributed evenly between children:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2e. Space Around
Space is distributed evenly around each child:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
2f. Space Evenly
Space is distributed evenly, including edges:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
Available values:
MainAxisAlignment.start — Top alignment (default) • MainAxisAlignment.center — Vertical center • MainAxisAlignment.end — Bottom alignment • MainAxisAlignment.spaceBetween — Space between children • MainAxisAlignment.spaceAround — Space around children • MainAxisAlignment.spaceEvenly — Even spacing including edges
3. Cross Axis Alignment
The crossAxisAlignment prop controls how children are aligned horizontally.
3a. Center (Default)
Children are centered horizontally:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
3b. Start (Left)
Children are aligned to the left edge:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
3c. End (Right)
Children are aligned to the right edge:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
3d. Stretch
Children are stretched to fill the full width:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
3e. Baseline
Children are aligned by their text baseline:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
Available values:
CrossAxisAlignment.center — Horizontal center (default) • CrossAxisAlignment.start — Left alignment • CrossAxisAlignment.end — Right alignment • CrossAxisAlignment.stretch — Fill full width • CrossAxisAlignment.baseline — Baseline alignment
4. Main Axis Size
The mainAxisSize prop controls how much vertical space the column occupies.
4a. Max (Default)
Column takes up all available height:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
This sets height: 100% on the column.
4b. Min
Column wraps to fit its children's height:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
This sets height: auto on the column.
Use cases:
MainAxisSize.max — Full-height sidebars and layouts • MainAxisSize.min — Cards, modals, inline content
5. Vertical Direction
Control whether children are laid out top-to-bottom or bottom-to-top.
5a. Down (Default)
Normal top-to-bottom order:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
5b. Up (Reversed)
Bottom-to-top order:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
This applies flex-direction: column-reverse.
6. Spacing
Add consistent gaps between children using the spacing prop.
6a. Fixed Spacing

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
This uses CSS gap for clean implementation.
6b. No Spacing (Default)

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
Note: spacing only affects gaps between children, not margins around the column itself.
7. Clip Behavior
Control how overflowing content is handled.
7a. Visible (Default)
Content can overflow the column boundaries:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
7b. Hidden
Clip overflowing content:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
7c. Scroll
Enable scrolling for overflowing content:

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
8. Complete Examples
8a. Vertical Navigation

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
8b. Centered Card

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
8c. Form Layout

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
8d. Dashboard Layout

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
8e. Timeline / Feed

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
8f. Badge List

Tsx

Preview

NOTE: Previews are not depiction of actual website output.
9. Layout Algorithm
Column follows Flutter's layout specification:
• Layout non-flex children with unbounded vertical constraints • Divide remaining vertical space among flex children (Expanded) • Width = maximum width of children (or 100% by default) • Height = determined by mainAxisSize (max = fill parent, min = wrap content) • Position children according to mainAxisAlignment and crossAxisAlignment
10. Custom Styling
10a. Tailwind Classes

Tsx

<Column className="bg-gray-100 rounded-lg p-4">
<span>Styled with Tailwind</span>
</Column>
10b. Inline Styles

Tsx

<Column
style={{
backgroundColor: '#f3f4f6',
borderRadius: '8px',
padding: '16px'
}}
>
<span>Custom styles</span>
</Column>
11. TypeScript
Column is fully typed with comprehensive IntelliSense support:

Tsx

import type { ColumnProps } from '@dynshift/layr';
import { Column, MainAxisAlignment, CrossAxisAlignment } from '@dynshift/layr';
const VerticalList: React.FC<ColumnProps> = (props) => {
return (
<Column
mainAxisAlignment={MainAxisAlignment.start}
crossAxisAlignment={CrossAxisAlignment.stretch}
spacing={12}
{...props}
/>
);
};
12. API Reference
12a. ColumnProps
PropTypeDefaultDescription
childrenReactNodeContent to render vertically
mainAxisAlignmentMainAxisAlignmentstartVertical distribution of children
crossAxisAlignmentCrossAxisAlignmentcenterHorizontal alignment of children
mainAxisSizeMainAxisSizemaxHow much vertical space to occupy
verticalDirectionVerticalDirectiondownLayout direction (top-to-bottom or reversed)
spacingnumber0Gap between children in pixels
clipBehavior'visible' 'hidden' 'scroll''visible'How to handle overflow
classNamestring''Additional CSS classes
styleCSSProperties{}Custom inline styles
idstringHTML id attribute
onTap() => voidClick handler (Flutter-style)
onClick() => voidClick handler
12b. MainAxisAlignment Enum
ValueCSS EquivalentDescription
startflex-startChildren at top
centercenterChildren centered
endflex-endChildren at bottom
spaceBetweenspace-betweenSpace between children
spaceAroundspace-aroundSpace around children
spaceEvenlyspace-evenlyEven spacing
12c. CrossAxisAlignment Enum
ValueCSS EquivalentDescription
startflex-startLeft alignment
centercenterHorizontal center
endflex-endRight alignment
stretchstretchFill full width
baselinebaselineText baseline alignment
12d. MainAxisSize Enum
ValueBehaviorDescription
maxheight: 100%Fill available height
minheight: autoWrap to content height
12e. VerticalDirection Enum
ValueCSS EquivalentDescription
downcolumnTop-to-bottom (normal)
upcolumn-reverseBottom-to-top (reversed)
13. Next Steps
• Row — Horizontal layout with alignment • Stack — Layered positioning