Zaidan

Command Palette

Search for a command to run...

GitHub

Item

A versatile component that you can use to display any content. Use it to display a title, description, and actions. Group it with the ItemGroup component to create a list of items.

Installation

CLI

Manual

Copy and paste the following code into your project.

import { cva, type VariantProps } from "class-variance-authority";
import {
type ComponentProps,
type JSX,
mergeProps,
splitProps,
type ValidComponent,
} from "solid-js";
import { Dynamic } from "solid-js/web";
import { cn } from "~/lib/utils";
import { Separator, type SeparatorProps } from "~/components/ui/separator";
type ItemGroupProps = ComponentProps<"div">;
const ItemGroup = (props: ItemGroupProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
// biome-ignore lint/a11y/useSemanticElements: Using div with role for flexibility as per shadcn design
<div
role="list"
data-slot="item-group"
class={cn("group/item-group z-item-group flex w-full flex-col", local.class)}
{...others}
/>
);
};
type ItemSeparatorProps = SeparatorProps;
const ItemSeparator = (props: ItemSeparatorProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<Separator
data-slot="item-separator"
orientation="horizontal"
class={cn("z-item-separator", local.class)}
{...others}
/>
);
};
const itemVariants = cva(
"group/item z-item flex w-full flex-wrap items-center outline-none transition-colors duration-100 focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors",
{
variants: {
variant: {
default: "z-item-variant-default",
outline: "z-item-variant-outline",
muted: "z-item-variant-muted",
},
size: {
default: "z-item-size-default",
sm: "z-item-size-sm",
xs: "z-item-size-xs",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
);
type ItemProps<T extends ValidComponent = "div"> = {
as?: T;
class?: string | undefined;
children?: JSX.Element;
} & VariantProps<typeof itemVariants> &
Omit<ComponentProps<T>, "as" | "class" | "children">;
const Item = <T extends ValidComponent = "div">(rawProps: ItemProps<T>) => {
const props = mergeProps(
{ as: "div" as T, variant: "default", size: "default" } as const,
rawProps,
);
const [local, others] = splitProps(props as ItemProps, ["as", "class", "variant", "size"]);
return (
<Dynamic
component={local.as}
data-slot="item"
data-variant={local.variant}
data-size={local.size}
class={cn(itemVariants({ variant: local.variant, size: local.size }), local.class)}
{...others}
/>
);
};
const itemMediaVariants = cva(
"z-item-media flex shrink-0 items-center justify-center [&_svg]:pointer-events-none",
{
variants: {
variant: {
default: "z-item-media-variant-default",
icon: "z-item-media-variant-icon",
image: "z-item-media-variant-image",
},
},
defaultVariants: {
variant: "default",
},
},
);
type ItemMediaProps = ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>;
const ItemMedia = (rawProps: ItemMediaProps) => {
const props = mergeProps({ variant: "default" } as const, rawProps);
const [local, others] = splitProps(props, ["class", "variant"]);
return (
<div
data-slot="item-media"
data-variant={local.variant}
class={cn(itemMediaVariants({ variant: local.variant }), local.class)}
{...others}
/>
);
};
type ItemContentProps = ComponentProps<"div">;
const ItemContent = (props: ItemContentProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<div
data-slot="item-content"
class={cn(
"z-item-content flex flex-1 flex-col [&+[data-slot=item-content]]:flex-none",
local.class,
)}
{...others}
/>
);
};
type ItemTitleProps = ComponentProps<"div">;
const ItemTitle = (props: ItemTitleProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<div
data-slot="item-title"
class={cn("z-item-title line-clamp-1 flex w-fit items-center", local.class)}
{...others}
/>
);
};
type ItemDescriptionProps = ComponentProps<"p">;
const ItemDescription = (props: ItemDescriptionProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<p
data-slot="item-description"
class={cn(
"z-item-description line-clamp-2 font-normal [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
local.class,
)}
{...others}
/>
);
};
type ItemActionsProps = ComponentProps<"div">;
const ItemActions = (props: ItemActionsProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<div
data-slot="item-actions"
class={cn("z-item-actions flex items-center", local.class)}
{...others}
/>
);
};
type ItemHeaderProps = ComponentProps<"div">;
const ItemHeader = (props: ItemHeaderProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<div
data-slot="item-header"
class={cn("z-item-header flex basis-full items-center justify-between", local.class)}
{...others}
/>
);
};
type ItemFooterProps = ComponentProps<"div">;
const ItemFooter = (props: ItemFooterProps) => {
const [local, others] = splitProps(props, ["class"]);
return (
<div
data-slot="item-footer"
class={cn("z-item-footer flex basis-full items-center justify-between", local.class)}
{...others}
/>
);
};
export {
Item,
ItemMedia,
ItemContent,
ItemActions,
ItemGroup,
ItemSeparator,
ItemTitle,
ItemDescription,
ItemHeader,
ItemFooter,
itemVariants,
itemMediaVariants,
};

