A React Stack: a column with a gap from the spacing scale.
Installation
// package.json: "capsomer": "github:DrDustinEdwards/capsomer#v0.152.2"
import "capsomer/tokens.css";
import "capsomer/base.css";import "capsomer/tokens.css";
import { Stack } from "capsomer/react/stack";Usage
<div class="cap-stack" data-gap="3">...</div>import { Stack } from "capsomer/react/stack";
<Stack gap={3} as="section">...</Stack>API reference
Stack
| Prop | Type | Required | Does |
|---|---|---|---|
gap | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | The space between the children, on the spacing scale (1 to 9); the layout's own gap when omitted. | |
className | string | ||
as | T |
Accessibility
- The element is yours to choose (
as), so a list stays a list (as="ul") and keeps its semantics. - The stack adds space only; reading order is the source order.