Stack
Children in a column with even space between them.
Space things out with Stack and Inline, not margins. The gap is a step on the system’s spacing
scale, so the space between things means the same everywhere: 2xs holds a title to its
description, lg separates the parts of a card, 3xl separates the sections of a page.
It renders a <div>; give it render for another element, like <ul />. Children stretch to its
width unless align says otherwise.
The scale
Every step, from 3xs to 4xl, as the gap between two squares.
Dependencies
What it's built from and what's built from it in Mocha, read from the imports in its source.
| Uses | Nothing else in the system. |
|---|---|
| Used by | Inlineprimitive |
| Packages | @ui-sdk/core@0.1.0-beta.20@ui-sdk/react@0.1.0-beta.20tailwind-variants@4.1.0 |
Installation
Set the project up for Mocha once first, as Getting started shows. Then add it with the CLI, or by hand.
With the CLI
Manually
Install its packages:
Then copy the source:
API reference
Generated from Mocha's types. Props marked ours are added here; the rest come from the ui-sdk part it wraps. Every part also accepts its element's native attributes.
spaceSteps
The spacing scale's steps, smallest first. Their sizes are the theme's --space-* tokens.
Takes the props of a native div.
Stack
Children in a column with even space between them. Space things out with this, not margins.
- alignours
Where children sit across the column. They stretch to its width unless you say otherwise.
Type NonNullable<"center" | "start" | "end" | "stretch">
- gapours
The space between children, a step on the spacing scale.
Type NonNullable<"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "none" | "3xs" | "2xs" | "4xl">
- renderours
The element to render instead of a
<div>, like<section />or<ul />.Type RenderProp