Theme
Grid
CSS grid layout with uniform column control
Start Here
Start from the smallest working snippet, then move to interactive examples and the full API contract below.
Styled quick start
Copy this entrypoint first. It includes the imports required to get the component on screen.
svelte
<script lang="ts">
import '@dryui/ui/themes/default.css';
import '@dryui/ui/themes/dark.css';
import { Grid } from '@dryui/ui';
</script>
<Grid template="minmax(0, 2fr) minmax(18rem, 1fr)" gap="lg">
<Card.Root><Card.Content>Main</Card.Content></Card.Root>
<Card.Root><Card.Content>Sidebar</Card.Content></Card.Root>
</Grid>Import options
Root package
ts
import { Grid } from '@dryui/ui'Per-component subpath
ts
import { Grid } from '@dryui/ui/grid'Customize
Use the interactive examples to see common variants, states, and composition patterns before building your own.
2-Column Grid
3-Column Grid
4-Column Grid
Compose
The full API contract lives here: props, CSS variables, and the public data attributes you can target when styling.
| Prop | Type | Default | Required | Bindable |
|---|---|---|---|---|
columns | 123456789101112 Fixed integer column count for evenly sized columns. Use template when you need uneven widths. | 12 | — | — |
template | string Custom CSS grid-template-columns value for uneven or mixed-width columns. | — | — | — |
gap | smmdlgxl Uses DryUI spacing scale tokens, not raw CSS units. | 'md' | — | — |
align | startcenterendstretch Maps to align-items for the grid container. | 'stretch' | — | — |
children | Snippet | — | ✓ | — |
Forwards <div> attributes via rest props. Common examples: id, style, role.