shadcn.io is not affiliated with official shadcn/ui
Popover examples · Standard
Popover with Divider for React
A popover whose two sections are split by a separator.
An Options button that opens two sections with a separator between them. Split a panel this way when it holds two kinds of content that shouldn't run together. In React, Base UI handles opening, dismissing and focus.
Preview
Installation
FAQ
How does the separator split the panel?
PopoverContent sets gap-2. Section 1 and Section 2 are p elements with font-medium. A Separator sits between them. PopoverTitle reads Options and has className="sr-only".
How does the Options button become the trigger?
The trigger is a Button with variant="outline" and the label Options. Activating it opens the panel.
Pass the button to render on PopoverTrigger, and use PopoverContent as the panel.
Where is the panel's name?
PopoverTitle is Options with className="sr-only", matching the button label. Section 1 and Section 2 are the visible text. They are paragraphs.
What controls the space around the separator?
gap-2 on PopoverContent spaces Section 1, the Separator, and Section 2. The two lines use font-medium. This file adds no width class.
Related
- Popover with HeadingA View Details button that opens a
- Popover with ListA View Items button that opens a popover
- Popover with FooterA popover with a title, a line of text
- Simple Dropdown with Icons Dropdown MenuA short menu behind a dots button with an
- Standard CardA basic card with a title, a description
- Compact PopoverA small question-mark button that opens a