v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

Stack

Flexible spacing and alignment in a row or column.

Interactive preview

Space to compose.

Choose an action.

Usage

import { Stack, Button } from "@devvy-ui/react";

<Stack direction="row" wrap gap="0.75rem"><Button>Save</Button><Button variant="outline">Cancel</Button></Stack>

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
directionrow | columncolumnLayout axis.
gap / align / justifyCSS gap / alignment1rem / stretch / startSpacing and child alignment.
wrapbooleanfalseAllow items to wrap.

Accessibility & behavior

Platform Behavior & Guidelines

DOM order remains reading/tab order. Prefer wrapping over horizontal overflow. Native div attributes, refs and style overrides are supported. No role or interaction is invented.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add stack

Make the source yours.

Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.

Stack.tsxREACT / TSX

Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.