apps/v4/content/docs/components/radix/popover.mdx
npx shadcn@latest add popover
<Step>Install the following dependencies:</Step>
npm install radix-ui
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="popover" title="components/ui/popover.tsx" styleName="radix-nova" />
<Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import {
Popover,
PopoverContent,
PopoverDescription,
PopoverHeader,
PopoverTitle,
PopoverTrigger,
} from "@/components/ui/popover"
<Popover>
<PopoverTrigger asChild>
<Button variant="outline">Open Popover</Button>
</PopoverTrigger>
<PopoverContent>
<PopoverHeader>
<PopoverTitle>Title</PopoverTitle>
<PopoverDescription>Description text here.</PopoverDescription>
</PopoverHeader>
</PopoverContent>
</Popover>
A simple popover with a header, title, and description.
<ComponentPreview styleName="radix-nova" name="popover-basic" />Use the align prop on PopoverContent to control the horizontal alignment.
A popover with form fields inside.
<ComponentPreview styleName="radix-nova" name="popover-form" />To enable RTL support in shadcn/ui, see the RTL configuration guide.
<ComponentPreview styleName="radix-nova" name="popover-rtl" direction="rtl" />See the Radix UI Popover documentation.