Patterns · Dashboard
ActionTile
A compact tile for one task: icon, title, one line of detail and a chevron. Use a grid of them for the common tasks on a website or domain page.
import { ActionTile } from '@statix/ui/action-tile';Playground
<ActionTile href="/backups" title="Restore website" description="As it was on an earlier day. We back up the current state first.">
{#snippet icon()}<RotateCcwIcon />{/snippet}
</ActionTile>Examples
Basic
Pass href to render a link. The chevron appears for links and buttons only.
<script lang="ts">
import { ActionTile } from '@statix/ui/action-tile';
import MailIcon from '@lucide/svelte/icons/mail';
</script>
<div class="w-full max-w-sm">
<ActionTile href="#mailboxes" title="Mailboxes" description="Manage 3 mailboxes and 1 forward">
{#snippet icon()}<MailIcon />{/snippet}
</ActionTile>
</div>Task grid
Three columns on desktop. Mark the most common task with variant="accent"; keep it to one per grid.
<script lang="ts">
import { ActionTile } from '@statix/ui/action-tile';
import GlobeIcon from '@lucide/svelte/icons/globe';
import HeadsetIcon from '@lucide/svelte/icons/headset';
import MailIcon from '@lucide/svelte/icons/mail';
import PenLineIcon from '@lucide/svelte/icons/pen-line';
import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw';
import ShieldCheckIcon from '@lucide/svelte/icons/shield-check';
const tasks = [
{
icon: PenLineIcon,
title: 'Change texts or images',
description:
'No password needed. You land right on your pages, for example the class schedule.'
},
{
icon: RotateCcwIcon,
title: 'Restore website',
description: 'As it was on an earlier day. We back up the current state first.'
},
{ icon: MailIcon, title: 'Mailboxes', description: 'Manage 3 mailboxes and 1 forward' },
{
icon: GlobeIcon,
title: 'Domain and redirects',
description: 'yoga-berger.de and yogaberger.com'
},
{
icon: ShieldCheckIcon,
title: 'Scan for viruses',
description: 'Takes about 10 minutes, the result comes by email'
},
{
icon: HeadsetIcon,
title: 'Request a change',
description: 'We make it for you. 30 minutes a month are included'
}
];
</script>
<div class="grid gap-6 p-6 sm:grid-cols-2 tablet:p-10 lg:grid-cols-3">
{#each tasks as task, i (task.title)}
<ActionTile
href="#task"
title={task.title}
description={task.description}
variant={i === 0 ? 'accent' : 'default'}
>
{#snippet icon()}<task.icon />{/snippet}
</ActionTile>
{/each}
</div>As a button
Pass onclick instead of href when the tile opens a dialog or starts something.
Not started yet.
<script lang="ts">
import { ActionTile } from '@statix/ui/action-tile';
import ShieldCheckIcon from '@lucide/svelte/icons/shield-check';
let started = $state(false);
</script>
<div class="flex w-full max-w-sm flex-col gap-3">
<ActionTile
title="Scan for viruses"
description="Takes about 10 minutes, the result comes by email"
onclick={() => (started = true)}
>
{#snippet icon()}<ShieldCheckIcon />{/snippet}
</ActionTile>
<p class="text-small text-muted-foreground" aria-live="polite">
{started ? 'Scan started. We will email you.' : 'Not started yet.'}
</p>
</div>Small size
size="sm" for stacked lists on phones.
<script lang="ts">
import { ActionTile } from '@statix/ui/action-tile';
import MailIcon from '@lucide/svelte/icons/mail';
import PenLineIcon from '@lucide/svelte/icons/pen-line';
import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw';
</script>
<div class="flex w-full max-w-[342px] flex-col gap-2.5">
<ActionTile
size="sm"
variant="accent"
href="#edit"
title="Change texts or images"
description="No password needed"
>
{#snippet icon()}<PenLineIcon />{/snippet}
</ActionTile>
<ActionTile
size="sm"
href="#restore"
title="Restore website"
description="As it was on an earlier day"
>
{#snippet icon()}<RotateCcwIcon />{/snippet}
</ActionTile>
<ActionTile size="sm" href="#mail" title="Mailboxes" description="3 mailboxes, 1 forward">
{#snippet icon()}<MailIcon />{/snippet}
</ActionTile>
</div>Guidelines
Do
- Start titles with a verb or name the thing: "Restore website", "Mailboxes".
- Keep the description to one line on desktop. Say what happens or what is inside.
- Use ProductCard for the big product entry points on the start screen, and ActionTile for tasks inside a product.
Don't
- Don’t mark more than one tile per grid as accent.
- Don’t put buttons inside the tile. The whole tile is the target.
Accessibility
- With href the tile is a single <a>; with onclick a native <button type="button">. Enter (and Space for buttons) activates it.
- The accessible name is the title followed by the description. The icon and chevron are hidden from screen readers.
- Without href and onclick the tile renders a <div> and is not focusable.
API reference
ActionTile
renders<a>, <button> or <div> and accepts its attributes| Prop | Type | Default |
|---|---|---|
title * | string Short task name. | – |
description | string One or two lines on what happens. | – |
variant | 'default' | 'accent' accent tints the icon well blue. | 'default' |
size | 'md' | 'sm' md for desktop grids, sm for mobile lists. | 'md' |
href | string Renders an <a>. | – |
onclick | (event: MouseEvent) => void Renders a <button> when href is not set. | – |
icon | Snippet Icon inside the round well. | – |
hideChevron | boolean Hides the trailing chevron. | false |
ref bind | HTMLElement | null The rendered element. | – |
class | ClassValue Merged with the tile classes; yours win. | – |
| Data attribute | Meaning |
|---|---|
data-slot="action-tile" | Root. Parts use action-tile-icon, -text, -title, -description. |
data-variant | The current variant. |
actionTileVariants
The tailwind-variants slots behind ActionTile.