ReScript Shadcn
Get started
  • Installation
Components
  • Accordion
  • Alert
  • AlertDialog
  • AspectRatio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • ContextMenu
  • DataTable
  • DatePicker
  • Dialog
  • Direction
  • Drawer
  • DropdownMenu
  • Empty
  • Field
  • HoverCard
  • Input
  • InputGroup
  • InputOtp
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • MessageScroller
  • NativeSelect
  • NavigationMenu
  • Pagination
  • Popover
  • Progress
  • RadioGroup
  • Resizable
  • ScrollArea
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • ToggleGroup
  • Tooltip
  • Typography

Item

A versatile component for displaying content with media, title, description, and actions.

Basic Item

A simple item with title and description.

Your profile has been verified.

The Item component is a straightforward flex container that can house nearly any type of content. Use it to display a title, description, and actions. Group it with the Item.Group component to create a list of items.

Installation#

npx shadcn@latest add @rescript-shadcn/Item

Usage#

<Item variant=Outline>
  <Item.Content>
    <Item.Title> {"Title"->React.string} </Item.Title>
    <Item.Description> {"Description"->React.string} </Item.Description>
  </Item.Content>
  <Item.Actions>
    <Button> {"Action"->React.string} </Button>
  </Item.Actions>
</Item>

Item vs Field#

Use Field if you need to display a form input such as a checkbox, input, radio, or select.

If you only need to display content such as a title, description, and actions, use Item.

Variant#

Use the variant prop to change the visual style of the item.

Default Variant

Transparent background with no border.

Outline Variant

Outlined style with a visible border.

Muted Variant

Muted background for secondary content.

Size#

Use the size prop to change the size of the item. Available sizes are default, sm, and xs.

Default Size

The standard size for most use cases.

Small Size

A compact size for dense layouts.

Extra Small Size

The most compact size available.

Examples#

Icon#

Use Item.Media with variant=Icon to display an icon.

Security Alert

New login detected from unknown device.

Avatar#

You can use Item.Media with variant=Avatar to display an avatar.

ER
Evil Rabbit

Last seen 5 months ago

CNLRER
No Team Members

Invite your team to collaborate on this project.

Image#

Use Item.Media with variant=Image to display an image.

Midnight City Lights
Midnight City Lights - Electric Nights

Neon Dreams

3:45

Coffee Shop Conversations
Coffee Shop Conversations - Urban Stories

The Morning Brew

4:05

Digital Rain
Digital Rain - Binary Beats

Cyber Symphony

3:30

Group#

Use Item.Group to group related items together.

s
shadcn

shadcn@vercel.com

m
maxleiter

maxleiter@vercel.com

e
evilrabbit

evilrabbit@vercel.com

Header#

Use Item.Header to add a header above the item content.

v0-1.5-sm
v0-1.5-sm

Everyday tasks and UI generation.

v0-1.5-lg
v0-1.5-lg

Advanced thinking or reasoning.

v0-2.0-mini
v0-2.0-mini

Open Source model for everyone.

Link#

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

Visit our documentation

Learn how to get started with our components.

External resource

Opens in a new tab with security attributes.

<Item render={<a href="/dashboard" />}>
  <Item.Media variant=Icon>
    <HomeIcon />
  </Item.Media>
  <Item.Content>
    <Item.Title>Dashboard</Item.Title>
    <Item.Description>Overview of your account and activity.</Item.Description>
  </Item.Content>
</Item>

Dropdown#

API Reference#

Item#

The main component for displaying content with media, title, description, and actions.

PropTypeDefault
variantDefault | Outline | MutedDefault
size"default" | "sm" | "xs""default"
renderReact.ReactElement

Item.Group#

A container that groups related items together with consistent styling.

<Item.Group>
  <Item />
  <Item />
</Item.Group>

Item.Separator#

A separator between items in a group.

<Item.Group>
  <Item />
  <Item.Separator />
  <Item />
</Item.Group>

Item.Media#

Use Item.Media to display media content such as icons, images, or avatars.

PropTypeDefault
variantDefault | Icon | ImageDefault
<Item.Media variant=Icon>
  <Icon />
</Item.Media>
<Item.Media variant=Image>
  <img src="..." alt="..." />
</Item.Media>

Item.Content#

Wraps the title and description of the item.

<Item.Content>
  <Item.Title> {"Title"->React.string} </Item.Title>
  <Item.Description> {"Description"->React.string} </Item.Description>
</Item.Content>

Item.Title#

Displays the title of the item.

<Item.Title> {"Item Title"->React.string} </Item.Title>

Item.Description#

Displays the description of the item.

<Item.Description> {"Item description"->React.string} </Item.Description>

Item.Actions#

Container for action buttons or other interactive elements.

<Item.Actions>
  <Button> {"Action"->React.string} </Button>
</Item.Actions>

Item.Header#

Displays a header above the item content.

<Item>
  <Item.Header> {"Header"->React.string} </Item.Header>
  <Item.Content>...</Item.Content>
</Item>

Item.Footer#

Displays a footer below the item content.

<Item>
  <Item.Content>...</Item.Content>
  <Item.Footer> {"Footer"->React.string} </Item.Footer>
</Item>
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-4">
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-6">
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-6">
@react.component
let make = () =>
  <div className="flex w-full max-w-md flex-col gap-6">
@react.component
let make = () =>
  <div className="flex w-full max-w-lg flex-col gap-6">
@react.component
let make = () =>
  <div className="flex w-full max-w-lg flex-col gap-6">
type song = {
  title: string,
  artist: string,
type person = {
  username: string,
  avatar: string,
type model = {
  name: string,
  description: string,
@@directive("'use client'")

type person = {