Display
Item
Row with an icon tile, title, description and a trailing action or chevron. Use it for settings lists, quick links and activity feeds.
import * as Item from '@statix/ui/item';Examples
Basic
Icon tile, title, description and an action button.
<script lang="ts">
import * as Item from '@statix/ui/item';
import { Button } from '@statix/ui/button';
import DatabaseBackupIcon from '@lucide/svelte/icons/database-backup';
</script>
<Item.Root variant="card" class="max-w-xl">
<Item.Media variant="icon">
<DatabaseBackupIcon />
</Item.Media>
<Item.Content>
<Item.Title>Last backup today at 03:10</Item.Title>
<Item.Description>yoga-berger.de · 30 backups kept</Item.Description>
</Item.Content>
<Item.Actions>
<Button variant="outline" size="sm">Restore</Button>
</Item.Actions>
</Item.Root>Link rows
Render the row as a link with the child snippet. The quick links on the start page use this with a trailing chevron.
<script lang="ts">
import * as Item from '@statix/ui/item';
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
import FileTextIcon from '@lucide/svelte/icons/file-text';
import LockIcon from '@lucide/svelte/icons/lock';
import LogInIcon from '@lucide/svelte/icons/log-in';
const links = [
{
href: '#contracts',
icon: FileTextIcon,
title: 'Contracts and prices',
text: 'Services and notice periods'
},
{
href: '#account',
icon: LogInIcon,
title: 'Account settings',
text: 'Your details and your login'
},
{ href: '#payment', icon: LockIcon, title: 'Payment methods', text: 'How you pay Statix' }
];
</script>
<Item.Group class="grid gap-2 tablet:grid-cols-3">
{#each links as link (link.href)}
<div role="listitem">
<Item.Root size="sm">
{#snippet child({ props })}
<a href={link.href} {...props}>
<Item.Media>
<link.icon class="size-5 text-ink" />
</Item.Media>
<Item.Content>
<Item.Title>{link.title}</Item.Title>
<Item.Description>{link.text}</Item.Description>
</Item.Content>
<Item.Actions>
<ChevronRightIcon />
</Item.Actions>
</a>
{/snippet}
</Item.Root>
</div>
{/each}
</Item.Group>Settings list in a card
Rows inside a card, separated by hairlines.
<script lang="ts">
import * as Card from '@statix/ui/card';
import * as Item from '@statix/ui/item';
import { Badge } from '@statix/ui/badge';
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
import GlobeIcon from '@lucide/svelte/icons/globe';
import MailIcon from '@lucide/svelte/icons/mail';
import ShieldCheckIcon from '@lucide/svelte/icons/shield-check';
const rows = [
{ icon: GlobeIcon, title: 'Domain', text: 'yoga-berger.de', badge: 'Main domain' },
{
icon: ShieldCheckIcon,
title: 'SSL certificate',
text: 'Renews automatically on 2 Feb 2027',
badge: 'Active'
},
{ icon: MailIcon, title: 'Contact form email', text: 'info@yoga-berger.de', badge: undefined }
];
</script>
<Card.Root class="w-full max-w-xl">
<Card.Header>
<Card.Title>Settings</Card.Title>
</Card.Header>
<Card.Content class="px-3">
<Item.Group class="gap-0">
{#each rows as row, i (row.title)}
{#if i > 0}<Item.Separator class="mx-4 data-horizontal:w-auto" />{/if}
<div role="listitem">
<Item.Root>
{#snippet child({ props })}
<a href="#settings" {...props}>
<Item.Media variant="icon"><row.icon /></Item.Media>
<Item.Content>
<Item.Title>{row.title}</Item.Title>
<Item.Description>{row.text}</Item.Description>
</Item.Content>
<Item.Actions>
{#if row.badge}<Badge size="sm">{row.badge}</Badge>{/if}
<ChevronRightIcon />
</Item.Actions>
</a>
{/snippet}
</Item.Root>
</div>
{/each}
</Item.Group>
</Card.Content>
</Card.Root>Activity feed
size="sm" rows with a status badge for recent events.
<script lang="ts">
import * as Item from '@statix/ui/item';
import { Badge } from '@statix/ui/badge';
import DatabaseBackupIcon from '@lucide/svelte/icons/database-backup';
import RefreshCwIcon from '@lucide/svelte/icons/refresh-cw';
import FileTextIcon from '@lucide/svelte/icons/file-text';
</script>
<Item.Group class="max-w-xl">
<Item.Root size="sm" role="listitem">
<Item.Media variant="icon"><RefreshCwIcon /></Item.Media>
<Item.Content>
<Item.Title>WordPress and 4 plugins updated</Item.Title>
<Item.Description>Tested on a copy first · today, 04:12</Item.Description>
</Item.Content>
<Item.Actions><Badge variant="success" size="sm" dot>Done</Badge></Item.Actions>
</Item.Root>
<Item.Root size="sm" role="listitem">
<Item.Media variant="icon"><DatabaseBackupIcon /></Item.Media>
<Item.Content>
<Item.Title>Nightly backup</Item.Title>
<Item.Description>yoga-berger.de · today, 03:10</Item.Description>
</Item.Content>
<Item.Actions><Badge variant="success" size="sm" dot>Done</Badge></Item.Actions>
</Item.Root>
<Item.Root size="sm" role="listitem">
<Item.Media variant="accent"><FileTextIcon /></Item.Media>
<Item.Content>
<Item.Title>Contact form update</Item.Title>
<Item.Description>Waiting for your approval</Item.Description>
</Item.Content>
<Item.Actions><Badge variant="accent" size="sm" dot>Running</Badge></Item.Actions>
</Item.Root>
</Item.Group>Variants
default (transparent), outline, muted (bg-2) and card (white on bg).
<script lang="ts">
import * as Item from '@statix/ui/item';
import type { ItemVariant } from '@statix/ui/item';
import MailIcon from '@lucide/svelte/icons/mail';
const variants: ItemVariant[] = ['default', 'outline', 'muted', 'card'];
</script>
<div class="grid w-full max-w-2xl gap-3 sm:grid-cols-2">
{#each variants as variant (variant)}
<Item.Root {variant}>
<Item.Media variant="icon"><MailIcon /></Item.Media>
<Item.Content>
<Item.Title>info@yoga-berger.de</Item.Title>
<Item.Description>variant="{variant}"</Item.Description>
</Item.Content>
</Item.Root>
{/each}
</div>Guidelines
Do
- Make the whole row the link when it leads somewhere. Use the child snippet so it is one <a>.
- Keep the title to a few words and put details in the description.
Don't
- Don’t put several buttons in a link row. A row is either a link or has actions.
- Don’t use Item for tabular data with several columns. Use Table.
Accessibility
- Item.Group has role="list". Give each row role="listitem", or wrap link rows in an element with role="listitem".
- With the child snippet the row is a real <a> or <button>, so Tab, Enter and Space work.
- Trailing chevrons are decorative. The title is the link text.
API reference
Item.Root
renders<div> or your element and accepts its attributes| Prop | Type | Default |
|---|---|---|
variant | 'default' | 'outline' | 'muted' | 'card' Row surface. | 'default' |
size | 'default' | 'sm' | 'xs' Padding and gap. | 'default' |
child | Snippet<[{ props: Record<string, unknown> }]> Render your own element, usually an <a>, and spread props onto it. | – |
ref bind | HTMLDivElement | null The rendered element when child is not used. | – |
class | ClassValue Merged with the variant classes; yours win. | – |
| Data attribute | Meaning |
|---|---|
data-slot="item" | Always present. |
data-variant | The current variant. |
data-size | The current size. |
Item.Media
renders<div> and accepts its attributes| Prop | Type | Default |
|---|---|---|
variant | 'default' | 'icon' | 'accent' | 'image' icon is a 40px bg-2 circle, accent a primary-soft circle, image a 40px rounded thumbnail. | 'default' |
| Data attribute | Meaning |
|---|---|
data-slot="item-media" | Always present. |
Item.Content
renders<div> and accepts its attributesColumn for title and description. Takes the free space.
| Data attribute | Meaning |
|---|---|
data-slot="item-content" | Always present. |
Item.Title
renders<div> and accepts its attributesBody medium in ink, one line.
| Data attribute | Meaning |
|---|---|
data-slot="item-title" | Always present. |
Item.Description
renders<p> and accepts its attributesBody in muted, up to two lines.
| Data attribute | Meaning |
|---|---|
data-slot="item-description" | Always present. |
Item.Actions
renders<div> and accepts its attributesTrailing buttons, badges or a chevron.
| Data attribute | Meaning |
|---|---|
data-slot="item-actions" | Always present. |
Item.Header / Item.Footer
renders<div> and accepts its attributesFull-width rows above or below the main row.
Item.Group
renders<div role="list"> and accepts its attributesStacks rows with a small gap.
| Data attribute | Meaning |
|---|---|
data-slot="item-group" | Always present. |
Item.Separator
renders<div> and accepts its attributesHairline between rows in a group.