logoAnt Design

⌘ K
  • 디자인
  • 개발
  • 컴포넌트
  • 블로그
  • 자료
5.21.3
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • 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
    • Popover
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tabs
    • 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
      5.13.0

Tabs

Tabs make it easy to explore and switch between different views.
가져오기import{ Tabs }from"antd";
소스components/tabs
문서
이 페이지 수정변경 로그

Resources

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

Community

Awesome Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference
Work with Us

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
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

Ant Design has 3 types of Tabs for different situations.

  • Card Tabs: for managing too many closeable views.
  • Normal Tabs: for functional aspects of a page.
  • Radio.Button: for secondary tabs.

Examples

API

Common props ref:Common props

Tabs

PropertyDescriptionTypeDefaultVersion
activeKeyCurrent TabPane's keystring-
addIconCustomize add icon, only works with type="editable-card"ReactNode<PlusOutlined />4.4.0
animatedWhether to change tabs with animation.boolean | { inkBar: boolean, tabPane: boolean }{ inkBar: true, tabPane: false }
centeredCenters tabsbooleanfalse4.4.0
defaultActiveKeyInitial active TabPane's key, if activeKey is not setstringThe key of first tab
hideAddHide plus icon or not. Only works while type="editable-card"booleanfalse
indicatorCustomize size and align of indicator{ size?: number | (origin: number) => number; align: start | center | end; }-5.13.0
itemsConfigure tab contentTabItemType[]4.23.0
more自定义折叠菜单属性MoreProps{ icon: <EllipsisOutlined /> , trigger: 'hover' }
removeIconThe custom icon of remove, only works with type="editable-card"ReactNode<CloseOutlined />5.15.0
popupClassNameclassName for more dropdown.string-4.21.0
renderTabBarReplace the TabBar(props: DefaultTabBarProps, DefaultTabBar: React.ComponentClass) => React.ReactElement-
sizePreset tab bar sizelarge | middle | smallmiddle
tabBarExtraContentExtra content in tab barReactNode | {left?: ReactNode, right?: ReactNode}-object: 4.6.0
tabBarGutterThe gap between tabsnumber-
tabBarStyleTab bar style objectCSSProperties-
tabPositionPosition of tabstop | right | bottom | lefttop
destroyInactiveTabPaneWhether destroy inactive TabPane when change tabbooleanfalse
typeBasic style of tabsline | card | editable-cardline
onChangeCallback executed when active tab is changed(activeKey: string) => void-
onEditCallback executed when tab is added or removed. Only works while type="editable-card"(action === 'add' ? event : targetKey, action) => void-
onTabClickCallback executed when tab is clicked(key: string, event: MouseEvent) => void-
onTabScrollTrigger when tab scroll({ direction: left | right | top | bottom }) => void-4.3.0

More option at rc-tabs tabs

TabItemType

PropertyDescriptionTypeDefaultVersion
closeIconCustomize close icon in TabPane's head. Only works while type="editable-card". 5.7.0: close button will be hidden when setting to null or falseReactNode-
destroyInactiveTabPaneWhether destroy inactive TabPane when change tabbooleanfalse5.11.0
disabledSet TabPane disabledbooleanfalse
forceRenderForced render of content in tabs, not lazy render after clicking on tabsbooleanfalse
keyTabPane's keystring-
labelTabPane's head display textReactNode-
iconTabPane's head display iconReactNode-5.12.0
childrenTabPane's head display contentReactNode-
closableWhether a close (x) button is visible, Only works while type="editable-card"booleantrue

Design Token

컴포넌트 토큰어떻게 사용하나요?