API Reference

Item

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

PropTypeDefault
variant"default" | "outline" | "muted""default"
size"default" | "sm" | "xs""default"
asValidComponent"div"
classstring

You can use the as prop to render a custom element, for example a link:

<Item as="a" href="/dashboard">
<ItemMedia variant="icon">
<Home />
</ItemMedia>
<ItemContent>
<ItemTitle>Dashboard</ItemTitle>
<ItemDescription>Overview of your account and activity.</ItemDescription>
</ItemContent>
</Item>

ItemGroup

Container that groups related items together with consistent styling.

PropTypeDefault
classstring
<ItemGroup>
<Item />
<ItemSeparator />
<Item />
</ItemGroup>

ItemSeparator

Separator that divides items in an item group.

PropTypeDefault
classstring

ItemMedia

Display media content such as icons, images, or avatars.

PropTypeDefault
variant"default" | "icon" | "image""default"
classstring
<ItemMedia variant="icon">
<Icon />
</ItemMedia>
<ItemMedia variant="image">
<img src="..." alt="..." />
</ItemMedia>

ItemContent

Wraps the title and description of the item.

PropTypeDefault
classstring

ItemTitle

Display the title of the item.

PropTypeDefault
classstring

ItemDescription

Display the description of the item.

PropTypeDefault
classstring

ItemActions

Display action buttons or other interactive elements.

PropTypeDefault
classstring

ItemHeader

Display a header in the item.

PropTypeDefault
classstring

ItemFooter

Display a footer in the item.

PropTypeDefault
classstring

Examples

Here are the source code of all the examples from the preview page:

Default

import { Inbox } from "lucide-solid";
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "~/components/ui/item";
import { Button } from "~/components/ui/button";
function DefaultVariantItems() {
return (
<Example title="Default">
<Item>
<ItemContent>
<ItemTitle>Title Only</ItemTitle>
</ItemContent>
</Item>
<Item>
<ItemContent>
<ItemTitle>Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button variant="outline">Action</Button>
</ItemActions>
</Item>
<Item>
<ItemContent>
<ItemTitle>Title + Description</ItemTitle>
<ItemDescription>This is a description that provides additional context.</ItemDescription>
</ItemContent>
</Item>
<Item>
<ItemContent>
<ItemTitle>Title + Description + Button</ItemTitle>
<ItemDescription>
This item includes a title, description, and action button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline">Action</Button>
</ItemActions>
</Item>
<Item>
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title</ItemTitle>
</ItemContent>
</Item>
<Item>
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item>
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description</ItemTitle>
<ItemDescription>This item includes media, title, and description.</ItemDescription>
</ItemContent>
</Item>
<Item>
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description + Button</ItemTitle>
<ItemDescription>
Complete item with all components: media, title, description, and button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item>
<ItemContent>
<ItemTitle>Multiple Actions</ItemTitle>
<ItemDescription>Item with multiple action buttons in the actions area.</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Cancel
</Button>
<Button size="sm">Confirm</Button>
</ItemActions>
</Item>
</Example>
);
}

Outline

