Dokumentation (english)
Components: Shadcn UI

Item

Understand the design system and contribute to it

Component preview

The live preview for UI components is handled by components/atoms/codedocs/ComponentPreview.tsx. Use it directly inside MDX whenever you want a playground-style embed. Provide componentProps to set default values and propOptions to surface toggle-able props next to the preview.

Preview
Docs website
Published

Next.js, MDX, Tailwind CSS

Command palette
Draft

React, Radix UI

Need another list item?

Prop reference

Auto-generated from the component source

Item

  • className
  • variant = "default"
  • size = "default"
  • asChild = false

React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & { asChild?: boolean; }

ItemActions

  • className

React.ComponentProps<"div">

ItemContent

  • className

React.ComponentProps<"div">

ItemDescription

  • className

React.ComponentProps<"p">

ItemFooter

  • className

React.ComponentProps<"div">

ItemGroup

  • className

React.ComponentProps<"div">

ItemHeader

  • className

React.ComponentProps<"div">

ItemMedia

  • className
  • variant = "default"

React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>

ItemSeparator

  • className

React.ComponentProps<typeof Separator>

ItemTitle

  • className

React.ComponentProps<"div">

Code
// owner: Sona
"use client";

import { ArrowUpRight } from "lucide-react";

import {
  Item,
  ItemActions,
  ItemContent,
  ItemDescription,
  ItemFooter,
  ItemGroup,
  ItemHeader,
  ItemMedia,
  ItemSeparator,
  ItemTitle,
} from "@/components/ui/item";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";

const items = [
  {
    title: "Docs website",
    description: "Next.js, MDX, Tailwind CSS",
    status: "Published",
  },
  {
    title: "Command palette",
    description: "React, Radix UI",
    status: "Draft",
  },
];

export default function ItemExample() {
  return (
    <ItemGroup>
      {items.map((item) => (
        <Item key={item.title} variant="outline">
          <ItemMedia variant="icon" className="text-muted-foreground">
            <ArrowUpRight className="size-4" />
          </ItemMedia>
          <ItemContent>
            <ItemHeader>
              <ItemTitle>{item.title}</ItemTitle>
              <Badge
                variant={item.status === "Published" ? "default" : "secondary"}
              >
                {item.status}
              </Badge>
            </ItemHeader>
            <ItemDescription>{item.description}</ItemDescription>
          </ItemContent>
          <ItemActions>
            <Button variant="ghost" size="sm">
              Open
            </Button>
          </ItemActions>
        </Item>
      ))}
      <ItemSeparator />
      <Item variant="muted">
        <ItemContent>
          <ItemFooter>
            <span className="text-sm text-muted-foreground">
              Need another list item?
            </span>
            <Button size="sm">Add item</Button>
          </ItemFooter>
        </ItemContent>
      </Item>
    </ItemGroup>
  );
}

On this page


Command Palette

Search for a command to run...

Schnellzugriffe
STRG + KSuche
STRG + DNachtmodus / Tagmodus
STRG + LSprache ändern

Software-Details
Kompiliert vor 15 Tagen
Release: v4.0.0-production
Buildnummer: master@6fbd7b5
Historie: 13 Items