토큰 이름설명타입기본값
cardBg卡片标签页背景色stringrgba(0, 0, 0, 0.02)
cardGutter卡片标签间距number2
cardHeight卡片标签页高度string | number40
cardPadding卡片标签页内间距string8px 16px
cardPaddingLG大号卡片标签页内间距string8px 16px 6px
cardPaddingSM小号卡片标签页内间距string6px 16px
horizontalItemGutter横向标签页标签间距number32
horizontalItemMargin横向标签页标签外间距string
horizontalItemMarginRTL横向标签页标签外间距(RTL)string
horizontalItemPadding横向标签页标签内间距string12px 0
horizontalItemPaddingLG大号横向标签页标签内间距string16px 0
horizontalItemPaddingSM小号横向标签页标签内间距string8px 0
horizontalMargin横向标签页外间距string0 0 16px 0
inkBarColor指示条颜色string#1677ff
itemActiveColor标签激活态文本颜色string#0958d9
itemColor标签文本颜色stringrgba(0, 0, 0, 0.88)
itemHoverColor标签悬浮态文本颜色string#4096ff
itemSelectedColor标签选中态文本颜色string#1677ff
titleFontSize标签页标题文本大小number14
titleFontSizeLG大号标签页标题文本大小number16
titleFontSizeSM小号标签页标题文本大小number14
verticalItemMargin纵向标签页标签外间距string16px 0 0 0
verticalItemPadding纵向标签页标签内间距string8px 24px
zIndexPopup下拉菜单 z-indexnumber1050

글로벌 토큰어떻게 사용하나요?

Basic
codepen icon
External Link Icon
expand codeexpand code
Disabled
codepen icon
External Link Icon
expand codeexpand code
Centered
codepen icon
External Link Icon
expand codeexpand code
Icon
codepen icon
External Link Icon
expand codeexpand code
Indicator
codepen icon
External Link Icon
expand codeexpand code
Slide
codepen icon
External Link Icon
expand codeexpand code
Extra content
codepen icon
External Link Icon
expand codeexpand code
Size
codepen icon
External Link Icon
expand codeexpand code
Position
codepen icon
External Link Icon
expand codeexpand code
Card type tab
codepen icon
External Link Icon
expand codeexpand code
Add & close tab
codepen icon
External Link Icon
expand codeexpand code
Container of card type Tab
codepen icon
External Link Icon
expand codeexpand code
Customized trigger of new tab
codepen icon
External Link Icon
expand codeexpand code
Customized bar of tab
codepen icon
External Link Icon
expand codeexpand code
Draggable Tabs
codepen icon
External Link Icon
expand codeexpand code
Animated
codepen icon
External Link Icon
expand codeexpand code
Nest
codepen icon
External Link Icon
expand codeexpand code
component Token
codepen icon
External Link Icon
expand codeexpand code
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab 1
Tab 2
Tab 3
Tab 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab 1
Tab 2
Tab 2
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab-0
Tab-1
Tab-2
Tab-3
Tab-4
Tab-5
Tab-6
Tab-7
Tab-8
Tab-9
Tab-10
Tab-11
Tab-12
Tab-13
Tab-14
Tab-15
Tab-16
Tab-17
Tab-18
Tab-19
Tab-20
Tab-21
Tab-22
Tab-23
Tab-24
Tab-25
Tab-26
Tab-27
Tab-28
Tab-29
Content of tab 1
Tab 1
Tab 2
Tab 3
Content of tab 1



You can also specify its direction or both side


Tab 1
Tab 2
Tab 3
Content of tab 1
Tab 1
Tab 2
Tab 3
Content of tab 1
Card Tab 1
Card Tab 2
Card Tab 3
Content of card tab 1
Tab position:
Tab 1
Tab 2
Tab 3
Content of Tab 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab 1
Tab 2
Tab 3
Content of Tab 1
Tab Title 1
Tab Title 2
Tab Title 3

Content of Tab Pane 1

Content of Tab Pane 1

Content of Tab Pane 1

Tab 1
Tab 2
Content of Tab Pane 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Bamboo
Little
Light
Hello Bamboo!
Tab 1
Tab 2
Tab 0
Tab 1
Tab 2
Tab 3
Tab 4
Tab 5
Tab 6
Tab 7
Tab 8
Tab 9
Tab 10
Tab 11
Tab 12
Tab 13
Tab 14
Tab 15
Tab 16
Tab 17
Tab 18
Tab 19
TTTT 1
Tab 1
Tab 2
Tab 3
Content of tab 1
Tab 1
Tab 2
Tab 3
Content of tab 1
Tab 1
Tab 2
Tab 3
Content of tab 1
Tab 1
Tab 2
Tab 3
Content of tab 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1
Tab 1
Tab 2
Tab 3
Content of Tab Pane 1