import { Inbox } from "lucide-solid";
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "~/components/ui/item";
import { Button } from "~/components/ui/button";
function OutlineVariantItems() {
return (
<Example title="Outline">
<Item variant="outline">
<ItemContent>
<ItemTitle>Title Only</ItemTitle>
</ItemContent>
</Item>
<Item variant="outline">
<ItemContent>
<ItemTitle>Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button variant="outline">Action</Button>
</ItemActions>
</Item>
<Item variant="outline">
<ItemContent>
<ItemTitle>Title + Description</ItemTitle>
<ItemDescription>This is a description that provides additional context.</ItemDescription>
</ItemContent>
</Item>
<Item variant="outline">
<ItemContent>
<ItemTitle>Title + Description + Button</ItemTitle>
<ItemDescription>
This item includes a title, description, and action button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline">Action</Button>
</ItemActions>
</Item>
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title</ItemTitle>
</ItemContent>
</Item>
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description</ItemTitle>
<ItemDescription>This item includes media, title, and description.</ItemDescription>
</ItemContent>
</Item>
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description + Button</ItemTitle>
<ItemDescription>
Complete item with all components: media, title, description, and button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item variant="outline">
<ItemContent>
<ItemTitle>Multiple Actions</ItemTitle>
<ItemDescription>Item with multiple action buttons in the actions area.</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Cancel
</Button>
<Button size="sm">Confirm</Button>
</ItemActions>
</Item>
</Example>
);
}

Muted

import { Inbox } from "lucide-solid";
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "~/components/ui/item";
import { Button } from "~/components/ui/button";
function MutedVariantItems() {
return (
<Example title="Muted">
<Item variant="muted">
<ItemContent>
<ItemTitle>Title Only</ItemTitle>
</ItemContent>
</Item>
<Item variant="muted">
<ItemContent>
<ItemTitle>Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button variant="outline">Action</Button>
</ItemActions>
</Item>
<Item variant="muted">
<ItemContent>
<ItemTitle>Title + Description</ItemTitle>
<ItemDescription>This is a description that provides additional context.</ItemDescription>
</ItemContent>
</Item>
<Item variant="muted">
<ItemContent>
<ItemTitle>Title + Description + Button</ItemTitle>
<ItemDescription>
This item includes a title, description, and action button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline">Action</Button>
</ItemActions>
</Item>
<Item variant="muted">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title</ItemTitle>
</ItemContent>
</Item>
<Item variant="muted">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item variant="muted">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description</ItemTitle>
<ItemDescription>This item includes media, title, and description.</ItemDescription>
</ItemContent>
</Item>
<Item variant="muted">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description + Button</ItemTitle>
<ItemDescription>
Complete item with all components: media, title, description, and button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item variant="muted">
<ItemContent>
<ItemTitle>Multiple Actions</ItemTitle>
<ItemDescription>Item with multiple action buttons in the actions area.</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Cancel
</Button>
<Button size="sm">Confirm</Button>
</ItemActions>
</Item>
</Example>
);
}

Small

import { Inbox } from "lucide-solid";
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "~/components/ui/item";
import { Button } from "~/components/ui/button";
function DefaultVariantItemsSmall() {
return (
<Example title="Small">
<Item size="sm">
<ItemContent>
<ItemTitle>Title Only</ItemTitle>
</ItemContent>
</Item>
<Item size="sm">
<ItemContent>
<ItemTitle>Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Action
</Button>
</ItemActions>
</Item>
<Item size="sm">
<ItemContent>
<ItemTitle>Title + Description</ItemTitle>
<ItemDescription>This is a description that provides additional context.</ItemDescription>
</ItemContent>
</Item>
<Item size="sm">
<ItemContent>
<ItemTitle>Title + Description + Button</ItemTitle>
<ItemDescription>
This item includes a title, description, and action button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Action
</Button>
</ItemActions>
</Item>
<Item size="sm">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title</ItemTitle>
</ItemContent>
</Item>
<Item size="sm">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Button</ItemTitle>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item size="sm">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description</ItemTitle>
<ItemDescription>This item includes media, title, and description.</ItemDescription>
</ItemContent>
</Item>
<Item size="sm">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description + Button</ItemTitle>
<ItemDescription>
Complete item with all components: media, title, description, and button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm">Action</Button>
</ItemActions>
</Item>
<Item size="sm">
<ItemContent>
<ItemTitle>Multiple Actions</ItemTitle>
<ItemDescription>Item with multiple action buttons in the actions area.</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Cancel
</Button>
<Button size="sm">Confirm</Button>
</ItemActions>
</Item>
</Example>
);
}
import { Inbox } from "lucide-solid";
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemGroup,
ItemMedia,
ItemTitle,
} from "~/components/ui/item";
import { Button } from "~/components/ui/button";
function DefaultLinkItems() {
return (
<Example title="As Link">
<ItemGroup>
<Item as="a" href="#">
<ItemContent>
<ItemTitle>Title Only (Link)</ItemTitle>
</ItemContent>
</Item>
<Item as="a" href="#">
<ItemContent>
<ItemTitle>Title + Description (Link)</ItemTitle>
<ItemDescription>Clickable item with title and description.</ItemDescription>
</ItemContent>
</Item>
<Item as="a" href="#">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title (Link)</ItemTitle>
</ItemContent>
</Item>
<Item as="a" href="#">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Media + Title + Description (Link)</ItemTitle>
<ItemDescription>
Complete link item with media, title, and description.
</ItemDescription>
</ItemContent>
</Item>
<Item as="a" href="#">
<ItemContent>
<ItemTitle>With Actions (Link)</ItemTitle>
<ItemDescription>Link item that also has action buttons.</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Share
</Button>
</ItemActions>
</Item>
</ItemGroup>
</Example>
);
}

