Stack
One-axis flex layout with spacing tokens for the gap.
Vertical stackChildren are spaced with a spacing token.
Row with space between
Import
Section titled “Import”import { Stack } from "@pelagornis/page/components";Example
Section titled “Example”The preview above renders this file. Copy it into src/components/ to start from it.
import { Button, Stack, Text } from "@pelagornis/page/components";
export default function StackDemo() { return ( <Stack gap="sizeLarge" className="w-full"> <Stack gap="sizeXXSmall"> <Text variant="subtitleMd">Vertical stack</Text> <Text variant="bodySm">Children are spaced with a spacing token.</Text> </Stack> <Stack direction="row" gap="sizeSmall" align="center" justify="between"> <Text variant="bodyMd">Row with space between</Text> <Stack direction="row" gap="sizeSmall"> <Button variant="outline">Cancel</Button> <Button variant="primary">Save</Button> </Stack> </Stack> </Stack> );}Use in MDX
Section titled “Use in MDX”Stack can be written straight in an .mdx page. Import it below the frontmatter. It renders on the server, so no client directive is needed.
---title: Example---
import { Button, Stack } from "@pelagornis/page/components";
<Stack direction="row" gap="sizeSmall" align="center"> <Button variant="outline">Cancel</Button> <Button variant="primary">Save</Button></Stack>Use in Markdoc
Section titled “Use in Markdoc”pageMarkdoc() registers a stack tag for this component. Add the preset once in markdoc.config.mjs (see Use in Markdoc), then write the tag in any .mdoc page.
{% stack direction="row" gap="sizeSmall" align="center" %}{% button variant="outline" %}Cancel{% /button %}{% button variant="primary" %}Save{% /button %}{% /stack %}Attributes use the same names and values as the React props.
Anatomy
Section titled “Anatomy”Parts of the component and the data-refineui role each one renders.
| Part | Role |
|---|---|
root | stack |
Reference
Section titled “Reference”- RefineUI · Stack for design guidance and token detail.
- Use in MDX and Use in Markdoc for the general rules.