Col.
Col is the flex child role. Place it inside a Row or Stack to say how a region shares space: grow into what is left, refuse to shrink, or align itself differently from its siblings. It ships with min-w-0 so long content never breaks a Row.
When to reach for it
Usage
Col is a thin wrapper over Tailwind utilities, so it costs nothing at runtime and composes with every other primitive.
- Side-by-side regions inside a Row where one side must fill the remaining width.
- Media objects: a fixed thumbnail next to flexible, truncating text.
- A single child that needs a different cross-axis alignment than the rest of its Row.
import { Col } from "@/components/ui/col";
import { Row } from "@/components/ui/row";In practice
Examples
Each example is a real composition with shadcn components. Switch to the Code tab for the source, or copy it directly.
Fixed rail, flexible content
The navigation rail opts out of shrinking and sets its own width. The content Col grows into the rest; a Stack inside each Col spaces its children.
Notifications
Choose how you want to hear about activity in your projects. Mentions and review requests are always delivered.
Media object with truncation
Col sets min-w-0, which is what lets a long filename truncate instead of pushing the download button out of the row.
Per-child alignment
The Row aligns its children to the top so multi-line text reads well. self="center" lets the action button opt back into centering.
Reference
Props
Every primitive also accepts the native props of its element, including className, children, ref, and data attributes.
| Prop | Type | Default |
|---|---|---|
growFill the remaining space in the parent flex container. | boolean | false |
shrinkAllow the region to shrink below its content width. Pass false for fixed rails. | boolean | true |
selfOverride the parent's align for this child only (self-* utilities). | "auto" | "start" | "center" | "end" | "stretch" | "baseline" | "auto" |
Good to know
Notes
- Col is not a container. To space its children, nest a Stack or Row inside it.
- A Col with shrink={false} keeps its intrinsic width. Give it an explicit width class when the content is flexible.