Back to Shark UI

Item

docs/components/item

latest10.6 KB
Original Source

Sections

Components

Utilities

Forms

Hooks

Item

Copy Markdown

A versatile component for displaying content.

PreviewCode

Basic Item

A simple item with title and description.

Your profile has been verified.

Installation#

CLIManual

pnpmbunnpmyarn

pnpm dlx shadcn@latest add @shark/item

Anatomy#

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

Usage#

import {
  Item,
  ItemActions,
  ItemContent,
  ItemDescription,
  ItemMedia,
  ItemTitle,
} from "@/components/ui/item";
<Item>
  <ItemMedia />
  <ItemContent>
    <ItemTitle />
    <ItemDescription />
  </ItemContent>
  <ItemActions />
</Item>

Variant#

Default#

PreviewCode

Default Variant

Transparent background with no border.

Outline#

PreviewCode

Outline Variant

Outlined style with a visible border.

Muted#

PreviewCode

Muted Variant

Muted background for secondary content.

Custom spacing#

The [--space:--spacing("value")] on ItemContent controls the internal spacing.

Default spacing is --spacing(3).

PreviewCode

Compact spacing

Uses [--space:--spacing(2)] for tighter padding and gap.

Responsive spacing

Wider from md up with md:[--space:--spacing(5)].

You can use breakpoint utilities to change the internal spacing at different screen sizes.

md:[--space:--spacing(6)] lg:[--space:--spacing(8)]

Examples#

Icon#

PreviewCode

Security Alert

New login detected from unknown device.

Review

Avatar#

PreviewCode

PV

Pasquale Vitiello

Last seen 5 months ago

View

Image#

PreviewCode

Midnight City Lights

Electric Nights · Neon Dreams · 3:45

Coffee Shop Conversations

Urban Stories · The Morning Brew · 4:05

Digital Rain

Binary Beats · Cyber Symphony · 3:30

Group#

Use ItemGroup to group related items together.

PreviewCode

v

vinihvc

[email protected]

s

segunadebayo

[email protected]

p

pasqualevitiello

[email protected]

Header#

Use ItemHeader to add a header above the item content.

PreviewCode

v0-1.5-sm

Everyday tasks and UI generation.

v0-1.5-lg

Advanced thinking or reasoning.

v0-2.0-mini

Open Source model for everyone.

Use the asChild prop to render the item as a link. The hover and focus states will be applied to the anchor element.

PreviewCode

[

Visit our documentation

Learn how to get started with our components.

](/docs)[

External resource

Opens in a new tab with security attributes.

](https://vini.one/twitter)

Use Item inside a menu or dropdown to display rich content in menu items.

PreviewCode

Open

API Reference#

Item#

Layout for list items with media, title, description, and actions. Use [--space:--spacing("value")] via className to control padding and gap. Supports asChild.

PropTypeDefault
variant`"default""outline"
asChildbooleanfalse
classNamestring-
AttributeDefault
--space--spacing(3)

ItemGroup#

Groups related items with consistent spacing. Uses a fixed gap; adjust layout with className if needed. Has role="list" for accessibility.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemSeparator#

Horizontal divider between items in a group.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemMedia#

Avatar, icon, or image for the item. Supports icon and image variants.

PropTypeDefault
variant`"default""icon"
classNamestring-
asChildbooleanfalse

ItemContent#

Wraps the item title and description text.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemTitle#

Primary title or heading for the item.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemDescription#

Secondary description or subtitle for the item.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemActions#

Holds action buttons or controls.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemHeader#

Full-width header row above the item content.

PropTypeDefault
classNamestring-
asChildbooleanfalse

ItemFooter#

Full-width footer row below the item content.

PropTypeDefault
classNamestring-
asChildbooleanfalse

[

Previous page

Input ](/docs/components/input)[

Next page

Kbd ](/docs/components/kbd)

On This Page

InstallationAnatomyUsageVariantDefaultOutlineMutedCustom spacingExamplesIconAvatarImageGroupHeaderLinkDropdownAPI ReferenceItemItemGroupItemSeparatorItemMediaItemContentItemTitleItemDescriptionItemActionsItemHeaderItemFooter