Skip to content

Stack

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";

Usage

<div class="cap-stack" data-gap="3">...</div>
import { Stack } from "capsomer/react/stack";

<Stack gap={3} as="section">...</Stack>

API reference

Stack

PropTypeRequiredDoes
gap1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9The space between the children, on the spacing scale (1 to 9); the layout's own gap when omitted.
classNamestring
asT

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.