Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

Item for Astro

Astro content rows for lists, linked summaries, and grouped details.

Item Title

Page content is ready for a final check.

Outline Variant

This item has an outline variant

Muted Variant

This item has a muted variant

Installation

bunx --bun shadcn@latest add @gnostic/item

Usage

import { Item, ItemContent, ItemDescription, ItemMedia, ItemTitle } from "@/components/ui/item"
---
import Heart from "@lucide/astro/icons/heart"
---

<Item>
  <ItemMedia>
    <Heart />
  </ItemMedia>
  <ItemContent>
    <ItemTitle>Title</ItemTitle>
    <ItemDescription>Description</ItemDescription>
  </ItemContent>
</Item>

Composition

Arrange the parts as shown for an Item:

ItemGroup
└── Item
    ├── ItemHeader
    ├── ItemMedia
    ├── ItemContent
    │   ├── ItemTitle
    │   └── ItemDescription
    ├── ItemActions
    └── ItemFooter

Notes

  • Use ItemContent to group the title and description instead of hand-rolled wrappers.
  • Passing href turns the root Item into an anchor, which works well for list rows and navigational cards.
  • Use variants for emphasis changes before adding custom surface styles.

API Reference

Read the installed source for the complete prop types.

When to use Item

Use Item for a compact unit with media, title, description, and actions. Set href when the whole item is a link. Choose its size and surface variant to fit the density of the list.

Keyboard and behavior

Avoid nested links or buttons inside an Item rendered as an anchor. Use a non-link item when the row has several independent actions. Keep reading order logical when media and actions move on small screens.

Theme and layout

Default, outline, and muted variants share page tokens. Test long titles and descriptions without relying on fixed row heights. An item does not fetch data or select itself.