Page layout

A page under the top bar: its width, title and actions, and an optional side menu that stays while the content scrolls.

Page

A page under the top bar: the page width, its title, its actions and its sections. The app's content area scrolls.

<script setup>
import { PlusIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@aisgroup/design/ui/card';
</script>

<template>
  <div class="h-120 overflow-y-auto bg-page text-foreground">
    <PageLayout title="Datasets" description="Images and labels of this project">
      <template #actions>
        <Button><PlusIcon data-icon="inline-start" />New dataset</Button>
      </template>
      <div class="grid gap-4 xl:grid-cols-2">
        <Card class="shadow-none">
          <CardHeader><CardTitle>Storage</CardTitle><CardDescription>12.4 GB of 50 GB</CardDescription></CardHeader>
          <CardContent class="text-muted-foreground">Side-by-side cards share the height of their row.</CardContent>
        </Card>
        <Card class="shadow-none">
          <CardHeader><CardTitle>Recent uploads</CardTitle></CardHeader>
          <CardContent class="text-muted-foreground">3 uploads today</CardContent>
        </Card>
      </div>
    </PageLayout>
  </div>
</template>

With nav

With a side menu, as Settings: the title and the menu stay, only the content scrolls; below 1024 px the menu is a row above it.

<script setup>
import { KeyRoundIcon, RefreshCwIcon, UsersIcon } from '@lucide/vue';
import { ref } from 'vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Card, CardContent, CardHeader, CardTitle } from '@aisgroup/design/ui/card';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@aisgroup/design/ui/tabs';

const tab = ref('users');
const tabs = [
  { id: 'users', name: 'Users', icon: UsersIcon },
  { id: 'access', name: 'Access', icon: KeyRoundIcon },
  { id: 'sync', name: 'Synchronization', icon: RefreshCwIcon },
];
</script>

<template>
  <div class="h-120 overflow-y-auto bg-page text-foreground">
    <Tabs v-model="tab" orientation="vertical" class="h-full">
      <PageLayout title="Settings" description="Users, access and synchronization of this project">
        <template #nav>
          <TabsList variant="nav" class="max-lg:flex-row! max-lg:overflow-x-auto">
            <TabsTrigger v-for="item in tabs" :key="item.id" :value="item.id"><component :is="item.icon" />{{ item.name }}</TabsTrigger>
          </TabsList>
        </template>
        <TabsContent v-for="item in tabs" :key="item.id" :value="item.id" class="flex flex-col gap-4">
          <Card v-for="n in 4" :key="n" class="shadow-none">
            <CardHeader><CardTitle>{{ item.name }} {{ n }}</CardTitle></CardHeader>
            <CardContent class="h-24 text-muted-foreground">Only this column scrolls.</CardContent>
          </Card>
        </TabsContent>
      </PageLayout>
    </Tabs>
  </div>
</template>

List

A list page: the toolbar and the table straight on the page, numbered pages under it. A role is a word; a status is an icon and a word.

<script setup>
import { ref } from 'vue';
import { BanIcon, ClockIcon, EllipsisIcon, PencilIcon, PlusIcon, SearchIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { DataTable } from '@aisgroup/design/ui/data-table';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '@aisgroup/design/ui/dropdown-menu';
import { InputGroup, InputGroupAddon, InputGroupInput } from '@aisgroup/design/ui/input-group';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@aisgroup/design/ui/select';
import { StatusLabel } from '@aisgroup/design/ui/status-label';

const statuses = { active: { label: 'Active', tone: 'success' }, pending: { label: 'Pending', icon: ClockIcon }, disabled: { label: 'Disabled', icon: BanIcon } };
const roles = ['Owner', 'Administrator', 'HR administrator', 'Worker', 'Viewer'];
const users = [
  ['Laura Vidal', 'laura.vidal@example.com', 'Owner', 'active'], ['Marc Puig', 'marc.puig@example.com', 'Administrator', 'active'],
  ['Núria Soler', 'nuria.soler@example.com', 'HR administrator', 'active'], ['Jordi Ferrer', 'jordi.ferrer@example.com', 'Worker', 'active'],
  ['Anna Roca', 'anna.roca@example.com', 'Worker', 'pending'], ['Pau Serra', 'pau.serra@example.com', 'Viewer', 'active'],
  ['Clara Mas', 'clara.mas@example.com', 'Worker', 'disabled'], ['Oriol Font', 'oriol.font@example.com', 'Worker', 'active'],
].map(([name, email, role, status]) => ({ name, email, role, status }));
const columns = [
  { accessorKey: 'name', header: 'Name' },
  { accessorKey: 'email', header: 'Email' },
  { accessorKey: 'role', header: 'Role', filterFn: 'equalsString' },
  { accessorKey: 'status', header: 'Status', filterFn: 'equalsString' },
  { id: 'actions', header: () => null, enableSorting: false },
];
const search = ref('');
const role = ref('all');
const status = ref('all');
const filter = (table, column, value) => table.getColumn(column)?.setFilterValue(value === 'all' ? undefined : value);
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Users" description="8 people can sign in">
      <template #actions>
        <Button><PlusIcon data-icon="inline-start" />Invite user</Button>
      </template>
      <DataTable v-model:global-filter="search" :columns="columns" :data="users" :page-size="5" :get-row-id="(row) => row.email">
        <template #toolbar="{ table }">
          <div class="flex flex-wrap items-center gap-2">
            <InputGroup class="w-full bg-card sm:max-w-xs">
              <InputGroupAddon><SearchIcon /></InputGroupAddon>
              <InputGroupInput v-model="search" placeholder="Search users" aria-label="Search users" />
            </InputGroup>
            <Select v-model="role" @update:model-value="(v) => filter(table, 'role', v)">
              <SelectTrigger class="min-w-0 flex-1 bg-card sm:w-48 sm:flex-none" aria-label="Role"><SelectValue /></SelectTrigger>
              <SelectContent>
                <SelectItem value="all">All roles</SelectItem>
                <SelectItem v-for="r in roles" :key="r" :value="r">{{ r }}</SelectItem>
              </SelectContent>
            </Select>
            <Select v-model="status" @update:model-value="(v) => filter(table, 'status', v)">
              <SelectTrigger class="min-w-0 flex-1 bg-card sm:w-40 sm:flex-none" aria-label="Status"><SelectValue /></SelectTrigger>
              <SelectContent>
                <SelectItem value="all">All statuses</SelectItem>
                <SelectItem v-for="(s, key) in statuses" :key="key" :value="key">{{ s.label }}</SelectItem>
              </SelectContent>
            </Select>
          </div>
        </template>
        <template #cell-name="{ getValue }"><span class="font-medium">{{ getValue() }}</span></template>
        <template #cell-email="{ getValue }"><span class="text-muted-foreground">{{ getValue() }}</span></template>
        <template #cell-status="{ getValue }">
          <StatusLabel :tone="statuses[getValue()].tone" :icon="statuses[getValue()].icon">{{ statuses[getValue()].label }}</StatusLabel>
        </template>
        <template #cell-actions="{ row }">
          <div class="flex justify-end">
            <DropdownMenu>
              <DropdownMenuTrigger as-child><Button variant="ghost" size="icon-sm" :aria-label="`Actions for ${row.original.name}`"><EllipsisIcon /></Button></DropdownMenuTrigger>
              <DropdownMenuContent align="end">
                <DropdownMenuItem><PencilIcon />Edit</DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuItem variant="destructive"><BanIcon />Disable</DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </div>
        </template>
      </DataTable>
    </PageLayout>
  </div>
</template>

Detail

A detail page: the person's name as the title, then sections separated by space. Facts are a label-over-value grid, lists are divided rows, the side column holds the access summary.

<script setup>
import { ClockIcon, EllipsisIcon, PencilIcon, UserXIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@aisgroup/design/ui/dropdown-menu';
import { StatusLabel } from '@aisgroup/design/ui/status-label';

const details = [['Email', 'laura.vidal@example.com'], ['Phone', '+34 600 123 456'], ['Department', 'Quality'], ['Manager', 'Marc Puig'], ['Location', 'Barcelona'], ['Started', '3 March 2025']];
const access = [['Role', 'Owner'], ['Last sign-in', 'Today, 08:12'], ['Two-step sign-in', 'On']];
const trainings = [
  { name: 'Machine safety', date: '12 May 2026', status: 'Valid', tone: 'success' },
  { name: 'Forklift licence', date: '2 December 2026', status: 'Expires soon', tone: 'warning', icon: ClockIcon },
  { name: 'First aid', date: '15 January 2026', status: 'Expired', tone: 'destructive' },
];
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Laura Vidal" description="Quality engineer">
      <template #actions>
        <Button variant="outline"><PencilIcon data-icon="inline-start" />Edit</Button>
        <DropdownMenu>
          <DropdownMenuTrigger as-child><Button variant="outline" size="icon" aria-label="More actions"><EllipsisIcon /></Button></DropdownMenuTrigger>
          <DropdownMenuContent align="end">
            <DropdownMenuItem variant="destructive"><UserXIcon />Deactivate</DropdownMenuItem>
          </DropdownMenuContent>
        </DropdownMenu>
      </template>
      <div class="grid gap-10 lg:grid-cols-[minmax(0,1fr)_18rem]">
        <div class="flex flex-col gap-10">
          <section class="flex flex-col gap-4">
            <h2 class="font-heading text-lg font-medium">Details</h2>
            <dl class="grid gap-x-6 gap-y-4 sm:grid-cols-2 xl:grid-cols-3">
              <div v-for="[label, value] in details" :key="label" class="min-w-0"><dt class="text-muted-foreground">{{ label }}</dt><dd class="break-words">{{ value }}</dd></div>
            </dl>
          </section>
          <section class="flex flex-col gap-4">
            <div class="flex items-center justify-between gap-6">
              <div class="flex flex-col gap-1">
                <h2 class="font-heading text-lg font-medium">Trainings</h2>
                <p class="text-muted-foreground">1 expired</p>
              </div>
              <Button variant="outline">Add training</Button>
            </div>
            <ul class="divide-y border-y">
              <li v-for="t in trainings" :key="t.name" class="flex items-center justify-between gap-4 py-3">
                <span class="font-medium">{{ t.name }}</span>
                <span class="flex items-center gap-4 text-muted-foreground">
                  <span class="tabular-nums max-sm:hidden">{{ t.date }}</span>
                  <StatusLabel class="w-32" :tone="t.tone" :icon="t.icon">{{ t.status }}</StatusLabel>
                </span>
              </li>
            </ul>
          </section>
        </div>
        <section class="flex flex-col gap-4">
          <h2 class="font-heading text-lg font-medium">Access</h2>
          <dl class="flex flex-col gap-4">
            <div v-for="[label, value] in access" :key="label"><dt class="text-muted-foreground">{{ label }}</dt><dd>{{ value }}</dd></div>
          </dl>
        </section>
      </div>
    </PageLayout>
  </div>
</template>

Settings

A settings page with its side menu, as PageLayout's: one section per tab, labels above the controls, switches as rows of one bordered list, Save then Cancel at the bottom left.

<script setup>
import { ref } from 'vue';
import { BellIcon, SlidersHorizontalIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel } from '@aisgroup/design/ui/field';
import { Input } from '@aisgroup/design/ui/input';
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@aisgroup/design/ui/select';
import { Switch } from '@aisgroup/design/ui/switch';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@aisgroup/design/ui/tabs';

const tab = ref('general');
</script>

<template>
  <div class="h-120 w-full overflow-y-auto bg-page text-foreground">
    <Tabs v-model="tab" orientation="vertical" class="h-full">
      <PageLayout title="Settings">
        <template #nav>
          <TabsList variant="nav" class="max-lg:flex-row! max-lg:overflow-x-auto">
            <TabsTrigger value="general"><SlidersHorizontalIcon />General</TabsTrigger>
            <TabsTrigger value="notifications"><BellIcon />Notifications</TabsTrigger>
          </TabsList>
        </template>
        <TabsContent value="general">
          <form class="flex max-w-sm flex-col gap-6" @submit.prevent>
            <h2 class="font-heading text-lg font-medium">Workspace</h2>
            <FieldGroup>
              <Field>
                <FieldLabel for="s-name">Name</FieldLabel>
                <Input id="s-name" model-value="Line 2" class="bg-card" />
              </Field>
              <Field>
                <FieldLabel for="s-zone">Time zone</FieldLabel>
                <Select model-value="madrid">
                  <SelectTrigger id="s-zone" class="w-full bg-card"><SelectValue /></SelectTrigger>
                  <SelectContent>
                    <SelectItem value="madrid">Europe/Madrid</SelectItem>
                    <SelectItem value="london">Europe/London</SelectItem>
                  </SelectContent>
                </Select>
              </Field>
            </FieldGroup>
            <div class="flex gap-2">
              <Button type="submit">Save</Button>
              <Button type="button" variant="outline">Cancel</Button>
            </div>
          </form>
        </TabsContent>
        <TabsContent value="notifications">
          <section class="flex max-w-sm flex-col gap-4">
            <h2 class="font-heading text-lg font-medium">Email</h2>
            <div class="divide-y rounded-lg border bg-card">
              <Field orientation="horizontal" class="p-4">
                <FieldContent><FieldLabel for="s-mail">When a validation waits</FieldLabel><FieldDescription>One email a day at most.</FieldDescription></FieldContent>
                <Switch id="s-mail" :model-value="true" />
              </Field>
              <Field orientation="horizontal" class="p-4">
                <FieldContent><FieldLabel for="s-fail">When an automation fails</FieldLabel></FieldContent>
                <Switch id="s-fail" />
              </Field>
            </div>
          </section>
        </TabsContent>
      </PageLayout>
    </Tabs>
  </div>
</template>

Dashboard

A dashboard: the figures first in Figure cards, then one Card per subject with its real content, side by side and as tall as their row.

<script setup>
import { VisAxis, VisStackedBar, VisXYContainer } from '@unovis/vue';
import FigureCards from '@aisgroup/design/blocks/FigureCards.vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from '@aisgroup/design/ui/card';
import { ChartContainer, ChartCrosshair, ChartTooltip, ChartTooltipContent, componentToString } from '@aisgroup/design/ui/chart';

const figures = [{ id: 'users', label: 'Users', value: 10 }, { id: 'automations', label: 'Active automations', value: '0 of 1' }, { id: 'integrations', label: 'Integrations', value: 7 }, { id: 'actions', label: 'Actions today', value: 24 }];
const validations = [['Expense report, March', 'Jordi Ferrer', '2 days'], ['Holiday request', 'Anna Roca', '1 day'], ['New supplier', 'Marc Puig', '5 hours']];
const activity = [{ day: 'Mon', actions: 31 }, { day: 'Tue', actions: 42 }, { day: 'Wed', actions: 28 }, { day: 'Thu', actions: 37 }, { day: 'Fri', actions: 45 }, { day: 'Sat', actions: 6 }, { day: 'Sun', actions: 24 }];
const config = { actions: { label: 'Actions', color: 'var(--chart-1)' } };
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Dashboard">
      <FigureCards :figures="figures" />
      <div class="grid gap-4 xl:grid-cols-2">
        <Card>
          <CardHeader>
            <CardTitle>Pending validations</CardTitle>
            <CardDescription>3 waiting for you</CardDescription>
            <CardAction><Button variant="outline" size="sm">Open</Button></CardAction>
          </CardHeader>
          <CardContent>
            <ul class="divide-y">
              <li v-for="[name, by, age] in validations" :key="name" class="flex items-center justify-between gap-4 py-3">
                <span class="flex min-w-0 flex-col"><span class="truncate font-medium">{{ name }}</span><span class="text-muted-foreground">{{ by }}</span></span>
                <span class="shrink-0 text-muted-foreground tabular-nums">{{ age }}</span>
              </li>
            </ul>
          </CardContent>
        </Card>
        <Card>
          <CardHeader>
            <CardTitle>Activity</CardTitle>
            <CardDescription>Actions per day, last week</CardDescription>
          </CardHeader>
          <CardContent>
            <ChartContainer :config="config" class="aspect-[2/1] max-h-56 w-full">
              <VisXYContainer :data="activity" :padding="{ top: 8 }">
                <VisStackedBar :x="(d, i) => i" :y="(d) => d.actions" :color="config.actions.color" :rounded-corners="0" :bar-max-width="24" />
                <VisAxis type="x" :x="(d, i) => i" :tick-format="(i) => activity[i]?.day" :tick-values="activity.map((d, i) => i)" :tick-line="false" :domain-line="false" :grid-line="false" />
                <VisAxis type="y" :num-ticks="3" :tick-line="false" :domain-line="false" />
                <ChartTooltip />
                <ChartCrosshair :template="componentToString(config, ChartTooltipContent, { labelFormatter: (i) => activity[i]?.day })" color="transparent" />
              </VisXYContainer>
            </ChartContainer>
          </CardContent>
        </Card>
      </div>
    </PageLayout>
  </div>
</template>

Empty

Nothing to list yet: the Empty takes the place the list would fill, says why and offers the way out. The header stays as on the full page.

<script setup>
import { PlusIcon, UsersIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@aisgroup/design/ui/empty';
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Users">
      <template #actions>
        <Button><PlusIcon data-icon="inline-start" />Invite user</Button>
      </template>
      <Empty class="min-h-80 border border-dashed bg-card">
        <EmptyHeader>
          <EmptyMedia><UsersIcon class="size-6 text-muted-foreground" /></EmptyMedia>
          <EmptyTitle>No users yet</EmptyTitle>
          <EmptyDescription>Invite the people who work in this workspace.</EmptyDescription>
        </EmptyHeader>
        <EmptyContent><Button variant="outline"><PlusIcon data-icon="inline-start" />Invite user</Button></EmptyContent>
      </Empty>
    </PageLayout>
  </div>
</template>

No permission

A page the person may not see: the title stays, the Empty fills the content with the reason and who can help. Never a short dashed line with the page blank below.

<script setup>
import { LockIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@aisgroup/design/ui/empty';
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Licence renewals">
      <Empty class="min-h-80 border border-dashed bg-card">
        <EmptyHeader>
          <EmptyMedia><LockIcon class="size-6 text-muted-foreground" /></EmptyMedia>
          <EmptyTitle>You don’t have access to this page</EmptyTitle>
          <EmptyDescription>Ask an administrator for the renewals permission.</EmptyDescription>
        </EmptyHeader>
      </Empty>
    </PageLayout>
  </div>
</template>

Error

The page could not load: the Empty fills the content, says what failed and offers Retry, which repeats the same request. A section that fails inside a loaded page is an Alert with Retry in its place.

<script setup>
import { CircleXIcon, PlusIcon, RotateCwIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '@aisgroup/design/ui/empty';
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Users">
      <template #actions>
        <Button disabled><PlusIcon data-icon="inline-start" />Invite user</Button>
      </template>
      <Empty class="min-h-80 border border-dashed bg-card">
        <EmptyHeader>
          <EmptyMedia variant="error"><CircleXIcon /></EmptyMedia>
          <EmptyTitle>The users could not load</EmptyTitle>
          <EmptyDescription>The server did not answer.</EmptyDescription>
        </EmptyHeader>
        <EmptyContent><Button variant="outline"><RotateCwIcon data-icon="inline-start" />Retry</Button></EmptyContent>
      </Empty>
    </PageLayout>
  </div>
</template>

Tasks

A task list, as in shadcn's tasks example: a search, filters whose choices show as chips, the visible columns, the table straight on the page with row selection and row actions, numbered pages.

<script setup>
import { computed, ref } from 'vue';
import { ArrowDownIcon, ArrowRightIcon, ArrowUpIcon, CircleCheckIcon, CircleDashedIcon, CircleIcon, CircleOffIcon, CopyIcon, EllipsisIcon, PencilIcon, PlusIcon, SearchIcon, StarIcon, TagIcon, TimerIcon, Trash2Icon, XIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Badge } from '@aisgroup/design/ui/badge';
import { Button } from '@aisgroup/design/ui/button';
import { DataTable, DataTableFacetedFilter, DataTableViewOptions } from '@aisgroup/design/ui/data-table';
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger } from '@aisgroup/design/ui/dropdown-menu';
import { InputGroup, InputGroupAddon, InputGroupInput } from '@aisgroup/design/ui/input-group';
import { StatusLabel } from '@aisgroup/design/ui/status-label';

const statuses = [
  { value: 'backlog', label: 'Backlog', icon: CircleDashedIcon },
  { value: 'todo', label: 'To do', icon: CircleIcon },
  { value: 'in-progress', label: 'In progress', icon: TimerIcon },
  { value: 'done', label: 'Done', icon: CircleCheckIcon },
  { value: 'canceled', label: 'Canceled', icon: CircleOffIcon },
];
const priorities = [
  { value: 'low', label: 'Low', icon: ArrowDownIcon },
  { value: 'medium', label: 'Medium', icon: ArrowRightIcon },
  { value: 'high', label: 'High', icon: ArrowUpIcon },
];
const labels = ['Bug', 'Feature', 'Documentation'];
const tasks = ref([
  ['TASK-1042', 'Bug', 'Recalibrate the line 3 camera after the lens change', 'in-progress', 'high'],
  ['TASK-1041', 'Feature', 'Export rejected images with their defect class', 'todo', 'medium'],
  ['TASK-1039', 'Documentation', 'Write the operator guide for the new reject gate', 'backlog', 'low'],
  ['TASK-1037', 'Bug', 'Fix the duplicated alarm after a PLC reconnect', 'done', 'high'],
  ['TASK-1036', 'Feature', 'Show the model version on the inspection screen', 'in-progress', 'medium'],
  ['TASK-1034', 'Bug', 'Keep the label tracker running after a dataset rename', 'todo', 'high'],
  ['TASK-1031', 'Feature', 'Compare two models on the same validation set', 'backlog', 'medium'],
  ['TASK-1030', 'Documentation', 'Update the installation checklist for blister lines', 'done', 'low'],
  ['TASK-1028', 'Bug', 'Stop the upload from skipping images with long names', 'canceled', 'medium'],
  ['TASK-1025', 'Feature', 'Schedule nightly retraining for the tortilla line', 'todo', 'low'],
  ['TASK-1023', 'Bug', 'Correct the shift totals on the production report', 'in-progress', 'high'],
  ['TASK-1020', 'Documentation', 'Describe the access roles for service partners', 'backlog', 'low'],
  ['TASK-1018', 'Feature', 'Filter the image gallery by reject reason', 'done', 'medium'],
  ['TASK-1016', 'Bug', 'Align the timestamps of camera and PLC events', 'todo', 'medium'],
].map(([id, label, title, status, priority]) => ({ id, label, title, status, priority })));

const columns = [
  { accessorKey: 'id', header: 'Task' },
  { accessorKey: 'title', header: 'Title' },
  { accessorKey: 'status', header: 'Status', filterFn: 'arrHas' },
  { accessorKey: 'priority', header: 'Priority', filterFn: 'arrHas' },
  { id: 'actions', header: () => null, enableSorting: false, enableHiding: false },
];
const byValue = (list, value) => list.find((item) => item.value === value);
const open = computed(() => tasks.value.filter((task) => !['done', 'canceled'].includes(task.status)).length);
const search = ref('');
const selected = ref({});
const filtered = (table) => search.value || ['status', 'priority'].some((id) => table.getColumn(id)?.getFilterValue());
function reset(table) {
  search.value = '';
  for (const id of ['status', 'priority']) table.getColumn(id)?.setFilterValue(undefined);
}
</script>

<template>
  <div class="min-h-120 w-full bg-page text-foreground">
    <PageLayout title="Tasks" :description="`${open} open tasks`">
      <template #actions>
        <Button><PlusIcon data-icon="inline-start" />New task</Button>
      </template>
      <DataTable v-model:global-filter="search" v-model:row-selection="selected" :columns="columns" :data="tasks" :page-size="8" :get-row-id="(row) => row.id" selectable>
        <template #toolbar="{ table }">
          <div class="flex flex-wrap items-center gap-2">
            <InputGroup class="w-full bg-card sm:max-w-xs">
              <InputGroupAddon><SearchIcon /></InputGroupAddon>
              <InputGroupInput v-model="search" placeholder="Search tasks" aria-label="Search tasks" />
            </InputGroup>
            <DataTableFacetedFilter :column="table.getColumn('status')" title="Status" :options="statuses" />
            <DataTableFacetedFilter :column="table.getColumn('priority')" title="Priority" :options="priorities" />
            <Button v-if="filtered(table)" variant="ghost" @click="reset(table)">Reset<XIcon data-icon="inline-end" /></Button>
            <DataTableViewOptions :table="table" class="bg-card sm:ml-auto" />
          </div>
        </template>
        <template #cell-id="{ getValue }"><span class="text-muted-foreground tabular-nums">{{ getValue() }}</span></template>
        <template #cell-title="{ row }">
          <span class="flex min-w-0 items-center gap-2">
            <Badge variant="outline">{{ row.original.label }}</Badge>
            <span class="max-w-md truncate font-medium">{{ row.original.title }}</span>
          </span>
        </template>
        <template #cell-status="{ getValue }">
          <StatusLabel :tone="getValue() === 'done' ? 'success' : 'neutral'" :icon="byValue(statuses, getValue()).icon">{{ byValue(statuses, getValue()).label }}</StatusLabel>
        </template>
        <template #cell-priority="{ getValue }">
          <span class="flex items-center gap-1.5 text-muted-foreground"><component :is="byValue(priorities, getValue()).icon" class="size-4" />{{ byValue(priorities, getValue()).label }}</span>
        </template>
        <template #cell-actions="{ row }">
          <div class="flex justify-end">
            <DropdownMenu>
              <DropdownMenuTrigger as-child><Button variant="ghost" size="icon-sm" :aria-label="`Actions for ${row.original.id}`"><EllipsisIcon /></Button></DropdownMenuTrigger>
              <DropdownMenuContent align="end">
                <DropdownMenuItem><PencilIcon />Edit</DropdownMenuItem>
                <DropdownMenuItem><CopyIcon />Make a copy</DropdownMenuItem>
                <DropdownMenuItem><StarIcon />Favourite</DropdownMenuItem>
                <DropdownMenuSeparator />
                <DropdownMenuSub>
                  <DropdownMenuSubTrigger><TagIcon />Label</DropdownMenuSubTrigger>
                  <DropdownMenuSubContent>
                    <DropdownMenuRadioGroup v-model="row.original.label">
                      <DropdownMenuRadioItem v-for="label in labels" :key="label" :value="label">{{ label }}</DropdownMenuRadioItem>
                    </DropdownMenuRadioGroup>
                  </DropdownMenuSubContent>
                </DropdownMenuSub>
                <DropdownMenuSeparator />
                <DropdownMenuItem variant="destructive"><Trash2Icon />Delete</DropdownMenuItem>
              </DropdownMenuContent>
            </DropdownMenu>
          </div>
        </template>
      </DataTable>
    </PageLayout>
  </div>
</template>

Status and facts

The state of what the page shows beside its title (#status), and its facts as a line under it (#description) when they are more than plain text.

<script setup>
import { ExternalLinkIcon } from '@lucide/vue';
import PageLayout from '@aisgroup/design/blocks/PageLayout.vue';
import { Button } from '@aisgroup/design/ui/button';
import { StatusLabel } from '@aisgroup/design/ui/status-label';
</script>

<template>
  <div class="h-60 overflow-y-auto bg-page text-foreground">
    <PageLayout title="line-3-inspection">
      <template #status>
        <StatusLabel tone="success">Online</StatusLabel>
      </template>
      <template #description>
        <span><span class="font-medium text-foreground">Pro</span> plan</span>
        <span>Expires in <span class="font-medium text-foreground tabular-nums">44</span> days</span>
        <span class="font-mono">rp-line-3</span>
      </template>
      <template #actions>
        <Button variant="outline">Open in Rosepetal<ExternalLinkIcon data-icon="inline-end" /></Button>
      </template>
    </PageLayout>
  </div>
</template>

Type to search the guide.