logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
6.0.0-alpha.3
  • Components Overview
  • Changelog
    v6.0.0-alpha.3
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic
Non-modal
Placement
Custom mask style
Custom indicator
Custom action
Custom highlighted area style
Custom semantic dom styling
API
Tour
TourStep
Semantic DOM
Design Token

Tour

A popup component for guiding users through a product.
Importimport { Tour } from "antd";
GitHub
components/tourIssueOpen issues
Docs
Edit this page
Versionsupported since 5.0.0
contributors
TooltipTree

Resources

Ant Design X
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
X
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

Use when you want to guide users through a product.

Examples

API

Common props ref:Common props

Tour

PropertyDescriptionTypeDefaultVersion
arrowWhether to show the arrow, including the configuration whether to point to the center of the elementboolean|{ pointAtCenter: boolean}true
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-
closeIconCustomize close iconReact.ReactNodetrue5.9.0
disabledInteractionDisable interaction on highlighted area.booleanfalse5.13.0
gapControl the radius of the highlighted area and the offset between highlighted area and the element.{ offset?: number | [number, number]; radius?: number }{ offset?: 6 ; radius?: 2 }5.0.0 (array type offset: 5.9.0)
placementPosition of the guide card relative to the target elementcenter left leftTop leftBottom right rightTop rightBottom top topLeft topRight bottom bottomLeft bottomRightbottom
onCloseCallback function on shutdownFunction-
maskWhether to enable masking, change mask style and fill color by pass custom propsboolean | { style?: React.CSSProperties; color?: string; }true
typeType, affects the background color and text colordefault primarydefault
openOpen tourboolean-
onChangeCallback when the step changes. Current is the previous step(current: number) => void-
currentWhat is the current stepnumber-
scrollIntoViewOptionssupport pass custom scrollIntoView optionsboolean | ScrollIntoViewOptionstrue5.2.0
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-
indicatorsRendercustom indicator(current: number, total: number) => ReactNode-5.2.0
actionsRendercustom action(originNode: ReactNode, info: { current: number, total: number }) => ReactNode-5.25.0
zIndexTour's zIndexnumber10015.3.0
getPopupContainerSet the rendering node of Tour floating layer(node: HTMLElement) => HTMLElementbody5.12.0

TourStep

PropertyDescriptionTypeDefaultVersion
targetGet the element the guide card points to. Empty makes it show in center of screen() => HTMLElement | HTMLElement-
arrowWhether to show the arrow, including the configuration whether to point to the center of the elementboolean { pointAtCenter: boolean}true
closeIconCustomize close iconReact.ReactNodetrue5.9.0
coverDisplayed pictures or videosReactNode-
titletitleReactNode-
descriptiondescriptionReactNode-
placementPosition of the guide card relative to the target elementcenter left leftTop leftBottom right rightTop rightBottom top topLeft topRight bottom bottomLeft bottomRightbottom
onCloseCallback function on shutdownFunction-
maskWhether to enable masking, change mask style and fill color by pass custom props, the default follows the mask property of Tourboolean | { style?: React.CSSProperties; color?: string; }true
typeType, affects the background color and text colordefault primarydefault
nextButtonPropsProperties of the Next button{ children: ReactNode; onClick: Function }-
prevButtonPropsProperties of the previous button{ children: ReactNode; onClick: Function }-
scrollIntoViewOptionssupport pass custom scrollIntoView options, the default follows the scrollIntoViewOptions property of Tourboolean | ScrollIntoViewOptionstrue5.2.0

Semantic DOM

Design Token

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
closeBtnSizeClose button sizenumber22
primaryNextBtnHoverBgHover background color of next button in primary typestringrgb(240,240,240)
primaryPrevBtnBgBackground color of previous button in primary typestringrgba(255,255,255,0.15)
zIndexPopupTour popup z-indexnumber1070
Global TokenHow to use?
Basic

The most basic usage.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Placement

Change the placement of the guide relative to the target, there are 12 placements available. When target={null} the guide will show in the center.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom indicator

Custom indicator.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom highlighted area style

Using gap to control the radius of highlight area and the offset between highlight area and the element.

  • Setting offset in two directions individually and offset with array type is not supported until 5.9.0.
CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Non-modal

Use mask={false} to make Tour non-modal. At the meantime it is recommended to use with type="primary" to emphasize the guide itself.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom mask style

Custom mask style.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Custom action

Custom action.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.25.0
Custom semantic dom styling

You can customize the semantic dom style of Tour by passing objects/functions through classNames and styles.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
Radius:
offset:
Horizontal offset:
Vertical offset:
  • root
    6.0.0
    Tour root container with absolute positioning, z-index control, max width, visibility, arrow background color variable, theme styles and other container styles
  • mask
    6.0.0
    Mask layer element with fixed positioning, full screen coverage, z-index, pointer events, transition animation and other mask styles
  • section
    6.0.0
    Card main content area with text alignment, border radius, box shadow, relative positioning, background color, border, background clip and other card styles
  • cover
    6.0.0
    Card cover area with text center alignment, padding, image width and other image display styles
  • header
    6.0.0
    Card header area with padding, width calculation, word break and other header container styles
  • title
    6.0.0
    Guide title text with font weight and other title text styles
  • description
    6.0.0
    Guide description text with padding, word wrap and other description text styles
  • footer
    6.0.0
    Card bottom action area with padding, text right alignment, border radius, flex layout and other bottom container styles
  • actions
    6.0.0
    Action button group container with left auto margin, button spacing and other button group layout styles
  • indicators
    6.0.0
    Indicator group container with inline-block display and other indicator container styles
  • indicator
    6.0.0
    Single indicator element with width/height size, inline-block display, border radius, background color, right margin, active state and other dot styles