All typography tokens and utilities.
Display Large
Display Medium
Display Small
Headline Large
Headline Medium
Headline Small
Title Large
Title Medium
Title Small
Body Large Bold
Body Large Regular
Body Medium Bold
Body Medium Regular
Body Small Bold
Body Small Regular
Label Large
Label Medium Prominent
Label Medium
Label Small
Label Tiny Prominent
Label Tiny
Buttons allow users to take actions and make choices with a single tap. They communicate actions that users can take and are typically placed in dialogs, forms, cards, and toolbars.
import { Button } from "@/components/ui/button"<Button variant="filled" color="primary">
Click me
</Button>
<Button variant="outline" color="neutral" size="lg">
<Plus className="size-4" />
Add Item
</Button>
<Button variant="tonal" loading>
Saving...
</Button>ButtonThe main button componentbuttonVariantsTailwind variants function for custom styling<Button variant="filled" color="primary">
<Plus className="size-4" />
Label
</Button><Button variant="filled" color="primary" loading>
Label
</Button>Primary
Secondary
Neutral
Primary
Secondary
Primary
Neutral
Text - Primary
Plain
A circular button component designed to contain only an icon. Supports multiple visual variants and sizes for different use cases and contexts.
import { IconButton } from "@/components/ui/icon-button"<IconButton variant="standard">
<Settings />
</IconButton>
<IconButton variant="filled" size="small">
<Plus />
</IconButton>
<IconButton variant="outlined" disabled>
<Heart />
</IconButton>variant"standard" | "filled" | "tonal-neutral" | "outlined""standard"The visual style variant of the icon button.
size"baseline" | "small""baseline"The size of the icon button. Baseline is 40px, small is 32px.
disabledbooleanfalseWhen true, the button is disabled and cannot be interacted with.
asChildbooleanfalseWhen true, the button will render its child as the root element using Radix Slot.
childrenReact.ReactNodeThe icon element to display inside the button. Should be an SVG icon component.
classNamestringAdditional CSS classes to apply to the button.
onClick(event: MouseEvent) => voidCallback function called when the button is clicked.
<IconButton variant="standard">
<Settings />
</IconButton><IconButton variant="filled">
<Settings />
</IconButton>| Variant | Enabled | Disabled |
|---|---|---|
| Standard | ||
| Filled | ||
| Tonal Neutral | ||
| Outlined |
Segmented buttons help people select from two to five options. Use for simple choices or multi-selection scenarios.
import { SegmentedButtons } from "@/components/ui/segmented-buttons"<SegmentedButtons
options={[
{ value: "v1", label: "Value 1" },
{ value: "v2", label: "Value 2" }
]}
value={value}
onChange={setValue}
/><SegmentedButtons
options={[
{ value: "option1", label: "Option 1" },
{ value: "option2", label: "Option 2" },
{ value: "option3", label: "Option 3" },
]}
value={singleSelect}
onChange={setSingleSelect}
/><SegmentedButtons
multiSelect
options={[
{ value: "option1", label: "Option 1" },
{ value: "option2", label: "Option 2" },
{ value: "option3", label: "Option 3" },
]}
value={multiSelect}
onChange={setMultiSelect}
/>Density 0 (Default)
Density -1 (Compact)
View Mode Selector
Media Type Filter
Notification Settings (Multi-select)
Account Type (Multiline)
| State | Example |
|---|---|
| Default (unselected) | |
| Selected | |
| Multi-select | |
| Compact (Density -1) |
TextField is a form input component that allows users to enter and edit text. It features a floating label that animates when focused, support for icons, prefix/suffix text, validation states, and a clear button. The component is built with accessibility in mind and supports both controlled and uncontrolled modes.
import { TextField } from "@/components/ui/text-field"// Basic usage
<TextField label="Name" placeholder="Enter your name" />
// With icon and supporting text
<TextField
label="Search"
startIcon={<Search className="size-5" />}
supportingText="Search for products, categories, etc."
/>
// With prefix/suffix
<TextField label="Price" prefix="$" suffix="USD" />
// Error state with validation
<TextField
label="Email"
error
errorText="Please enter a valid email address"
/>
// With clear button
<TextField
label="Search"
showClearButton
onClear={() => console.log('Cleared!')}
/>TextFieldThe main text field input componenttextFieldVariantsTailwind variants function for custom stylingSupporting text
Enter your query
<TextField
label="Search"
placeholder="Search..."
startIcon={<Search className="size-5" />}
supportingText="Enter your query"
/>Please enter a valid email
<TextField
label="Email"
defaultValue="invalid-email"
error
errorText="Please enter a valid email"
/>Supporting text
Supporting text
Inline error text
Supporting text
Supporting text
Supporting text
Supporting text
Supporting text
Supporting text
Supporting text
Supporting text
Username is available
Please enter a valid email address
Password must be at least 8 characters
Toggle switches allow users to turn a single option on or off. They are the preferred way to adjust settings on mobile devices. The switch component supports icons to reinforce the on/off state visually and can be used in both controlled and uncontrolled modes.
import { Switch } from "@/components/ui/switch"const [isEnabled, setIsEnabled] = useState(false)
<Switch
checked={isEnabled}
onCheckedChange={setIsEnabled}
showIcon
/>checkedbooleanundefinedThe controlled checked state of the switch.
defaultCheckedbooleanfalseThe default checked state when initially rendered (uncontrolled).
onCheckedChange(checked: boolean) => voidundefinedCallback fired when the checked state changes.
showIconbooleanfalseWhether to display check/X icons inside the thumb.
disabledbooleanfalseWhen true, prevents user interaction with the switch.
requiredbooleanfalseWhen true, indicates the switch must be checked for form submission.
namestringundefinedThe name of the switch for form submission.
valuestring"on"The value submitted with form data when checked.
classNamestringundefinedAdditional CSS classes to apply to the switch root.
<Switch defaultChecked /><Switch defaultChecked showIcon /><Switch defaultChecked disabled /><Switch disabled />On State
Off State
On State
Off State
Email Notifications
Receive updates via email
Push Notifications
Get instant alerts
Public Profile
Anyone can see your profile
Show Activity Status
Let others see when you're online
Tags are versatile labeling components commonly used for categorization, filtering, status indication, and user-generated content like selected items in multi-select inputs.
import { Tag } from "@/components/ui/tag"<Tag variant="filled" color="primary">Label</Tag>
<Tag variant="tonal" color="success" closable onClose={() => {}}>
Removable
</Tag>
<Tag
color="secondary"
leadingIcon={<Zap className="size-full" />}
>
With Icon
</Tag>variant"filled" | "tonal""filled"The visual style variant of the tag. Filled has solid background, tonal has lighter background.
color"neutral" | "success" | "error" | "warning" | "primary" | "secondary""neutral"The semantic color of the tag for different use cases.
size"tiny" | "baseline""baseline"The size of the tag. Tiny is smaller for compact layouts.
leadingIconReact.ReactNodeundefinedOptional icon element displayed before the tag label.
closablebooleanfalseWhen true, displays a close button to remove the tag.
onClose(e: React.MouseEvent<HTMLButtonElement>) => voidundefinedCallback function triggered when the close button is clicked.
childrenReact.ReactNode-The content/label of the tag.
classNamestringundefinedAdditional CSS classes to apply to the tag.
<Tag
variant="filled"
color="primary"
closable
onClose={() => alert("close")}
>
Label
</Tag><Tag
variant="tonal"
color="secondary"
leadingIcon={<Zap className="size-full" />}
>
Label
</Tag>Tiny Size
Baseline Size
With Close Button
With Leading Icon
Baseline Size
With Close Button
Chips are compact interactive elements used for filtering content, entering information, or triggering actions. They support three types: filter chips for selecting options, input chips for user-entered data, and assistive chips for smart suggestions.
import { Chip } from "@/components/ui/chip"<Chip type="filter" variant="outlined" selected>
Active Filter
</Chip>
<Chip type="input" onClose={() => handleRemove()}>
john@example.com
</Chip>
<Chip type="assistive" leadingIcon={<Calendar />}>
Add to calendar
</Chip>type"filter" | "assistive" | "input""filter"The type of chip that determines its behavior and appearance.
variant"outlined" | "tonal""outlined"The visual style variant of the chip.
color"neutral" | "green" | "red" | "blue" | "yellow" | "purple""neutral"The color scheme for tonal variant chips.
selectedbooleanfalseWhether the chip is in a selected state.
leadingIconReactNodeundefinedIcon displayed before the chip label.
trailingIconReactNodeundefinedIcon displayed after the chip label (hidden when onClose is provided).
avatarReactNodeundefinedAvatar element displayed at the start of the chip.
onClose() => voidundefinedCallback when the close button is clicked. Shows close button when provided.
showCheckmarkbooleantrueWhether to show checkmark icon when filter chip is selected (outlined only).
disabledbooleanfalseWhether the chip is disabled.
classNamestringundefinedAdditional CSS classes to apply to the chip.
<Chip
type="filter"
variant="outlined"
leadingIcon={<Filter className="h-4 w-4" />}
selected
>
Filter
</Chip><Chip
type="input"
variant="outlined"
leadingIcon={<User className="h-4 w-4" />}
onClose={() => {}}
>
John Doe
</Chip>Unselected (Inherit)
Selected
Color Variants (Unselected)
Color Variants (Selected)
Assistive chips represent smart or automated actions that can span multiple apps, such as opening a calendar event from a message.
Input chips represent discrete pieces of information entered by a user, such as contacts or filter options within a search field.
Unselected
Selected
The Checkbox component allows users to select one or multiple options from a set. It supports checked, unchecked, and indeterminate states, making it ideal for binary choices, multi-selection lists, and hierarchical selection patterns like "select all" functionality.
import { Checkbox } from "@/components/ui/checkbox"<Checkbox label="I agree to terms" />
// With helper text
<Checkbox
label="Subscribe to newsletter"
helperText="Receive updates about new features"
/>
// Indeterminate state (partial selection)
<Checkbox checked="indeterminate" label="Select all" />
// With error state
<Checkbox error label="Required field" />checkedboolean | 'indeterminate'undefinedThe controlled checked state of the checkbox. Can be true, false, or 'indeterminate' for partial selection.
defaultCheckedbooleanfalseThe default checked state when initially rendered. Use when you do not need to control its checked state.
onCheckedChange(checked: boolean | 'indeterminate') => voidundefinedEvent handler called when the checked state changes.
errorbooleanfalseShows error state styling with red border and background.
labelstringundefinedLabel text displayed next to the checkbox.
helperTextstringundefinedHelper or description text displayed below the label.
linkReact.ReactNodeundefinedLink element to display after the label, useful for terms and conditions.
labelPosition'left' | 'right''right'Position of the label relative to the checkbox.
disabledbooleanfalseWhen true, prevents the user from interacting with the checkbox.
requiredbooleanfalseWhen true, indicates that the user must check the checkbox before the form can be submitted.
namestringundefinedThe name of the checkbox. Submitted with its owning form as part of a name/value pair.
valuestring'on'The value given as data when submitted with a name.
classNamestringundefinedAdditional CSS classes to apply to the checkbox.
<Checkbox
defaultChecked
label="Adjacent label"
helperText="Helper text"
/><Checkbox checked="indeterminate" label="Select all" /><Checkbox
error
label="Accept terms"
helperText="This field is required"
/><Checkbox
label="I agree to the"
link={<a href="#" className="text-secondary hover:underline">Terms of Service</a>}
/>Checked
Indeterminate
Unchecked
Tooltips display informative text when users hover over, focus on, or tap an element. They are used to provide additional context or explain the function of an interface element without cluttering the UI with permanent text.
import {
Tooltip,
TooltipTrigger,
TooltipContent,
TooltipProvider
} from "@/components/ui/tooltip"<TooltipProvider>
<Tooltip>
<TooltipTrigger>Hover me</TooltipTrigger>
<TooltipContent>Tooltip content</TooltipContent>
</Tooltip>
</TooltipProvider>TooltipRoot component for a single tooltip.TooltipTriggerElement that triggers the tooltip.TooltipContentContainer for the tooltip text.TooltipProviderContext provider, wrap your app or section with this.childrenReact.ReactNodeThe content to display inside the tooltip.
side"top" | "bottom" | "left" | "right""bottom"The preferred side of the trigger to render the tooltip.
align"start" | "center" | "end""center"The alignment of the tooltip relative to the trigger.
sideOffsetnumber8The distance in pixels from the trigger.
multilinebooleanfalseWhether the tooltip should wrap text across multiple lines.
classNamestringAdditional CSS classes to apply to the tooltip content.
openbooleanControlled open state of the tooltip.
defaultOpenbooleanfalseThe default open state when uncontrolled.
onOpenChange(open: boolean) => voidCallback when the open state changes.
delayDurationnumber0The delay in milliseconds before the tooltip opens.
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" color="neutral">
Top
</Button>
</TooltipTrigger>
<TooltipContent side="top">Tooltip on top</TooltipContent>
</Tooltip><Tooltip>
<TooltipTrigger asChild>
<Button variant="outline" color="neutral">
Hover for details
</Button>
</TooltipTrigger>
<TooltipContent multiline>
This is a longer tooltip with multiple lines of text.
</TooltipContent>
</Tooltip>Tooltips are especially useful for icon-only buttons where the action might not be immediately clear.
Use the multiline prop when you need to display longer descriptions that should wrap across multiple lines.
Popovers display rich content in a portal, triggered by a button or other interactive element. Unlike tooltips which are for simple text hints, popovers can contain complex content like forms, lists, and interactive elements. They remain open until explicitly dismissed.
import {
Popover,
PopoverTrigger,
PopoverContent,
PopoverHeader,
PopoverTitle,
PopoverDescription,
PopoverBody,
PopoverFooter,
PopoverClose,
PopoverAnchor,
} from "@/components/ui/popover"<Popover>
<PopoverTrigger asChild>
<Button variant="outline">Open</Button>
</PopoverTrigger>
<PopoverContent>
<PopoverHeader>
<PopoverTitle>Title</PopoverTitle>
</PopoverHeader>
<PopoverBody>
<p>Popover content goes here.</p>
</PopoverBody>
<PopoverFooter>
<PopoverClose asChild>
<Button size="sm">Close</Button>
</PopoverClose>
</PopoverFooter>
</PopoverContent>
</Popover>PopoverRoot component that manages the popover state.PopoverTriggerElement that triggers the popover on click.PopoverContentContainer for the popover content with styling and animations.PopoverHeaderOptional header section with bottom border.PopoverTitleTitle element for the popover header.PopoverDescriptionDescription text element.PopoverBodyMain content area with padding.PopoverFooterFooter section for action buttons with top border.PopoverCloseButton that closes the popover when clicked.PopoverAnchorAlternative anchor for positioning.childrenReact.ReactNodeThe content to display inside the popover.
side"top" | "bottom" | "left" | "right""bottom"The preferred side of the trigger to render the popover.
align"start" | "center" | "end""center"The alignment of the popover relative to the trigger.
sideOffsetnumber8The distance in pixels from the trigger.
size"sm" | "md" | "lg" | "auto""md"The width of the popover content.
showArrowbooleantrueWhether to show the arrow pointing to the trigger.
showCloseButtonbooleanfalseWhether to show a close button in the top-right corner.
classNamestringAdditional CSS classes to apply to the popover content.
openbooleanControlled open state of the popover.
defaultOpenbooleanfalseThe default open state when uncontrolled.
onOpenChange(open: boolean) => voidCallback when the open state changes.
modalbooleanfalseWhether the popover should be modal (trap focus and block interaction outside).
PopoverHeaderReact.HTMLAttributes<HTMLDivElement>Container for the header section with border-bottom styling.
PopoverTitleReact.HTMLAttributes<HTMLHeadingElement>Title element with text-title-md styling.
PopoverDescriptionReact.HTMLAttributes<HTMLParagraphElement>Description text with text-body-sm-regular styling.
PopoverBodyReact.HTMLAttributes<HTMLDivElement>Main content area with padding.
PopoverFooterReact.HTMLAttributes<HTMLDivElement>Footer section for actions with border-top styling.
PopoverCloseReact.ComponentProps<typeof PopoverPrimitive.Close>Button that closes the popover when clicked.
PopoverAnchorReact.ComponentProps<typeof PopoverPrimitive.Anchor>Alternative anchor element for positioning the popover.
<Popover>
<PopoverTrigger asChild>
<Button variant="outline">Simple</Button>
</PopoverTrigger>
<PopoverContent>
<PopoverBody>
<p>Basic popover content.</p>
</PopoverBody>
</PopoverContent>
</Popover><Popover>
<PopoverTrigger asChild>
<Button variant="outline">With Close</Button>
</PopoverTrigger>
<PopoverContent showCloseButton>
<PopoverHeader>
<PopoverTitle>Notification</PopoverTitle>
</PopoverHeader>
<PopoverBody>
<p>Click the X to close.</p>
</PopoverBody>
</PopoverContent>
</Popover>The popover comes in four width sizes: small (224px), medium (288px), large (384px), and auto (content-based).
Control where the popover appears relative to the trigger using the side prop.
Popovers are ideal for contextual actions, user profiles, settings panels, and share menus.
Alerts provide contextual feedback messages for user actions or system events. They support four semantic types (informative, warning, error, success), optional action buttons, dismissible behavior, and multiple layout orientations.
import { Alert } from "@/components/ui/alert"<Alert
type="informative"
title="Info title"
description="This is an alert for contextual feedback."
/>
<Alert
type="success"
title="Done!"
description="Your changes were saved successfully."
actionLabel="Undo"
onAction={() => {}}
dismissible
onDismiss={() => {}}
/>Four semantic types for different contexts: informative, warning, error, and success.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Alerts can include an action button for user interaction.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Use a chevron to indicate navigable alerts.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Alerts that can be dismissed by the user.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Simple alerts without any action elements.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Vertical layout optimized for small screens with action button below content.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Smaller alerts for denser UIs.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Info title
This is an alert meant to give context to the user inside the app.
Alerts with only description text.
This is an alert meant to give context to the user inside the app.
This is an alert meant to give context to the user inside the app.
This is an alert meant to give context to the user inside the app.
This is an alert meant to give context to the user inside the app.
Alerts with custom icons for specific use cases.
Security Update
Your account security has been enhanced with two-factor authentication.
Performance Boost
Your app is now running 50% faster with the latest optimizations.
Common use cases for alerts in applications.
Maintenance scheduled
The system will be unavailable on Sunday from 2:00 AM to 4:00 AM for scheduled maintenance.
Storage almost full
You've used 90% of your storage quota. Consider upgrading your plan or deleting unused files.
Payment failed
We couldn't process your payment. Please update your payment method to continue using the service.
Account verified
Your email has been verified successfully. You now have full access to all features.
Bottom sheets slide up from the bottom of the screen to display additional content or actions.
import {
BottomSheet,
BottomSheetTrigger,
BottomSheetContent,
BottomSheetHeader,
BottomSheetTitle,
BottomSheetDescription,
BottomSheetBody,
BottomSheetFooter
} from "@/components/ui/bottom-sheet"<BottomSheet>
<BottomSheetTrigger>Open</BottomSheetTrigger>
<BottomSheetContent>
<BottomSheetHeader>
<BottomSheetTitle>Title</BottomSheetTitle>
<BottomSheetDescription>Description</BottomSheetDescription>
</BottomSheetHeader>
<BottomSheetBody>Content</BottomSheetBody>
<BottomSheetFooter>Footer</BottomSheetFooter>
</BottomSheetContent>
</BottomSheet>BottomSheetRoot component that manages the open state.BottomSheetTriggerButton that opens the bottom sheet.BottomSheetContentContainer for the bottom sheet content.BottomSheetHeaderHeader section, typically for title and description.BottomSheetTitleAccessible title for the bottom sheet.BottomSheetDescriptionAccessible description for the bottom sheet.BottomSheetBodyMain content area.BottomSheetFooterFooter section, typically for actions.BottomSheetListItemHelper component for list items.<BottomSheet>
<BottomSheetTrigger asChild>
<Button variant="outline">Open Standard</Button>
</BottomSheetTrigger>
<BottomSheetContent variant="standard">
<BottomSheetHeader>
<BottomSheetTitle>Standard Sheet</BottomSheetTitle>
<BottomSheetDescription>
Interacts with background.
</BottomSheetDescription>
</BottomSheetHeader>
<BottomSheetBody>
Content goes here.
</BottomSheetBody>
</BottomSheetContent>
</BottomSheet><BottomSheet>
<BottomSheetTrigger asChild>
<Button variant="filled">Open Modal</Button>
</BottomSheetTrigger>
<BottomSheetContent variant="modal">
<BottomSheetHeader>
<BottomSheetTitle>Modal Sheet</BottomSheetTitle>
<BottomSheetDescription>
Blocks background.
</BottomSheetDescription>
</BottomSheetHeader>
<BottomSheetBody>
Content goes here.
</BottomSheetBody>
<BottomSheetFooter>
<BottomSheetClose asChild>
<Button variant="filled" className="w-full">
Close
</Button>
</BottomSheetClose>
</BottomSheetFooter>
</BottomSheetContent>
</BottomSheet>Dialogs inform users about a task and can contain critical information, require decisions, or involve multiple tasks.
import {
Dialog,
DialogTrigger,
DialogContent,
DialogHeader,
DialogFooter,
DialogTitle,
DialogDescription,
DialogClose,
DialogIcon
} from "@/components/ui/dialog"<Dialog>
<DialogTrigger>Open</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Title</DialogTitle>
<DialogDescription>Description</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose>Close</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>DialogRoot component.DialogTriggerTrigger button.DialogContentContainer for dialog content.DialogHeaderHeader section.DialogFooterFooter section for actions.DialogTitleAccessible title.DialogDescriptionAccessible description.DialogCloseButton to close the dialog.DialogIconWrapper for icon in header.<Dialog>
<DialogTrigger asChild>
<Button variant="outline">Open Dialog</Button>
</DialogTrigger>
<DialogContent size="sm">
<DialogHeader>
<DialogTitle>Dialog Title</DialogTitle>
<DialogDescription>
This is a small dialog with basic content.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose asChild>
<Button variant="text">Cancel</Button>
</DialogClose>
<DialogClose asChild>
<Button variant="filled">Accept</Button>
</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog><Dialog>
<DialogTrigger asChild>
<Button variant="outline" color="secondary">
Success Dialog
</Button>
</DialogTrigger>
<DialogContent size="sm">
<DialogHeader className="items-center text-center">
<DialogIcon variant="success">
<Check className="h-6 w-6" />
</DialogIcon>
<DialogTitle>Success!</DialogTitle>
<DialogDescription>
Your changes have been saved successfully.
</DialogDescription>
</DialogHeader>
<DialogFooter className="sm:justify-center">
<DialogClose asChild>
<Button variant="filled">Continue</Button>
</DialogClose>
</DialogFooter>
</DialogContent>
</Dialog>| Size | Max Width | Use Case | Example |
|---|---|---|---|
| sm | 384px | Simple confirmations, alerts | |
| md | 448px | Forms, detailed info | |
| lg | 512px | Complex content, settings |
A component that adapts its behavior based on the device screen size: acting as a Bottom Sheet on mobile and a Dialog on desktop.
import {
ResponsiveDialog,
ResponsiveDialogTrigger,
ResponsiveDialogContent,
ResponsiveDialogHeader,
ResponsiveDialogFooter,
ResponsiveDialogTitle,
ResponsiveDialogDescription,
ResponsiveDialogBody,
ResponsiveDialogClose
} from "@/components/ui/responsive-dialog"<ResponsiveDialog>
<ResponsiveDialogTrigger>Open</ResponsiveDialogTrigger>
<ResponsiveDialogContent>
<ResponsiveDialogHeader>
<ResponsiveDialogTitle>Title</ResponsiveDialogTitle>
<ResponsiveDialogDescription>Description</ResponsiveDialogDescription>
</ResponsiveDialogHeader>
<ResponsiveDialogBody>Content</ResponsiveDialogBody>
<ResponsiveDialogFooter>
<ResponsiveDialogClose>Close</ResponsiveDialogClose>
</ResponsiveDialogFooter>
</ResponsiveDialogContent>
</ResponsiveDialog>ResponsiveDialogRoot component that handles switching between Dialog and BottomSheet.ResponsiveDialogTriggerTrigger button.ResponsiveDialogContentContent container.ResponsiveDialogHeaderHeader section.ResponsiveDialogFooterFooter section.ResponsiveDialogTitleAccessible title.ResponsiveDialogDescriptionAccessible description.ResponsiveDialogBodyMain content body.ResponsiveDialogCloseClose button.Toasts provide brief messages about app processes at the bottom of the screen.
import { Toaster } from "@/components/ui/toaster"
import { useToast } from "@/hooks/use-toast"// In your layout or root component
<Toaster />
// In your component
const { toast } = useToast()
toast({
title: "Scheduled: Catch up",
description: "Friday, February 10, 2023 at 5:57 PM",
})ToasterComponent to render toasts, place at app root.useToastHook to trigger toasts.ToastActionAction button within a toast.<Button
variant="outline"
onClick={() => {
toast({
description: "Single-line snackbar",
})
}}
>
Show Toast
</Button><Button
variant="outline"
onClick={() => {
toast({
description: "Snackbar with action",
action: <ToastAction altText="Undo">Undo</ToastAction>,
})
}}
>
Show Toast
</Button>ResourceList displays a collection of items in a vertical list format. It supports three rendering patterns: by items array, with custom renderItem function, or by composition with children. Each item can have leading elements (icons, avatars, thumbnails), content (headline and body text), and trailing elements (prices, actions, chevrons).
import {
ResourceList,
ResourceListItem,
ResourceListLeading,
ResourceListContent,
ResourceListTrailing,
ResourceListAvatar,
ResourceListThumbnail,
ResourceListPrice,
ResourceListAction,
ResourceListChevron,
} from "@/components/ui/resource-list"// Pattern 1: Using children (composition)
<ResourceList borderStyle="outlined">
<ResourceListItem onClick={() => {}}>
<ResourceListLeading>
<ResourceListAvatar>
<ReceiptIcon />
</ResourceListAvatar>
</ResourceListLeading>
<ResourceListContent headline="Item Title" body="Description" />
<ResourceListTrailing label="$100.00" />
</ResourceListItem>
</ResourceList>
// Pattern 2: Using items array
<ResourceList
items={items}
borderStyle="underline"
hasContainer
/>
// Pattern 3: Using renderItem for custom rendering
<ResourceList
items={items}
renderItem={(item, index) => (
<ResourceListItem key={item.id}>
<ResourceListContent headline={item.headline} />
</ResourceListItem>
)}
/>ResourceListMain container componentResourceListItemIndividual list itemResourceListLeadingContainer for leading elementsResourceListContentMain text content (headline + body)ResourceListTrailingContainer for trailing elementsResourceListAvatarAvatar element for leading slotResourceListThumbnailImage thumbnail for leading slotResourceListPricePrice display with optional discountResourceListActionAction button for trailing slotResourceListChevronNavigation chevron icon <ResourceList>
<ResourceListItem onClick={() => console.log('clicked')}>
<ResourceListLeading>
<ResourceListAvatar>
<ReceiptIcon className="w-5 h-5" />
</ResourceListAvatar>
</ResourceListLeading>
<ResourceListContent headline="Sandwich, Coffee &..." body="Multiple payments" />
<ResourceListTrailing label="$5,000.00" body="2 links" />
</ResourceListItem>
<ResourceListItem>
<ResourceListLeading>
<ResourceListAvatar variant="accent" fallback="G" />
</ResourceListLeading>
<ResourceListContent headline="Gustavo Colorado" body="BBVA --6480" />
</ResourceListItem>
<ResourceListItem>
<ResourceListLeading>
<ResourceListAvatar fallback="M" />
</ResourceListLeading>
<ResourceListContent headline="Beneficiario" body="María Casanova" />
<ResourceListTrailing>
<button className="p-1 hover:bg-surface-container-highest rounded transition-colors">
<CopyIcon className="w-5 h-5 text-on-surface-variant" />
</button>
</ResourceListTrailing>
</ResourceListItem>
</ResourceList>