ItemGroup

import {
Item,
ItemContent,
ItemDescription,
ItemGroup,
ItemTitle,
} from "~/components/ui/item";
function DefaultItemGroup() {
return (
<Example title="ItemGroup">
<ItemGroup>
<Item>
<ItemContent>
<ItemTitle>Item 1</ItemTitle>
<ItemDescription>First item in the group.</ItemDescription>
</ItemContent>
</Item>
<Item>
<ItemContent>
<ItemTitle>Item 2</ItemTitle>
<ItemDescription>Second item in the group.</ItemDescription>
</ItemContent>
</Item>
<Item>
<ItemContent>
<ItemTitle>Item 3</ItemTitle>
<ItemDescription>Third item in the group.</ItemDescription>
</ItemContent>
</Item>
</ItemGroup>
</Example>
);
}

ItemSeparator

import { Inbox } from "lucide-solid";
import {
Item,
ItemContent,
ItemDescription,
ItemGroup,
ItemMedia,
ItemSeparator,
ItemTitle,
} from "~/components/ui/item";
function ItemSeparatorExample() {
return (
<Example title="ItemSeparator">
<ItemGroup>
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Inbox</ItemTitle>
<ItemDescription>View all incoming messages.</ItemDescription>
</ItemContent>
</Item>
<ItemSeparator />
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Sent</ItemTitle>
<ItemDescription>View all sent messages.</ItemDescription>
</ItemContent>
</Item>
<ItemSeparator />
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Drafts</ItemTitle>
<ItemDescription>View all draft messages.</ItemDescription>
</ItemContent>
</Item>
<ItemSeparator />
<Item variant="outline">
<ItemMedia variant="icon">
<Inbox />
</ItemMedia>
<ItemContent>
<ItemTitle>Archive</ItemTitle>
<ItemDescription>View archived messages.</ItemDescription>
</ItemContent>
</Item>
</ItemGroup>
</Example>
);
}

ItemHeader

import {
Item,
ItemContent,
ItemDescription,
ItemHeader,
ItemTitle,
} from "~/components/ui/item";
function ItemHeaderExamples() {
return (
<Example title="ItemHeader">
<Item>
<ItemHeader>
<span class="font-medium text-sm">Design System</span>
</ItemHeader>
<ItemContent>
<ItemTitle>Component Library</ItemTitle>
<ItemDescription>
A comprehensive collection of reusable UI components for building consistent interfaces.
</ItemDescription>
</ItemContent>
</Item>
<Item variant="outline">
<ItemHeader>
<span class="font-medium text-sm">Marketing</span>
</ItemHeader>
<ItemContent>
<ItemTitle>Campaign Analytics</ItemTitle>
<ItemDescription>
Track performance metrics and engagement rates across all marketing channels.
</ItemDescription>
</ItemContent>
</Item>
<Item variant="muted">
<ItemHeader>
<span class="font-medium text-sm">Engineering</span>
</ItemHeader>
<ItemContent>
<ItemTitle>API Documentation</ItemTitle>
<ItemDescription>
Complete reference guide for all available endpoints and authentication methods.
</ItemDescription>
</ItemContent>
</Item>
</Example>
);
}

ItemFooter

