---
status: "published"
label: "Shadcn UI"
title: "Use the Shadcn UI components in the Next.js Supabase SaaS kit"
description: "Learn how to use the Shadcn UI components in the Next.js Supabase SaaS kit for building custom UIs"
order: -1
---
Makerkit uses [Shadcn UI](https://ui.shadcn.com) for its UI components. You can use the components in your Next.js Supabase SaaS kit.
In this page, we showcase the components available in Makerkit and how to use them in your Next.js Supabase SaaS kit. Most of these examples were taken from the Shadcn UI docs, however, we've updated the paths to reflect the path in the kit.
The components are located at `packages/ui/src/shadcn`. They are exported as named exports, so you can import them directly from the package `@kit/ui`.
## Accordion
The `Accordion` component is a collapsible container that allows users to expand and collapse content. It is a great way to organize and present information in a clear and concise manner.
{% component path="shadcn/accordion" /%}
```tsx
import { Accordion, AccordionItem } from '@kit/ui/accordion';
function MyAccordion() {
return (
Content for Section 1
Content for Section 2
);
}
```
## Alert
The `Alert` component is a visually distinctive and informative message that alerts users of important information or actions.
### Default Alert
The default alert component is a versatile and customizable way to display messages to users. It can be used for success, warning, error, or informational purposes.
{% component path="shadcn/alert/default-alert" /%}
```tsx
import { InfoIcon } from 'lucide-react';
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
export default function DefaultAlertDemo() {
return (
This is a default alertThis is the description of the alert.
);
}
```
### Info Alert
For more informative alerts, you can use the `info` variant.
{% component path="shadcn/alert/info-alert" /%}
```tsx
import { InfoIcon } from 'lucide-react';
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
export default function InfoAlertDemo() {
return (
This is an info alert
This is the description of the alert.
);
}
```
### Success Alert
For success alerts, use the `success` variant.
{% component path="shadcn/alert/success-alert" /%}
```tsx
import { CheckCircleIcon } from 'lucide-react';
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
export default function SuccessAlertDemo() {
return (
This is a success alert
This is the description of the alert.
);
}
```
### Warning Alert
For warning alerts, use the `warning` variant.
{% component path="shadcn/alert/warning-alert" /%}
```tsx
import { TriangleAlertIcon } from 'lucide-react';
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
export default function WarningAlertDemo() {
return (
This is a warning alertThis is the description of the alert.
);
}
```
### Destructive Alert
For error alerts, use the `error` variant.
{% component path="shadcn/alert/destructive-alert" /%}
```tsx
import { XCircleIcon } from 'lucide-react';
import { Alert, AlertDescription, AlertTitle } from '@kit/ui/alert';
export default function ErrorAlertDemo() {
return (
This is an error alert
This is the description of the alert.
);
}
```
## AlertDialog
The `AlertDialog` component is a modal dialog that displays an alert message and provides an action to the user. It is a versatile and customizable way to display messages to users.
{% component path="shadcn/alert-dialog" /%}
```tsx
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from '@kit/ui/alert-dialog';
import { Button } from '@kit/ui/button';
import WrapperComponent from '~/components/content/wrapper';
export default function AlertDialogDemo() {
return (
Are you absolutely sure?
This action cannot be undone. This will permanently delete your
account and remove your data from our servers.
CancelContinue
);
}
```
For more information on the `AlertDialog` component, please refer to the [AlertDialog](https://ui.shadcn.com/docs/components/alert-dialog) documentation.
## Badge
The `Badge` component is a small label or tag that is displayed inline with other content. It is used to highlight important information or to indicate the status of an item.
{% component path="shadcn/badge" /%}
```tsx
import { Badge } from '@kit/ui/badge';
function BadgeDemo() {
return (
<>
ProfileSettingsMessages
InfoSuccessWarningError
>
);
}
```
For more information on the `Badge` component, please refer to the [Badge](https://ui.shadcn.com/docs/components/badge) documentation.
## Breadcrumbs
The Breadcrumbs component is a navigational component that displays a list of links that represent the user's current location within a website or application. It is commonly used in multi-level navigation menus to provide a clear path for users to navigate back to previous pages.
{% component path="shadcn/breadcrumbs" /%}
```tsx
import {
Breadcrumb,
BreadcrumbEllipsis,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from '@kit/ui/breadcrumb';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from '@kit/ui/dropdown-menu';
export default function BreadcrumbDemo() {
return (
HomeToggle menuDocumentationThemesGitHubComponentsBreadcrumb
);
}
```
For more information on the `Breadcrumbs` component, please refer to the [Breadcrumbs](https://ui.shadcn.com/docs/components/breadcrumbs) documentation.
## Button
The `Button` component is a basic button component that can be used to trigger an action or event.
```tsx
import { Button } from '@kit/ui/button';
export default function ButtonDemo() {
return (
);
}
```
{% component path="shadcn/button" /%}
### Button Variants
The `Button` component comes with several variants that you can use to style your buttons. You can use the `variant` prop to change the appearance of the button.
{% component path="shadcn/button-variants" /%}
```tsx
import { Button } from '@kit/ui/button';
export default function ButtonDemo() {
return (
);
}
```
For more information on the `Button` component, please refer to the [Button](https://ui.shadcn.com/docs/components/button) documentation.
## Calendar
The `Calendar` component is a calendar component that allows users to select a date.
{% component path="shadcn/calendar" /%}
```tsx
import { Calendar } from '@kit/ui/calendar';
export default function CalendarDemo() {
return (
);
}
```
For more information on the `Calendar` component, please refer to the [Calendar](https://ui.shadcn.com/docs/components/calendar) documentation.
## Card
The `Card` component is a flexible and customizable card component that can be used to display content in a visually appealing way.
{% component path="shadcn/card" /%}
```tsx
import * as React from 'react';
import { Button } from '@kit/ui/button';
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from '@kit/ui/card';
import { Input } from '@kit/ui/input';
import { Label } from '@kit/ui/label';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@kit/ui/select';
export default function CardWithForm() {
return (
Create projectDeploy your new project in one-click.
);
}
```
For more information on the `Card` component, please refer to the [Card](https://ui.shadcn.com/docs/components/card) documentation.
## Chart
Charts are built using Recharts, a powerful charting library that provides a wide range of customization options.
{% component path="shadcn/chart" /%}
For more information, please refer to the ShadcnUI documentation for the [Chart component](https://ui.shadcn.com/docs/components/chart).
## Checkbox
The `Checkbox` component is a simple and customizable checkbox component that allows users to select one or more options.
{% component path="shadcn/checkbox" /%}
```tsx
import { Checkbox } from '@kit/ui/checkbox';
export default function CheckboxDemo() {
return (
);
}
```
For more information on the `Checkbox` component, please refer to the [Checkbox](https://ui.shadcn.com/docs/components/checkbox) documentation.
## Command
The `Command` component is a powerful and customizable command palette component that allows users to access a wide range of commands and actions.
{% component path="shadcn/command" lazy="true" /%}
```tsx
import {
Calculator,
Calendar,
CreditCard,
Settings,
Smile,
User,
} from 'lucide-react';
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
CommandSeparator,
CommandShortcut,
} from '@kit/ui/command';
import WrapperComponent from '~/components/content/wrapper';
export default function CommandDemo() {
return (
<>
No results found.CalendarSearch EmojiCalculatorProfile⌘PBilling⌘BSettings⌘S
>
);
}
```
For more information on the `Command` component, please refer to the [Command](https://ui.shadcn.com/docs/components/command) documentation.
## Collapsible
The `Collapsible` component is a powerful and customizable collapsible component that allows users to expand and collapse content.
{% component path="shadcn/collapsible" /%}
```tsx
'use client';
import * as React from 'react';
import { ChevronsUpDown } from 'lucide-react';
import { Button } from '@kit/ui/button';
import {
Collapsible,
CollapsibleContent,
CollapsibleTrigger,
} from '@kit/ui/collapsible';
export default function CollapsibleDemo() {
const [isOpen, setIsOpen] = React.useState(false);
return (
<>
@peduarte starred 3 repositories
@base-ui/primitives
@base-ui/colors
@stitches/react
>
);
}
```
For more information on how to use the Collapsible component, refer to the [Collapsible documentation](https://ui.shadcn.com/docs/components/collapsible).
## Data Table
The Data Table component uses TanStack React Table to display a table of data. It provides a flexible and customizable way to display data in a tabular format.
{% component path="shadcn/data-table" /%}
```tsx
'use client';
import * as React from 'react';
import {
ColumnDef,
ColumnFiltersState,
SortingState,
VisibilityState,
flexRender,
getCoreRowModel,
getFilteredRowModel,
getPaginationRowModel,
getSortedRowModel,
useReactTable,
} from '@tanstack/react-table';
import { ArrowUpDown, ChevronDown, MoreHorizontal } from 'lucide-react';
import { Button } from '@kit/ui/button';
import { Checkbox } from '@kit/ui/checkbox';
import {
DropdownMenu,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '@kit/ui/dropdown-menu';
import { Input } from '@kit/ui/input';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow,
} from '@kit/ui/table';
const data: Payment[] = [
{
id: 'm5gr84i9',
amount: 316,
status: 'success',
email: 'ken99@yahoo.com',
},
{
id: '3u1reuv4',
amount: 242,
status: 'success',
email: 'Abe45@gmail.com',
},
{
id: 'derv1ws0',
amount: 837,
status: 'processing',
email: 'Monserrat44@gmail.com',
},
{
id: '5kma53ae',
amount: 874,
status: 'success',
email: 'Silas22@gmail.com',
},
{
id: 'bhqecj4p',
amount: 721,
status: 'failed',
email: 'carmella@hotmail.com',
},
];
export type Payment = {
id: string;
amount: number;
status: 'pending' | 'processing' | 'success' | 'failed';
email: string;
};
export const columns: ColumnDef[] = [
{
id: 'select',
header: ({ table }) => (
table.toggleAllPageRowsSelected(!!value)}
aria-label="Select all"
/>
),
cell: ({ row }) => (
row.toggleSelected(!!value)}
aria-label="Select row"
/>
),
enableSorting: false,
enableHiding: false,
},
{
accessorKey: 'status',
header: 'Status',
cell: ({ row }) => (
>
);
}
```
For more information on how to use the Data Table component, refer to the [Data Table documentation](/docs/next-supabase-turbo/components/data-table).
For more information about Tanstack Table, refer to the [Tanstack Table documentation](https://tanstack.com/table/v8/docs/api/core/table).
## Dropdown Menu
The Dropdown Menu component is a customizable dropdown menu that can be used to display a list of options when a user interacts with a dropdown button. It is a versatile component that can be used in various contexts, such as navigation menus, dropdown menus, and more.
{% component path="shadcn/dropdown-menu" /%}
```tsx
import { Button } from '@kit/ui/button';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuPortal,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
} from '@kit/ui/dropdown-menu';
export default function DropdownMenuDemo() {
return (
<>
My Account
Profile
⇧⌘P
Billing
⌘B
Settings
⌘S
Keyboard shortcuts
⌘KTeamInvite usersEmailMessageMore...
New Team
⌘+TGitHubSupportAPI
Log out
⇧⌘Q
>
);
}
```
For more information on how to use the Dropdown Menu component, refer to the [Dropdown Menu documentation](https://ui.shadcn.com/docs/components/dropdown-menu).
## Form
The `Form` component wraps `react-hook-form` and provides a simple and customizable form component.
{% component path="shadcn/form" /%}
```tsx
'use client';
import { useForm } from 'react-hook-form';
import { Button } from '@kit/ui/button';
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@kit/ui/form';
import { Input } from '@kit/ui/input';
import { Textarea } from '@kit/ui/textarea';
export default function FormDemo() {
const form = useForm({
defaultValues: {
name: 'John Doe',
email: 'john@doe.com',
message: 'Hello, world!',
},
});
return (
<>
>
);
}
```
For more information on how to use the Form component, refer to the [Form documentation](https://ui.shadcn.com/docs/components/form).
## Heading
The `Heading` component is a reusable component for rendering headings with different levels.
{% component path="shadcn/heading" /%}
```tsx
import { Heading } from '@kit/ui/heading';
function HeadingDemo() {
return (
<>
Heading 1Heading 2Heading 3Heading 4Heading 5Heading 6
>
);
}
```
For more information on how to use the Heading component, refer to the [Heading documentation](https://ui.shadcn.com/docs/components/heading).
## Input
The `Input` component is a customizable input field component that allows users to enter text.
{% component path="shadcn/input" /%}
```tsx
import { Input } from '@kit/ui/input';
function InputDemo() {
return (
);
}
```
For more information on how to use the Input component, refer to the [Input documentation](https://ui.shadcn.com/docs/components/input).
## Input OTP
The `InputOTP` component is a customizable input field component that allows users to enter one-time passwords.
{% component path="shadcn/input-otp" /%}
```tsx
import {
InputOTP,
InputOTPGroup,
InputOTPSeparator,
InputOTPSlot,
} from '@kit/ui/input-otp';
export default function InputOTPDemo() {
return (
);
}
```
For more information on how to use the Input OTP component, refer to the [Input OTP documentation](https://ui.shadcn.com/docs/components/input-otp).
## Label
The `Label` component is a reusable component for rendering labels with different styles.
{% component path="shadcn/label" /%}
```tsx
import { Checkbox } from '@kit/ui/checkbox';
import { Label } from '@kit/ui/label';
import WrapperComponent from '~/components/content/wrapper';
export default function LabelDemo() {
return (
);
}
```
For more information on how to use the Label component, refer to the [Label documentation](https://ui.shadcn.com/docs/components/label).
## Navigation Menu
The navigation menu component is a wrapper around the [Base UI Navigation Menu](https://base-ui.com/react/components/navigation-menu) component.
{% component path="shadcn/navigation-menu.tsx" /%}
```tsx
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
} from '@kit/ui/navigation-menu';
export default function NavigationMenuDemo() {
return (
Item OneLink
);
}
```
For more information on how to use the Navigation Menu component, refer to the [Navigation Menu documentation](https://ui.shadcn.com/docs/components/navigation-menu).
## Popover
THe Popover component helps you create a floating element that floats around a reference element.
{% component path="shadcn/popover.tsx" /%}
```tsx
import { Button } from '@kit/ui/button';
import { Input } from '@kit/ui/input';
import { Label } from '@kit/ui/label';
import { Popover, PopoverContent, PopoverTrigger } from '@kit/ui/popover';
export default function PopoverDemo() {
return (
Dimensions
Set the dimensions for the layer.
);
}
```
For more information on how to use the Popover component, refer to the [Popover documentation](https://ui.shadcn.com/docs/components/popover).
## Radio Group
The Radio Group component is a wrapper around the `Radio` component. It provides a more convenient way to work with radio buttons.
{% component path="shadcn/radio-group" /%}
```tsx
import { Label } from '@kit/ui/label';
import { RadioGroup, RadioGroupItem } from '@kit/ui/radio-group';
export default function RadioGroupDemo() {
return (
);
}
```
For more information on how to use the Radio Group component, refer to the [Radio Group documentation](https://ui.shadcn.com/docs/components/radio-group).
## Select
The `Select` component is a customizable select component that allows users to select an option from a list of options.
{% component path="shadcn/select" /%}
```tsx
import * as React from 'react';
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from '@kit/ui/select';
export default function SelectDemo() {
return (
);
}
```
For more information on the `Select` component, please refer to the [Select](https://ui.shadcn.com/docs/components/select) documentation.
## Skeleton
The `Skeleton` component is used to display a loading state while content is being fetched or rendered. It can be used to create a placeholder state for your components.
{% component path="shadcn/skeleton" /%}
```tsx
import { Skeleton } from '@kit/ui/skeleton';
export default function SkeletonDemo() {
return (
);
}
```
For more information on the `Skeleton` component, please refer to the [Skeleton](https://ui.shadcn.com/docs/components/skeleton) documentation.
## Switch
The `Switch` component is a customizable switch component that allows users to toggle between on and off states.
{% component path="shadcn/switch" /%}
```tsx
import { Label } from '@kit/ui/label';
import { Switch } from '@kit/ui/switch';
export default function SwitchDemo() {
return (
);
}
```
For more information on the `Switch` component, please refer to the [Switch](https://ui.shadcn.com/docs/components/switch) documentation.
## Tabs
The `Tabs` component is a customizable tabs component that allows users to switch between different views or sections.
{% component path="shadcn/tabs" /%}
```tsx
import { Button } from '@kit/ui/button';
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from '@kit/ui/card';
import { Input } from '@kit/ui/input';
import { Label } from '@kit/ui/label';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@kit/ui/tabs';
export default function TabsDemo() {
return (
AccountPasswordAccount
Make changes to your account here. Click save when you're done.
Password
Change your password here. After saving, you'll be logged out.
);
}
```
For more information on the `Tabs` component, please refer to the [Tabs](https://ui.shadcn.com/docs/components/tabs) documentation.
## Textarea
The `Textarea` component is a customizable textarea component that allows users to enter multiple lines of text.
{% component path="shadcn/textarea" /%}
```tsx
import { Textarea } from '@kit/ui/textarea';
function TextareaDemo() {
return (
);
}
```
For more information on the `Textarea` component, please refer to the [Textarea](https://ui.shadcn.com/docs/components/textarea) documentation.
## Tooltip
The `Tooltip` component is a customizable tooltip component that displays additional information when hovering over an element.
{% component path="shadcn/tooltip" /%}
```tsx
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@kit/ui/tooltip';
import { Button } from '@kit/ui/button';
export default function TooltipDemo() {
return (
This is a tooltip with some content.
);
}
```
For more information on the `Tooltip` component, please refer to the [Tooltip](https://ui.shadcn.com/docs/components/tooltip) documentation.