shadcn.io is not affiliated with official shadcn/ui
Popover examples · Standard
Info Icon Popover for React
An info icon button that opens a popover with a line of help text.
A ghost icon button with an info icon that opens a line of help text. Use it beside a field or a setting whose meaning isn't obvious, so the help is there on demand and out of the way otherwise. In React, Base UI handles opening, dismissing and focus.
Preview
Installation
FAQ
What does the info panel contain?
PopoverTitle reads More information and has className="sr-only". The visible copy is one p: Helpful information goes here. The button's aria-label is the same phrase, More information.
How does the info icon become the trigger?
The trigger is a Button with variant="ghost", size="icon-md", and aria-label="More information". InfoIcon has aria-hidden="true". Activating the button opens the panel.
Pass the button to render on PopoverTrigger, and use PopoverContent as the panel.
How is the icon button named?
The button has aria-label="More information". InfoIcon is aria-hidden="true", so the icon is decorative. PopoverTitle repeats More information for the panel and is sr-only.
How much text is in this demo?
One sentence: Helpful information goes here. It sits in PopoverContent under the hidden title. This file sets no width class, so the panel keeps w-72.
Related
- Simple Text PopoverA button that opens a popover with a
- Compact PopoverA small question-mark button that opens a
- Simple TooltipAn outline button that shows a one-line
- Button with Text (Standard)The one filled action
- Popover with HeadingA View Details button that opens a
- Badge with Text (Standard)A default badge with a short label for a