shadcn.io is not affiliated with official shadcn/ui
Popover examples · Standard
Simple Text Popover for React
A button that opens a popover with a single line of text.
An Open button that shows one sentence in a panel, with a visually hidden title to name it. Use it for a note that should stay up until it's dismissed, which a tooltip won't do. In React, Base UI handles opening, dismissing and focus.
Preview
Installation
FAQ
What is in this panel?
PopoverTitle reads Details and has className="sr-only", so the name is for assistive tech. The visible line is a p: This is a simple popover with text content. The trigger label is Open.
How does the Open button become the trigger?
The trigger is a Button with variant="outline" and the label Open. Activating it opens the panel.
Pass the button to render on PopoverTrigger, and use PopoverContent as the panel.
When should this be a tooltip?
This panel is one sentence that stays open until it is dismissed. A Tooltip fits a few words on hover or focus. The sr-only title gives this panel a name.
How wide is the panel?
This demo sets no width on PopoverContent, so it keeps the part's w-72. The title is visually hidden, and the paragraph is the only text someone sees.
Related
- Popover with HeadingA View Details button that opens a
- Info Icon PopoverAn info icon button that opens a popover
- Compact PopoverA small question-mark button that opens a
- Simple TooltipAn outline button that shows a one-line
- Standard DialogA share dialog with a read-only link, a
- Simple Dropdown with Icons Dropdown MenuA short menu behind a dots button with an