Name
stringclasses
8 values
Description
stringclasses
8 values
Components
stringclasses
7 values
Code
stringclasses
8 values
avatar
An image element with a fallback for representing the user
Avatar, Avatar Image, Avatar Fallback, Text
<Avatar> <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn"/> <AvatarFallback>CN</AvatarFallback> </Avatar>
button - primary
A button for executing primary actions like registering, buying, submitting content, saving, sending, sharing etc. When creating a primary button, the following should be considered: Primary style, High contrast compared to the background (very different color or shade), Position in layout, On or near the Axis of Interaction so users notice them first, by reflex.
Button, Text
<Button>Primary</Button>
button - secondary
A button for executing secondary actions which are counterproductive to the user, like canceling, skipping, resetting, declining an offer etc. They remove or stop the creation of new things. Those are secondary actions, or things we don鈥檛 want the user to do, but we provide the option for the sake of usability.
Button, Text
<Button variant="secondary">Secondary</Button>
card
Displays a card with header, content, and footer
Card, Card Header, Card Title, Text, Card Description, Text, Card Content, Form, Frame, Frame, Label, Text, Input, Frame, Label, Text, Select, Select Trigger, Select Value, Select Content, Select Item, Text, Select Item, Text, Card Footer, Button, Text, Button, Text
<Card className="w-[350px]"> <CardHeader> <CardTitle>Create project</CardTitle> <CardDescription> Deploy your new project in one-click. </CardDescription> </CardHeader> <CardContent> <form> <div className="grid w-full items-center gap-4"> <div className="flex flex-col gap-1.5"> <Label htmlFor="name">Name</Label> <Input id="name" placeholder="Name of your project"/> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="framework">Framework</Label> <Select> <SelectTrigger id="framework"> <SelectValue placeholder="Select"/> </SelectTrigger> <SelectContent position="popper"> <SelectItem value="next">Next.js</SelectItem> <SelectItem value="sveltekit">SvelteKit</SelectItem> <SelectItem value="astro">Astro</SelectItem> <SelectItem value="nuxt">Nuxt.js</SelectItem> </SelectContent> </Select> </div> </div> </form> </CardContent> <CardFooter className="flex justify-between"> <Button variant="outline">Cancel</Button> <Button>Deploy</Button> </CardFooter> </Card>
input - textfield
Displays a form input field where the user can write text
Frame, Label, Text, Input
<div className="flex flex-col gap-1.5"> <Label htmlFor="text">Label</Label> <Input type="text" id="text" placeholder="Text"/> </div>
menubar
A visually persistent menu common in desktop applications that provides quick access to a consistent set of commands.
Menubar, Menubar Menu, Menubar Trigger, Text, Menubar Content, Menubar Item, Text, Menubar Shortcut, Text, Menubar Item, Text, Menubar Shortcut, Text, Menubar Item, Text, Menubar Separator, Menubar Sub, Menubar Sub Trigger, Text, Menubar Sub Content, Menubar Item, Text, Menubar Item, Text, Menubar Item, Text, Menubar Separator, Menubar Item, Text, Menubar Shortcut, Text, Menubar Menu, Menubar Trigger, Text, Menubar Content, Menubar Item, Text, Menubar Shortcut, Text, Menubar Item, Text, Menubar Shortcut, Text, Menubar Separator, Menubar Item, Text, Menubar Item, Text, Menubar Item, Text, Menubar Menu, Menubar Trigger, Text, Menubar Content, Menubar Checkbox Item, Text, Menubar Checkbox Item, Text, Menubar Separator, Menubar Item, Text, Menubar Shortcut, Text, Menubar Item, Text, Menubar Shortcut, Text, Menubar Separator, Menubar Item, Text, Menubar Separator, Menubar Item, Text, Menubar Menu, Menubar Trigger, Text, Menubar Content, Menubar Radio Group, Menubar Radio Item, Text, Menubar Radio Item, Text, Menubar Radio Item, Text, Menubar Separator, Menubar Item, Text, Menubar Separator, Menubar Item, Text
<Menubar> <MenubarMenu> <MenubarTrigger>File</MenubarTrigger> <MenubarContent> <MenubarItem> New Tab <MenubarShortcut>鈱楾</MenubarShortcut> </MenubarItem> <MenubarItem> New Window <MenubarShortcut>鈱楴</MenubarShortcut> </MenubarItem> <MenubarItem disabled>New Incognito Window</MenubarItem> <MenubarSeparator /> <MenubarSub> <MenubarSubTrigger>Share</MenubarSubTrigger> <MenubarSubContent> <MenubarItem>Email link</MenubarItem> <MenubarItem>Messages</MenubarItem> <MenubarItem>Notes</MenubarItem> </MenubarSubContent> </MenubarSub> <MenubarSeparator /> <MenubarItem> Print... <MenubarShortcut>鈱楶</MenubarShortcut> </MenubarItem> </MenubarContent> </MenubarMenu> <MenubarMenu> <MenubarTrigger>Edit</MenubarTrigger> <MenubarContent> <MenubarItem> Undo <MenubarShortcut>鈱榋</MenubarShortcut> </MenubarItem> <MenubarItem> Redo <MenubarShortcut>鈬р寴Z</MenubarShortcut> </MenubarItem> <MenubarSeparator /> <MenubarSub> <MenubarSubTrigger>Find</MenubarSubTrigger> <MenubarSubContent> <MenubarItem>Search the web</MenubarItem> <MenubarSeparator /> <MenubarItem>Find...</MenubarItem> <MenubarItem>Find Next</MenubarItem> <MenubarItem>Find Previous</MenubarItem> </MenubarSubContent> </MenubarSub> <MenubarSeparator /> <MenubarItem>Cut</MenubarItem> <MenubarItem>Copy</MenubarItem> <MenubarItem>Paste</MenubarItem> </MenubarContent> </MenubarMenu> <MenubarMenu> <MenubarTrigger>View</MenubarTrigger> <MenubarContent> <MenubarCheckboxItem> Always Show Bookmarks Bar </MenubarCheckboxItem> <MenubarCheckboxItem checked> Always Show Full URLs </MenubarCheckboxItem> <MenubarSeparator /> <MenubarItem inset> Reload <MenubarShortcut>鈱楻</MenubarShortcut> </MenubarItem> <MenubarItem disabled inset> Force Reload <MenubarShortcut>鈬р寴R</MenubarShortcut> </MenubarItem> <MenubarSeparator /> <MenubarItem inset>Toggle Fullscreen</MenubarItem> <MenubarSeparator /> <MenubarItem inset>Hide Sidebar</MenubarItem> </MenubarContent> </MenubarMenu> <MenubarMenu> <MenubarTrigger>Profiles</MenubarTrigger> <MenubarContent> <MenubarRadioGroup value="benoit"> <MenubarRadioItem value="andy">Andy</MenubarRadioItem> <MenubarRadioItem value="benoit">Benoit</MenubarRadioItem> <MenubarRadioItem value="Luis">Luis</MenubarRadioItem> </MenubarRadioGroup> <MenubarSeparator /> <MenubarItem inset>Edit...</MenubarItem> <MenubarSeparator /> <MenubarItem inset>Add Profile...</MenubarItem> </MenubarContent> </MenubarMenu> </Menubar>
navigation menu
A collection of links for navigating websites.
Navigation Menu List, Navigation Menu Item, Navigation Menu Trigger, Navigation Menu Content
<NavigationMenu> <NavigationMenuList> <NavigationMenuItem> <NavigationMenuTrigger>Getting started</NavigationMenuTrigger> <NavigationMenuContent> <ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]"> <li className="row-span-3"> <NavigationMenuLink asChild> <Link className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md" href="https://ui.shadcn.com/" target="_blank"> <div className="mb-2 mt-4 text-lg font-medium"> shadcn/ui </div> <p className="text-sm leading-tight text-muted-foreground"> Beautifully designed components built with Radix UI and Tailwind CSS. </p> </Link> </NavigationMenuLink> </li> <NavigationMenuContentListItem href="https://ui.shadcn.com/docs" target="_blank" title="Introduction"> Re-usable components built using Radix UI and Tailwind CSS. </NavigationMenuContentListItem> <NavigationMenuContentListItem href="https://ui.shadcn.com/docs/installation" target="_blank" title="Installation"> How to install dependencies and structure your app. </NavigationMenuContentListItem> <NavigationMenuContentListItem href="https://ui.shadcn.com/docs/primitives/typography" target="_blank" title="Typography"> Styles for headings, paragraphs, lists...etc </NavigationMenuContentListItem> </ul> </NavigationMenuContent> </NavigationMenuItem> <NavigationMenuItem> <NavigationMenuTrigger>Components</NavigationMenuTrigger> <NavigationMenuContent> <ul className="grid w-[400px] gap-3 p-4 md:w-[500px] md:grid-cols-2 lg:w-[600px] "> {components.map(component => (<NavigationMenuContentListItem key={component.title} title={component.title} href={component.href} target="_blank"> {component.description} </NavigationMenuContentListItem>))} </ul> </NavigationMenuContent> </NavigationMenuItem> <NavigationMenuItem> <Link href="https://ui.shadcn.com/docs" legacyBehavior passHref> <NavigationMenuLink target="_blank" className={navigationMenuTriggerStyle()}> Documentation </NavigationMenuLink> </Link> </NavigationMenuItem> </NavigationMenuList> </NavigationMenu>
tabs
A set of layered sections of content鈥攌nown as tab panels鈥攖hat are displayed one at a time.
Tabs, Tabs List, Tabs Trigger, Tabs Content
<Tabs defaultValue="account" className="w-[400px]"> <TabsList className="grid w-full grid-cols-2"> <TabsTrigger value="account">Account</TabsTrigger> <TabsTrigger value="password">Password</TabsTrigger> </TabsList> <TabsContent value="account"> <Card> <CardHeader> <CardTitle>Account</CardTitle> <CardDescription> Make changes to your account here. Click save when you are done. </CardDescription> </CardHeader> <CardContent className="flex flex-col gap-4"> <div className="flex flex-col gap-1.5"> <Label htmlFor="name">Name</Label> <Input id="name"/> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="username">Username</Label> <Input id="username"/> </div> </CardContent> <CardFooter> <Button>Save changes</Button> </CardFooter> </Card> </TabsContent> <TabsContent value="password"> <Card> <CardHeader> <CardTitle>Password</CardTitle> <CardDescription> Change your password here. After saving, you will be logged out. </CardDescription> </CardHeader> <CardContent className="flex flex-col gap-4"> <div className="flex flex-col gap-1.5"> <Label htmlFor="current">Current password</Label> <Input id="current" type="password"/> </div> <div className="flex flex-col gap-1.5"> <Label htmlFor="new">New password</Label> <Input id="new" type="password"/> </div> </CardContent> <CardFooter> <Button>Save password</Button> </CardFooter> </Card> </TabsContent> </Tabs>