Arcana UI
Components

Layout

Layout primitives — Stack, HStack, Grid, and Container — for spacing and structure without writing CSS.

Import

import { Stack, HStack, Grid, Container } from '@arcana-ui/core'

Stack

Vertical stack with consistent gap between children:

<Stack gap={4}>
  <Input label="First name" />
  <Input label="Last name" />
  <Button>Submit</Button>
</Stack>

Stack Props

PropTypeDefaultDescription
gap0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 164Gap between items (maps to spacing tokens)
align'start' | 'center' | 'end' | 'stretch''stretch'Cross-axis alignment
childrenReact.ReactNodeStack items
classNamestringAdditional CSS classes
asReact.ElementType'div'Root element

HStack

Horizontal stack for inline layouts:

<HStack gap={3} align="center">
  <Avatar name="Alice" size="sm" />
  <span>Alice Johnson</span>
  <Badge variant="success">Active</Badge>
</HStack>

HStack Props

PropTypeDefaultDescription
gapnumber4Gap between items
align'start' | 'center' | 'end' | 'baseline''center'Cross-axis alignment
justify'start' | 'center' | 'end' | 'between' | 'around' | 'evenly''start'Main-axis distribution
wrapbooleanfalseAllow wrapping
classNamestringAdditional CSS classes

Grid

Responsive CSS grid layout:

<Grid cols={3} gap={6}>
  <Card>...</Card>
  <Card>...</Card>
  <Card>...</Card>
</Grid>
 
{/* Responsive cols */}
<Grid cols={{ sm: 1, md: 2, lg: 3 }} gap={4}>
  ...
</Grid>

Grid Props

PropTypeDefaultDescription
colsnumber | { sm?: number; md?: number; lg?: number; xl?: number }1Column count
gapnumber4Grid gap (same scale as Stack)
classNamestringAdditional CSS classes

Container

Centers content with a maximum width and horizontal padding:

<Container>
  <h1>Page title</h1>
  <p>Content is centered and padded.</p>
</Container>
 
{/* Custom max width */}
<Container maxWidth="lg">
  <Navbar />
</Container>

Container Props

PropTypeDefaultDescription
maxWidth'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full''xl'Maximum content width
paddingbooleantrueAdd horizontal padding
centerbooleantrueCenter with margin: auto
classNamestringAdditional CSS classes

Composition example

<Container maxWidth="2xl">
  <Navbar />
  <Stack gap={8} as="main">
    <section>
      <h1>Dashboard</h1>
      <Grid cols={{ sm: 1, md: 3 }} gap={4}>
        <Card>...</Card>
        <Card>...</Card>
        <Card>...</Card>
      </Grid>
    </section>
    <section>
      <HStack justify="between" align="center">
        <h2>Recent activity</h2>
        <Button variant="ghost" size="sm">View all</Button>
      </HStack>
      <Table>...</Table>
    </section>
  </Stack>
</Container>

Gap scale

Gap values map to the --arcana-spacing-* token scale:

ValueTokenSize
00
1--arcana-spacing-14px
2--arcana-spacing-28px
3--arcana-spacing-312px
4--arcana-spacing-416px
5--arcana-spacing-520px
6--arcana-spacing-624px
8--arcana-spacing-832px
10--arcana-spacing-1040px
12--arcana-spacing-1248px
16--arcana-spacing-1664px

Accessibility

All layout components render as semantic HTML. Use the as prop to choose the appropriate element:

<Stack as="main" gap={8}>
  <Stack as="section" gap={4}>...</Stack>
</Stack>
<HStack as="nav" gap={2}>...</HStack>

On this page