<ResourceList>
<ResourceListItem>
<ResourceListLeading>
<ResourceListThumbnail src="/colorful-gift-box.png" alt="Product" />
</ResourceListLeading>
<ResourceListContent headline="Refresco en lata" body="Disponibles: 200" />
<ResourceListTrailing label="$35.00" />
</ResourceListItem>
<ResourceListItem>
<ResourceListLeading>
<ResourceListThumbnail src="/sneakers-shoes-product.jpg" alt="Sneakers" />
</ResourceListLeading>
<ResourceListContent headline="Running Shoes" body="Disponibles: 50" />
<ResourceListPrice price="$60.00" originalPrice="$120.00" discount="-50%" />
</ResourceListItem>
</ResourceList>

<ResourceList>
<ResourceListItem onClick={() => toggleSelection(1)}>
<ResourceListLeading>
<Checkbox className={"m-4"} checked={selectedItems.includes(1)} />
<ResourceListThumbnail src="/colorful-gift-box.png" alt="Agua" size="sm" />
</ResourceListLeading>
<ResourceListContent headline="Agua" body="Ilimitado · 0 variantes" />
<ResourceListTrailing label="$10.00">
<ResourceListChevron />
</ResourceListTrailing>
</ResourceListItem>
<ResourceListItem onClick={() => toggleSelection(2)}>
<ResourceListLeading>
<Checkbox className={"m-4"} checked={selectedItems.includes(2)} />
<ResourceListThumbnail src="/colorful-gift-box.png" alt="Refresco" size="sm" />
</ResourceListLeading>
<ResourceListContent headline="Refresco" body="Ilimitado · 0 variantes" />
<ResourceListTrailing label="$15.00">
<ResourceListChevron />
</ResourceListTrailing>
</ResourceListItem>
</ResourceList>

