Item
A row with a picture or icon, a title, a description and actions. Use it for lists of people, files or settings. Same markup and props in every style: switch the style in the header to see it change.
Basic
An outlined item with an avatar and a button, and a muted item with an icon.
Ada Lovelace
ada@example.com
Two-step sign-in
Ask for a code when you sign in on a new device.
<div style="display: grid; gap: 12px; width: 100%; max-width: 420px">
<div class="vin-item vin-item--outline">
<div class="vin-item__media">
<span class="vin-avatar" role="img" aria-label="Ada Lovelace">
<img class="vin-avatar__img" src="/ui/avatars/ada.svg" alt="">
<span class="vin-avatar__fallback">AL</span>
</span>
</div>
<div class="vin-item__content">
<p class="vin-item__title">Ada Lovelace</p>
<p class="vin-item__description">ada@example.com</p>
</div>
<div class="vin-item__actions">
<button type="button" class="vin-btn vin-btn--outline vin-btn--sm">Invite</button>
</div>
</div>
<div class="vin-item vin-item--muted">
<div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="2"/><path d="M8 11V7a4 4 0 0 1 8 0v4"/></svg></div>
<div class="vin-item__content">
<p class="vin-item__title">Two-step sign-in</p>
<p class="vin-item__description">Ask for a code when you sign in on a new device.</p>
</div>
<div class="vin-item__actions">
<button type="button" class="vin-btn vin-btn--sm">Turn on</button>
</div>
</div>
</div>Ada Lovelace
ada@example.com
Two-step sign-in
Ask for a code when you sign in on a new device.
import { Item } from "@/components/vin/item";
import { Avatar } from "@/components/vin/avatar";
import { Button } from "@/components/vin/button";
const Lock = () => (
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /></svg>
);
export function ItemBasic() {
return (
<div style={{ display: "grid", gap: 12, width: "100%", maxWidth: 420 }}>
<Item
variant="outline"
media={<Avatar name="Ada Lovelace" src="/ui/avatars/ada.svg" />}
title="Ada Lovelace"
description="ada@example.com"
actions={<Button variant="outline" size="sm">Invite</Button>}
/>
<Item
variant="muted"
media={<Lock />}
title="Two-step sign-in"
description="Ask for a code when you sign in on a new device."
actions={<Button size="sm">Turn on</Button>}
/>
</div>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Item from "@/components/vin/item.vue";
import Avatar from "@/components/vin/avatar.vue";
import Button from "@/components/vin/button.vue";
</script>
<template>
<div style="display: grid; gap: 12px; width: 100%; max-width: 420px">
<Item variant="outline" title="Ada Lovelace" description="ada@example.com">
<template #media><Avatar name="Ada Lovelace" src="/ui/avatars/ada.svg" /></template>
<template #actions><Button variant="outline" size="sm">Invite</Button></template>
</Item>
<Item variant="muted" title="Two-step sign-in" description="Ask for a code when you sign in on a new device.">
<template #media><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /></svg></template>
<template #actions><Button size="sm">Turn on</Button></template>
</Item>
</div>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Item from "$lib/components/vin/item.svelte";
import Avatar from "$lib/components/vin/avatar.svelte";
import Button from "$lib/components/vin/button.svelte";
</script>
<div style="display: grid; gap: 12px; width: 100%; max-width: 420px">
<Item variant="outline" title="Ada Lovelace" description="ada@example.com">
{#snippet media()}<Avatar name="Ada Lovelace" src="/ui/avatars/ada.svg" />{/snippet}
{#snippet actions()}<Button variant="outline" size="sm">Invite</Button>{/snippet}
</Item>
<Item variant="muted" title="Two-step sign-in" description="Ask for a code when you sign in on a new device.">
{#snippet media()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="5" y="11" width="14" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /></svg>{/snippet}
{#snippet actions()}<Button size="sm">Turn on</Button>{/snippet}
</Item>
</div>Group
Items in a list with lines between them.
Brand guidelines.pdf
2.4 MB · Edited today
Hero image.png
840 KB · Edited yesterday
Release notes.md
12 KB · Edited 3 days ago
<div class="vin-item-group" role="list" style="max-width: 420px">
<div class="vin-item" role="listitem">
<div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/></svg></div>
<div class="vin-item__content">
<p class="vin-item__title">Brand guidelines.pdf</p>
<p class="vin-item__description">2.4 MB · Edited today</p>
</div>
<div class="vin-item__actions"><span class="vin-badge vin-badge--success">Shared</span></div>
</div>
<div class="vin-item" role="listitem">
<div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-5-5L5 21"/></svg></div>
<div class="vin-item__content">
<p class="vin-item__title">Hero image.png</p>
<p class="vin-item__description">840 KB · Edited yesterday</p>
</div>
<div class="vin-item__actions"><span class="vin-badge">Draft</span></div>
</div>
<div class="vin-item" role="listitem">
<div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"/><path d="M14 3v6h6"/><path d="M8 13h8M8 17h5"/></svg></div>
<div class="vin-item__content">
<p class="vin-item__title">Release notes.md</p>
<p class="vin-item__description">12 KB · Edited 3 days ago</p>
</div>
<div class="vin-item__actions"><span class="vin-badge">Draft</span></div>
</div>
</div>Brand guidelines.pdf
2.4 MB · Edited today
Hero image.png
840 KB · Edited yesterday
Release notes.md
12 KB · Edited 3 days ago
import { Item, ItemGroup } from "@/components/vin/item";
import { Badge } from "@/components/vin/badge";
const Icon = ({ children }: { children: React.ReactNode }) => (
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">{children}</svg>
);
const file = <><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" /></>;
export function ItemGroupExample() {
return (
<ItemGroup style={{ maxWidth: 420 }}>
<Item media={<Icon>{file}</Icon>} title="Brand guidelines.pdf" description="2.4 MB · Edited today" actions={<Badge variant="success">Shared</Badge>} />
<Item
media={<Icon><rect x="3" y="3" width="18" height="18" rx="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-5-5L5 21" /></Icon>}
title="Hero image.png"
description="840 KB · Edited yesterday"
actions={<Badge>Draft</Badge>}
/>
<Item media={<Icon>{file}<path d="M8 13h8M8 17h5" /></Icon>} title="Release notes.md" description="12 KB · Edited 3 days ago" actions={<Badge>Draft</Badge>} />
</ItemGroup>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Item, { ItemGroup } from "@/components/vin/item.vue";
import Badge from "@/components/vin/badge.vue";
</script>
<template>
<ItemGroup style="max-width: 420px">
<Item title="Brand guidelines.pdf" description="2.4 MB · Edited today">
<template #media><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" /></svg></template>
<template #actions><Badge variant="success">Shared</Badge></template>
</Item>
<Item title="Hero image.png" description="840 KB · Edited yesterday">
<template #media><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-5-5L5 21" /></svg></template>
<template #actions><Badge>Draft</Badge></template>
</Item>
<Item title="Release notes.md" description="12 KB · Edited 3 days ago">
<template #media><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" /><path d="M8 13h8M8 17h5" /></svg></template>
<template #actions><Badge>Draft</Badge></template>
</Item>
</ItemGroup>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Item from "$lib/components/vin/item.svelte";
import ItemGroup from "$lib/components/vin/item-group.svelte";
import Badge from "$lib/components/vin/badge.svelte";
</script>
<ItemGroup style="max-width: 420px">
<Item title="Brand guidelines.pdf" description="2.4 MB · Edited today">
{#snippet media()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" /></svg>{/snippet}
{#snippet actions()}<Badge variant="success">Shared</Badge>{/snippet}
</Item>
<Item title="Hero image.png" description="840 KB · Edited yesterday">
{#snippet media()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-5-5L5 21" /></svg>{/snippet}
{#snippet actions()}<Badge>Draft</Badge>{/snippet}
</Item>
<Item title="Release notes.md" description="12 KB · Edited 3 days ago">
{#snippet media()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" /><path d="M8 13h8M8 17h5" /></svg>{/snippet}
{#snippet actions()}<Badge>Draft</Badge>{/snippet}
</Item>
</ItemGroup>As links
When the whole row goes somewhere, make the item a link and end it with a chevron.
<div style="display: grid; gap: 8px; width: 100%; max-width: 420px">
<a class="vin-item vin-item--outline" href="#">
<div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0 1 16 0"/></svg></div>
<div class="vin-item__content">
<p class="vin-item__title">Profile</p>
<p class="vin-item__description">Name, photo and email</p>
</div>
<div class="vin-item__actions"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6"/></svg></div>
</a>
<a class="vin-item vin-item--outline" href="#">
<div class="vin-item__media"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg></div>
<div class="vin-item__content">
<p class="vin-item__title">Notifications</p>
<p class="vin-item__description">Email and push</p>
</div>
<div class="vin-item__actions"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6"/></svg></div>
</a>
</div>import { Item } from "@/components/vin/item";
const Icon = ({ children }: { children: React.ReactNode }) => (
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">{children}</svg>
);
const Chevron = () => <Icon><path d="m9 6 6 6-6 6" /></Icon>;
export function ItemLink() {
return (
<div style={{ display: "grid", gap: 8, width: "100%", maxWidth: 420 }}>
<Item variant="outline" href="#" media={<Icon><circle cx="12" cy="8" r="4" /><path d="M4 21a8 8 0 0 1 16 0" /></Icon>} title="Profile" description="Name, photo and email" actions={<Chevron />} />
<Item
variant="outline"
href="#"
media={<Icon><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" /></Icon>}
title="Notifications"
description="Email and push"
actions={<Chevron />}
/>
</div>
);
}The Vue version renders the same markup as the HTML tab, so it looks and works the same.
<script setup lang="ts">
import Item from "@/components/vin/item.vue";
</script>
<template>
<div style="display: grid; gap: 8px; width: 100%; max-width: 420px">
<Item variant="outline" href="#" title="Profile" description="Name, photo and email">
<template #media><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4" /><path d="M4 21a8 8 0 0 1 16 0" /></svg></template>
<template #actions><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6" /></svg></template>
</Item>
<Item variant="outline" href="#" title="Notifications" description="Email and push">
<template #media><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" /></svg></template>
<template #actions><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6" /></svg></template>
</Item>
</div>
</template>The Svelte version renders the same markup as the HTML tab, so it looks and works the same.
<script lang="ts">
import Item from "$lib/components/vin/item.svelte";
</script>
<div style="display: grid; gap: 8px; width: 100%; max-width: 420px">
<Item variant="outline" href="#profile" title="Profile" description="Name, photo and email">
{#snippet media()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="8" r="4" /><path d="M4 21a8 8 0 0 1 16 0" /></svg>{/snippet}
{#snippet actions()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6" /></svg>{/snippet}
</Item>
<Item variant="outline" href="#notifications" title="Notifications" description="Email and push">
{#snippet media()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0" /></svg>{/snippet}
{#snippet actions()}<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 6 6 6-6 6" /></svg>{/snippet}
</Item>
</div>Installation
React, Vue and Svelte: add the component to your project with the CLI. It reads your framework from vin.json and also copies any component this one needs. Then import it:
npx @vinish/ui add itemimport { Item, ItemGroup } from "@/components/vin/item";import Item, { ItemGroup } from "@/components/vin/item.vue";import Item from "$lib/components/vin/item.svelte";
import ItemGroup from "$lib/components/vin/item-group.svelte";The import paths assume the default folders: @/components/vin (React and Vue, with the usual @ → src alias) and $lib/components/vin (SvelteKit). Use your own if you chose another folder in init. How the Vue and Svelte versions pass values and content is in Frameworks.
Plain HTML: the classes come with the style's stylesheet. It needs no JavaScript.
API
From spec/item.json, which every framework version is tested against.
| Prop | Values | Default | In HTML |
|---|---|---|---|
variant | defaultoutlinemuted | default | vin-item--{value} |
mediaAn icon or an Avatar. | ReactNode | — | .vin-item__media |
title | ReactNode | — | .vin-item__title (one line, cut with …) |
description | ReactNode | — | .vin-item__description |
actionsButtons, a badge or a chevron at the end. | ReactNode | — | .vin-item__actions |
hrefMakes the whole row a link. | string | — | <a class="vin-item" href> |
ItemGroupA bordered list of items with lines between them. | children | — | .vin-item-group[role=list] > .vin-item[role=listitem] |
Parts
| React, Vue, Svelte | HTML classes |
|---|---|
<Item><ItemGroup> | .vin-item.vin-item--outline.vin-item--muted.vin-item__media.vin-item__content.vin-item__title.vin-item__description.vin-item__actions.vin-item-group |
Accessibility
- An item group is a list (role="list" and "listitem"), so screen readers say how many items there are.
- A clickable row is one <a> or <button>; don't put other buttons inside a link item.
- Icons and chevrons are hidden from screen readers; the title says what the row is.
Customize
Saved in this browser. Style and accent are in the header.