shadcn.io is not affiliated with official shadcn/ui
Popover examples · Standard
Popover with Heading for React
A View Details button that opens a popover with a title and a description.
A View Details button that opens a title and one line of description. It's the simplest structured popover: the title names the panel for screen readers too. In React, Base UI handles opening, dismissing and focus.
Preview
Installation
FAQ
Which parts are the title and the description?
Both live in PopoverHeader. PopoverTitle reads Details. PopoverDescription reads Additional information about this item. The trigger label is View Details.
How does View Details become the trigger?
The trigger is a Button with variant="outline" and the label View Details. Activating it opens the panel.
Pass the button to render on PopoverTrigger, and use PopoverContent as the panel.
What does the description say?
PopoverDescription is the sentence Additional information about this item. It sits under PopoverTitle, which is the word Details. PopoverHeader wraps the two.
How wide is the details panel?
PopoverContent has no width class in this file, so it keeps w-72. The header is the only content: the title, then the description.
Related
- Simple Text PopoverA button that opens a popover with a
- Popover with FooterA popover with a title, a line of text
- Popover with DividerA popover whose two sections are split by
- User Profile PopoverA username button that opens a popover
- Standard CardA basic card with a title, a description
- Standard DialogA share dialog with a read-only link, a