<ResourceList>
<ResourceListItem>
<ResourceListLeading>
<ResourceListThumbnail src="/placeholder-logo.png" alt="Clip" size="sm" />
</ResourceListLeading>
<ResourceListContent headline="Clip Plus 2" body="34543" />
<ResourceListTrailing>
<ResourceListAction onClick={() => console.log('connect')}>
Conectar
</ResourceListAction>
</ResourceListTrailing>
</ResourceListItem>
</ResourceList>Showcasing various item configurations in a single list.



Avatars represent users, entities, or content. They can display images, text initials, or icons, with optional badges for status indicators or notifications.
import { Avatar } from "@/components/ui/avatar"<Avatar>John Doe</Avatar>
<Avatar src="/avatar.jpg" alt="User avatar" />
<Avatar badge={5}>MT</Avatar>
<Avatar size="lg" variant="accent">
<User className="size-6" />
</Avatar>AvatarThe main avatar componentavatarVariantsTailwind variants function for custom styling<Avatar badge={9}>MT</Avatar>
<Avatar src="/avatar.jpg" alt="User" badge />With Initials
With Icon
With Image



Default

Accent
With Badge Dot
With Badge Number
Icon with Badge
Image with Badge



Custom Badge Colors

John Doe
Online
<div className="flex items-center gap-3">
<Avatar size="lg" src="/user.jpg" alt="John" />
<div>
<p className="font-semibold">John Doe</p>
<p className="text-sm text-muted">Online</p>
</div>
</div><Avatar badge={12} variant="accent">
JD
</Avatar><div className="flex -space-x-2">
<Avatar>AB</Avatar>
<Avatar>CD</Avatar>
<Avatar>EF</Avatar>
</div>