shadcn.io is not affiliated with official shadcn/ui
Popover examples · Standard
Popover with Steps for React
A three-step tour in a popover, with Previous and Next buttons.
A Start Tour button that opens a three-step walkthrough: a Step 1 of 3 title, the step's message, and Previous and Next buttons that turn off at either end. Use it to introduce a feature right where it lives. In React, Base UI handles opening, dismissing and focus.
Preview
Installation
FAQ
How does the step text change?
steps holds three strings, and the current step is a piece of state that starts at 0. PopoverTitle reads Step, the step number, then of 3, and PopoverDescription shows the current string. Both sit in PopoverHeader.
When are Previous and Next disabled?
Previous is disabled on the first step and Next on the last. Both are size="sm", Previous uses variant="outline", and they sit in a flex justify-between gap-2 row.
They use disabled.
What happens on the last step?
Previous and Next only change the step; the open state isn't controlled. On the last step Next is disabled, and the panel stays up until Escape or a click outside.
How does Start Tour become the trigger?
The trigger is a Button with variant="outline" and the label Start Tour. Activating it opens the panel. Moving between steps leaves that open state alone.
Pass the button to render on PopoverTrigger, and use PopoverContent as the panel.
Related
- Popover with FooterA popover with a title, a line of text
- Popover with FormA Settings popover with a text input and
- Standard DialogA share dialog with a read-only link, a
- Accordion Form with Icon SectionsA form split into personal, contact and
- Popover with HeadingA View Details button that opens a
- Compact PopoverA small question-mark button that opens a