Item
Data displayA row of a list: <Item.Root> (variant: default, outline, muted; size: default, sm) holds an Item.Media (an icon in a tile with variant="icon", a cropped image with variant="image"), an Item.Content with an Item.Title and an Item.Description, and Item.Actions. Item.Group makes a list of items (each one a list item), with Item.Separators between them. A row that opens something: in a group, put the link in its Item.Title, so the row stays a list item; a single row can be the link itself, with the root's child snippet.
import { Item } from '@limerdev/zest'; Table. A choice from a list: use RadioGroup or Select. A navigation menu: use Sidebar or NavigationMenu.Examples
Basic
A row: media, a title and description, and an action.
Nordlys AB, due 30 December.
<script lang="ts">
import { Button, Item } from '@limerdev/zest';
import FileTextIcon from '@lucide/svelte/icons/file-text';
</script>
<Item.Root variant="outline" class="w-full max-w-md">
<Item.Media variant="icon"><FileTextIcon aria-hidden="true" /></Item.Media>
<Item.Content>
<Item.Title>Invoice 1042</Item.Title>
<Item.Description>Nordlys AB, due 30 December.</Item.Description>
</Item.Content>
<Item.Actions><Button variant="outline" size="sm">Open</Button></Item.Actions>
</Item.Root> List
Item.Group is a list; Item.Separator divides it. A link goes in the Item.Title, so each row stays a list item.
<script lang="ts">
import { Avatar, Badge, Item } from '@limerdev/zest';
type Person = { id: string; name: string; email: string; initials: string; role: string };
const people: Person[] = [
{ id: 'p1', name: 'Anna Berg', email: 'anna@example.com', initials: 'AB', role: 'Owner' },
{ id: 'p2', name: 'Erik Lund', email: 'erik@example.com', initials: 'EL', role: 'Member' },
{ id: 'p3', name: 'Sara Ek', email: 'sara@example.com', initials: 'SE', role: 'Member' }
];
</script>
<Item.Group aria-label="Members" class="w-full max-w-md rounded-box border border-border">
{#each people as person, index (person.id)}
{#if index > 0}<Item.Separator />{/if}
<Item.Root size="sm">
<Item.Media>
<Avatar.Root><Avatar.Fallback>{person.initials}</Avatar.Fallback></Avatar.Root>
</Item.Media>
<Item.Content>
<Item.Title><a href="#{person.id}" class="hover:underline">{person.name}</a></Item.Title>
<Item.Description>{person.email}</Item.Description>
</Item.Content>
<Item.Actions><Badge variant="neutral">{person.role}</Badge></Item.Actions>
</Item.Root>
{/each}
</Item.Group> Link
A single row that opens something is the link itself, with the child snippet.
<script lang="ts">
import { Item } from '@limerdev/zest';
import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
import ShieldCheckIcon from '@lucide/svelte/icons/shield-check';
</script>
<Item.Root variant="outline" class="w-full max-w-md">
{#snippet child({ props })}
<a href="#security" {...props}>
<Item.Media variant="icon"><ShieldCheckIcon aria-hidden="true" /></Item.Media>
<Item.Content>
<Item.Title>Security</Item.Title>
<Item.Description>Two-factor sign-in and active sessions.</Item.Description>
</Item.Content>
<ChevronRightIcon aria-hidden="true" class="size-4 text-muted" />
</a>
{/snippet}
</Item.Root> Settings
variant="muted" on a settings row, with a Switch labelled by the title.
Email the client when an invoice is a week overdue.
<script lang="ts">
import { Item, Switch } from '@limerdev/zest';
let reminders: boolean = $state(true);
</script>
<Item.Root variant="muted" class="w-full max-w-md">
<Item.Content>
<Item.Title id="reminders-title">Payment reminders</Item.Title>
<Item.Description>Email the client when an invoice is a week overdue.</Item.Description>
</Item.Content>
<Item.Actions>
<Switch bind:checked={reminders} aria-labelledby="reminders-title" />
</Item.Actions>
</Item.Root> Props
Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that
renders your own element, with props to spread on it).
Item.Root
| Prop | Type | Default | Description |
|---|---|---|---|
| size | "default" | "sm" | 'default' | The padding: sm for dense lists. |
| variant | "outline" | "default" | "muted" | 'default' | The look: default is plain, outline draws a border, muted fills it with the theme's surface. |
Item.Group
No props of its own beyond the common ones.
Item.Separator
| Prop | Type | Default | Description |
|---|---|---|---|
| decorative | boolean | true | Whether the separator is decorative and should be hidden from assistive technologies. |
| orientation | "horizontal" | "vertical" | "horizontal" | The orientation of the separator. |
Item.Media
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "icon" | "image" | 'default' | icon sets an icon in a small tile, image crops an image to a square; default shows the children as they are. |
Item.Content
No props of its own beyond the common ones.
Item.Title
No props of its own beyond the common ones.
Item.Description
No props of its own beyond the common ones.
Item.Actions
No props of its own beyond the common ones.