import {
Item,
ItemContent,
ItemDescription,
ItemFooter,
ItemTitle,
} from "~/components/ui/item";
function ItemFooterExamples() {
return (
<Example title="ItemFooter">
<Item>
<ItemContent>
<ItemTitle>Quarterly Report Q4 2024</ItemTitle>
<ItemDescription>
Financial overview including revenue, expenses, and growth metrics for the fourth
quarter.
</ItemDescription>
</ItemContent>
<ItemFooter>
<span class="text-muted-foreground text-sm">Last updated 2 hours ago</span>
</ItemFooter>
</Item>
<Item variant="outline">
<ItemContent>
<ItemTitle>User Research Findings</ItemTitle>
<ItemDescription>
Insights from interviews and surveys conducted with 50+ users across different
demographics.
</ItemDescription>
</ItemContent>
<ItemFooter>
<span class="text-muted-foreground text-sm">Created by Sarah Chen</span>
</ItemFooter>
</Item>
<Item variant="muted">
<ItemContent>
<ItemTitle>Product Roadmap</ItemTitle>
<ItemDescription>
Planned features and improvements scheduled for the next three months.
</ItemDescription>
</ItemContent>
<ItemFooter>
<span class="text-muted-foreground text-sm">12 comments</span>
</ItemFooter>
</Item>
</Example>
);
}

ItemHeader + ItemFooter

import {
Item,
ItemContent,
ItemDescription,
ItemFooter,
ItemHeader,
ItemTitle,
} from "~/components/ui/item";
function ItemHeaderAndFooterExamples() {
return (
<Example title="ItemHeader + ItemFooter">
<Item>
<ItemHeader>
<span class="font-medium text-sm">Team Project</span>
</ItemHeader>
<ItemContent>
<ItemTitle>Website Redesign</ItemTitle>
<ItemDescription>
Complete overhaul of the company website with modern design principles and improved user
experience.
</ItemDescription>
</ItemContent>
<ItemFooter>
<span class="text-muted-foreground text-sm">Updated 5 minutes ago</span>
</ItemFooter>
</Item>
<Item variant="outline">
<ItemHeader>
<span class="font-medium text-sm">Client Work</span>
</ItemHeader>
<ItemContent>
<ItemTitle>Mobile App Development</ItemTitle>
<ItemDescription>
Building a cross-platform mobile application for iOS and Android with React Native.
</ItemDescription>
</ItemContent>
<ItemFooter>
<span class="text-muted-foreground text-sm">Status: In Progress</span>
</ItemFooter>
</Item>
<Item variant="muted">
<ItemHeader>
<span class="font-medium text-sm">Documentation</span>
</ItemHeader>
<ItemContent>
<ItemTitle>API Integration Guide</ItemTitle>
<ItemDescription>
Step-by-step instructions for integrating third-party APIs with authentication and error
handling.
</ItemDescription>
</ItemContent>
<ItemFooter>
<span class="text-muted-foreground text-sm">Category: Technical - 3 attachments</span>
</ItemFooter>
</Item>
</Example>
);
}

ItemMedia with Image

import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "~/components/ui/item";
import { Button } from "~/components/ui/button";
function DefaultVariantItemsWithImage() {
return (
<Example title="Default - ItemMedia image">
<Item>
<ItemMedia variant="image">
<img
src="https://avatar.vercel.sh/Project"
alt="Project"
width={40}
height={40}
class="object-cover grayscale"
/>
</ItemMedia>
<ItemContent>
<ItemTitle>Project Dashboard</ItemTitle>
<ItemDescription>Overview of project settings and configuration.</ItemDescription>
</ItemContent>
</Item>
<Item>
<ItemMedia variant="image">
<img
src="https://avatar.vercel.sh/Document"
alt="Document"
width={40}
height={40}
class="object-cover grayscale"
/>
</ItemMedia>
<ItemContent>
<ItemTitle>Document</ItemTitle>
<ItemDescription>A document with metadata displayed.</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
View
</Button>
</ItemActions>
</Item>
<Item>
<ItemMedia variant="image">
<img
src="https://avatar.vercel.sh/File"
alt="File"
width={40}
height={40}
class="object-cover grayscale"
/>
</ItemMedia>
<ItemContent>
<ItemTitle>File Attachment</ItemTitle>
<ItemDescription>
Complete file with image, title, description, and action button.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm">Download</Button>
</ItemActions>
</Item>
</Example>
);
}