- Accordion
- Action BarUpdated
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- BadgeUpdated
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- CalendarUpdated
- CardUpdated
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context MenuUpdated
- Data List
- Date Picker
- DialogUpdated
- DrawerUpdated
- Editable
- FieldUpdated
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- MarqueeUpdated
- Menu
- Native Select
- Number InputUpdated
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- TableUpdated
- Tabs
- Textarea
- TimerUpdated
- ToastUpdated
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View
Installation#
pnpm dlx shadcn@latest add @shark/tour
Anatomy#
Tour ├── TourTrigger ├── TourActionTrigger ├── TourOverlay └── TourContent ├── TourSpotlight ├── TourHeader │ ├── TourProgressText │ ├── TourTitle │ └── TourDescription ├── TourBody ├── TourFooter │ ├── TourActions │ ├── TourPreviousStep │ └── TourNextStep └── TourClose
Usage#
import { Tour, TourTrigger, TourContent, TourHeader, TourProgressText, TourTitle, TourDescription, TourFooter, TourNextStep, TourPreviousStep, } from "@/components/ui/tour";
<Tour steps={steps}> <TourTrigger>Open Tour</TourTrigger> <TourContent> <TourHeader> <TourProgressText /> <TourTitle /> <TourDescription /> </TourHeader> </TourContent> <TourFooter> <TourNextStep /> <TourPreviousStep /> </TourFooter> </Tour>
Examples#
Step Types#
Demonstrate all three step types in a single tour: dialog for welcome/completion, tooltip anchored to elements, and floating for fixed-position content.
Progress#
Display a visual progress indicator at the bottom of the tour content showing how far along the user is.
Skip#
Allow users to skip the entire tour at any step by adding a skip action.
Keyboard Navigation#
Enable arrow key navigation between tour steps using the keyboardNavigation prop.
Use arrow keys to navigate, Escape to close
Events#
Listen to tour lifecycle events like onStepChange and onStatusChange to track user progress.
Wait for Click#
Use the effect function with waitForEvent to wait for user interaction before proceeding to the next step.
Wait for Input#
Create form tutorials that wait for users to enter valid input before advancing.
Wait for Element#
Wait for dynamically rendered elements to appear in the DOM before showing a step.
Async#
Load data asynchronously and update step content before displaying it using the effect function with show() and update().
Custom spacing#
Use [--space:--spacing("value")] on TourContent to adjust internal spacing.
Default spacing is --spacing(4).
You can use breakpoint utilities to change the internal spacing at different screen sizes.
md:[--space:--spacing(6)] lg:[--space:--spacing(8)]
API Reference#
Tour#
| Prop | Type | Default |
|---|---|---|
steps | TourStepDetails[] | [] |
lazyMount | boolean | true |
unmountOnExit | boolean | true |
keyboardNavigation | boolean | - |
onStepChange | (details: { stepId: string | null }) => void | - |
onStatusChange | (details: { status: string }) => void | - |
immediate | boolean | - |
present | boolean | - |
onExitComplete | () => void | - |
TourTrigger#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourContent#
| Prop | Type | Default |
|---|---|---|
showCloseButton | boolean | true |
className | string | - |
asChild | boolean | - |
| Attribute | Default |
|---|---|
--space | --spacing(4) |
TourHeader#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourTitle#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourDescription#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourProgressText#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourFooter#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourActions#
| Prop | Type | Default |
|---|---|---|
className | string | - |
TourPreviousStep#
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
TourNextStep#
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
TourClose#
| Prop | Type | Default |
|---|---|---|
asChild | boolean | - |
useTourContext#
| Return | Type |
|---|---|
tour | UseTourReturn |
handleStart | () => void |
For a complete list of props, see the Ark UI documentation.
On This Page