layout primitive
<tc-cluster>
Horizontal layout primitive. Children flow left-to-right and wrap when they run out of room.
import
"@ra9/tan-compose-kit/cluster"
Props
| Name | Type | Default | Description |
|---|---|---|---|
gap | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | CSS length | "3" | Spacing between children. Numeric tokens map to `--tc-space-N`. Any raw CSS length also works. |
justify | "start" | "center" | "end" | "between" | "around" | "start" | Main-axis distribution. `between` / `around` map to `space-between` / `space-around`. |
align | "stretch" | "start" | "center" | "end" | "baseline" | "center" | Cross-axis alignment of children within the row. |
wrap | boolean | true | Allow children to wrap to a second row when the parent is too narrow. |
Slots
| Slot | Description |
|---|---|
(default) | Children — any markup; the cluster just lays them out. |
Examples
Basic usage
Common patterns
Cluster is the right primitive for any horizontal group: button bars, tag chips, breadcrumbs, social icons.
Pushed apart with justify="between"
Useful for headers — title on the left, actions on the right.
Wrapping vs nowrap
By default, a cluster wraps when items overflow. Disable it for fixed-width toolbars:
Baseline alignment
Useful when mixing different font sizes:
Theming
No theme variables — tc-cluster is a layout primitive. Use the props directly.
Accessibility
- Renders a plain
<div>— transparent to assistive tech. - Children retain their own semantics. If the cluster is a toolbar, wrap it in
role="toolbar"yourself for the strongest signal.