logoNamu Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
1.0.0
  • Namu Design of React
  • Changelogv1.0.0
  • Basic Usage
    • Getting Started
    • Usage with create-react-app
    • Usage with Next.js
    • Usage with Umi
    • Usage with Vite
  • Advanced
    • Customize ThemeUpdated
    • CSS Compatible
    • Server Side RenderingNew
    • Use custom date library
    • Internationalization
  • Migration
    • V4 to V5
    • Less variables to Component Token
  • Other
    • Common Props
    • Third-Party Libraries
    • Contributing
    • FAQ
How to use Component Token
Component Token
Anchor
Avatar
BreadCrumb
Calendar
Card
Carousel
Checkbox
Descriptions
Drawer
Dropdown
Empty
Image
List
Mentions
Menu
Message
Modal
Pagination
Popover>
Radio
Rate
Result
Segment
Skeleton
Slider
Statistic
Step
Tabs
Tag
Timeline
Tooltip
Transfer
Typography
Upload

Less variables to Component Token

  • V4 to V5Common Props

    Resources

    Namu Design Charts
    Namu Design Pro
    Namu Design Pro Components
    Namu Design Mobile
    Namu Design Mini
    Namu 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 Namu Design
    Medium
    Twitter
    yuqueNamu Design in YuQue
    Namu Design in Zhihu
    Experience Cloud Blog
    seeconfSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTechMore Products

    yuqueYuQue-Document Collaboration Platform
    AntVAntV-Data Visualization
    EggEgg-Enterprise Node.js Framework
    kitchenKitchen-Sketch Toolkit
    xtechAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Namu Design Community

    This document contains the correspondence between all the less variables related to components in version 4.x and the Component Token in version 5.x. If you are upgrading from version 4.x to version 5.x, you can quickly find the corresponding Component Token through this comparison table.

    Note: There are still some less variables that do not have a corresponding Component Token, and these variables have been deprecated in version 5.x.

    How to use Component Token

    We could configure global token and component token for each component through the theme property of ConfigProvider.

    import React from 'react';
    import { Checkbox, ConfigProvider, Radio } from 'antd';
    const App: React.FC = () => (
    <ConfigProvider
    theme={{
    components: {
    Radio: {
    colorPrimary: '#00b96b',
    },
    Checkbox: {
    colorPrimary: '#ff4d4f',
    },
    },
    }}
    >
    <Radio>Radio</Radio>
    <Checkbox>Checkbox</Checkbox>
    </ConfigProvider>
    );
    export default App;

    Component Token

    Anchor

    Less variablesComponent TokenNote
    @anchor-bg'-'Can be modified directly by className or style
    @anchor-border-colorcolorSplitGlobalToken
    @anchor-link-toplinkPaddingBlock-
    @anchor-link-leftlinkPaddingInlineStart-
    @anchor-link-padding-${linkPaddingBlock}px ${linkPaddingInlineStart}px

    Avatar

    less 变量Component Token备注
    @avatar-size-basecontainerSize-
    @avatar-size-lgcontainerSizeLG-
    @avatar-size-smcontainerSizeSM-
    @avatar-font-size-basetextFontSize-
    @avatar-font-size-lgtextFontSizeLG-
    @avatar-font-size-smtextFontSizeSM-
    @avatar-bg-Can be directly overridden by className or style
    @avatar-colorcolorTextLightSolidGlobal Token
    @avatar-border-radiusborderRadiusGlobal Token
    @avatar-group-overlapping-Deprecated for style change
    @avatar-group-spacegroupSpace-
    @avatar-group-border-colorcolorBorderBgGlobal Token

    BreadCrumb

    Less 变量Component Token备注
    @breadcrumb-base-coloritemColor-
    @breadcrumb-last-item-colorlastItemColor-
    @breadcrumb-font-sizefontSizeGlobalToken
    @breadcrumb-icon-font-sizeiconFontSize-
    @breadcrumb-link-colorlinkColor-
    @breadcrumb-link-color-hoverlinkHoverColor-
    @breadcrumb-separator-colorseparatorColor-
    @breadcrumb-separator-marginseparatorMargin-

    Calendar

    Less variablesComponent TokenNote
    @calendar-bg-Deprecated for style change
    @calendar-input-bg-Deprecated for style change
    @calendar-border-color-Deprecated for style change
    @calendar-item-active-bgitemActiveBg-
    @calendar-column-active-bg-Deprecated for style change
    @calendar-full-bgfullBg-
    @calendar-full-panel-bgfullPanelBg-

    Card

    Less variablesComponent TokenNote
    @card-head-colorcolorTextHeadingGlobal Token
    @card-head-backgroundheaderBg-
    @card-head-font-sizeheaderFontSize-
    @card-head-font-size-smheaderFontSizeSM-
    @card-head-padding-Deprecated
    @card-head-padding-sm-Deprecated
    @card-head-heightheaderHeight-
    @card-head-height-smheaderHeightSM-
    @card-inner-head-padding-Deprecated
    @card-padding-basecardPaddingBase-
    @card-padding-base-smcardPaddingBaseSm-
    @card-actions-backgroundactionsBackground-
    @card-actions-li-marginactionsLiMargin-
    @card-skeleton-bg-Deprecated in favor of internal Skeleton
    @card-backgroundcolorBgContainerGlobal Token
    @card-shadow-Could be modified by className or style directly
    @card-radiusborderRadiusLGGlobal Token
    @card-head-tabs-margin-bottomtabsMarginBottom-
    @card-head-extra-colorextraColor-

    Carousel

    Less variablesComponent TokenNote
    @carousel-dot-widthdotWidth-
    @carousel-dot-heightdotHeight-
    @carousel-dot-active-widthdotActiveWidth-

    Checkbox

    Less variablesComponent TokenNote
    @checkbox-sizecontrolInteractiveSizeGlobalToken
    @checkbox-colorcolorPrimary-
    @checkbox-check-colorcolorWhite-
    @checkbox-check-bg-colorPrimary
    @checkbox-border-widthlineWidth-
    @checkbox-border-radiusborderRadiusSM-
    @checkbox-group-item-margin-right-Deprecated for style change

    Descriptions

    Less variablesComponent TokenNote
    @descriptions-bglabelBg-
    @descriptions-title-margin-bottomtitleMarginBottom-
    @descriptions-default-paddingpadding、paddingLGGlobalToken, used as ${token.padding}px ${token.paddingLG}px
    @descriptions-middle-paddingpaddingSM、paddingLGGlobalToken, used as ${token.paddingSM}px ${token.paddingLG}px
    @descriptions-small-paddingpaddingXS、paddingGlobalToken, used as ${token.paddingXS}px ${token.padding}px
    @descriptions-item-padding-bottomitemPaddingBottom-
    @descriptions-item-trailing-colon-Deprecated for style change
    @descriptions-item-label-colon-margin-rightcolonMarginRight-
    @descriptions-item-label-colon-margin-leftcolonMarginLeft-
    @descriptions-extra-colorextraColor-

    Drawer

    Less variablesComponent TokenNote
    @drawer-bgcolorBgElevatedGlobalToken
    @drawer-header-paddingpadding、paddingLGGlobalToken, used as ${padding}px ${paddingLG}px
    @drawer-title-font-sizefontSizeLGGlobalToken
    @drawer-title-line-heightlineHeightLGGlobalToken
    @drawer-body-paddingpaddingLGGlobalToken
    @drawer-footer-padding-verticalfooterPaddingBlockfooterPaddingBlock is a number without units, @drawer-footer-padding-vertical with units
    @drawer-footer-padding-horizontalfooterPaddingInlinefooterPaddingInline is a number without units, @drawer-footer-padding-horizontal with units

    Dropdown

    Less variablesComponent TokenNote
    @dropdown-selected-colorcolorPrimary-
    @dropdown-menu-submenu-disabled-bgcolorBgElevatedGlobalToken
    @dropdown-selected-bgcontrolItemBgActiveGlobalToken

    Empty

    Less variablesComponent TokenNote
    @empty-font-sizefontSizeGlobalToken

    Image

    Less variablesComponent TokenNote
    @image-size-base-Deprecated for not used
    @image-font-size-base-Deprecated for not used
    @image-bgcolorFillTertiaryGlobalToken
    @image-colorcolorTextLightSolidGlobalToken
    @image-preview-operation-sizepreviewOperationSize-
    @image-preview-operation-colorpreviewOperationColor-
    @image-preview-operation-disabled-colorpreviewOperationColorDisabled-

    List

    Less variablesComponent TokenNote
    @list-header-backgroundheaderBg-
    @list-footer-backgroundfooterBg-
    @list-empty-text-paddingemptyTextPadding-
    @list-item-paddingitemPadding-
    @list-item-padding-smitemPaddingSM-
    @list-item-padding-lgitemPaddingLG-
    @list-item-meta-margin-bottommetaMarginBottom-
    @list-item-meta-avatar-margin-rightavatarMarginRight-
    @list-item-meta-title-margin-bottomtitleMarginBottom-
    @list-customize-card-bg-Deprecated for style change
    @list-item-meta-description-font-sizedescriptionFontSize-

    Mentions

    Less variablesComponent TokenNote
    @mentions-dropdown-bgcolorBgElevatedGlobalToken
    @mentions-dropdown-menu-item-hover-bg-Deprecated

    Menu

    Less variablesComponent TokenNote
    @menu-inline-toplevel-item-heightitemHeightSame as @menu-item-height
    @menu-item-heightitemHeight-
    @menu-item-group-heightgroupTitleLineHeight-
    @menu-collapsed-widthcollapsedWidth-
    @menu-bgitemBg-
    @menu-popup-bgpopupBg-
    @menu-item-coloritemColor-
    @menu-inline-submenu-bgsubMenuItemBg-
    @menu-highlight-coloritemSelectedColor-
    @menu-highlight-danger-colordangerItemSelectedColor-
    @menu-item-active-bgitemActiveBg-
    @menu-item-active-danger-bgdangerItemActiveBg-
    @menu-item-active-border-widthactiveBarBorderWidth-
    @menu-item-group-title-colorgroupTitleColor-
    @menu-item-vertical-marginitemMarginBlock-
    @menu-item-font-sizefontSizeGlobal Token
    @menu-item-boundary-margin-Deprecated in favor of new style, use itemMarginBlock instead
    @menu-item-padding-horizontalitemPaddingInline-
    @menu-item-padding-Depreacated, use itemPaddingInline and itemHeight instead
    @menu-horizontal-line-heighthorizontalLineHeight-
    @menu-icon-margin-righticonMarginInlineEnd-
    @menu-icon-sizeiconSize-
    @menu-icon-size-lghorizontalLineHeight-
    @menu-dark-colordarkItemColor-
    @menu-dark-danger-colordarkDangerItemColor-
    @menu-dark-bgdarkItemBg-
    @menu-dark-arrow-color-Deprecated, and same as text color
    @menu-dark-inline-submenu-bgdarkSubMenuItemBg-
    @menu-dark-highlight-colordarkItemSelectedColor-
    @menu-dark-item-active-bgdarkItemSelectedBg-
    @menu-dark-item-active-danger-bgdarkDangerItemSelectedBg-
    @menu-dark-selected-item-icon-color-Deprecated, same as darkItemSelectedColor
    @menu-dark-selected-item-text-color-Deprecated, same as darkItemSelectedColor
    @menu-dark-item-hover-bgdarkItemHoverBg-

    Message

    Less variablesComponent TokenNote
    @zindex-messagezIndexPopup-
    @message-notice-content-paddingcontentPadding-
    @message-notice-content-bgcontentBg-

    Modal

    Less variablesComponent TokenNote
    @modal-header-padding-vertical-Deprecated for style change
    @modal-header-padding-horizontal-Deprecated for style change
    @modal-body-padding-Deprecated for style change
    @modal-header-bgheaderBg-
    @modal-header-padding-Deprecated for style change
    @modal-header-border-width-Deprecated for style change
    @modal-header-border-style-Deprecated for style change
    @modal-header-title-line-heighttitleLineHeight-
    @modal-header-title-font-sizetitleFontSize-
    @modal-header-border-color-split-Deprecated for style change
    @modal-header-close-size-Deprecated for style change
    @modal-content-bgcontentBg-
    @modal-heading-colortitleColor-
    @modal-close-colorcolorIconGlobalToken
    @modal-footer-bgfooterBg-
    @modal-footer-border-color-split-Deprecated for style change
    @modal-footer-border-style-Deprecated for style change
    @modal-footer-padding-vertical-Deprecated for style change
    @modal-footer-padding-horizontal-Deprecated for style change
    @modal-footer-border-width-Deprecated for style change
    @modal-mask-bgcolorBgMaskGlobalToken
    @modal-confirm-body-padding-Deprecated for style change
    @modal-confirm-title-font-sizetitleFontSize-
    @modal-border-radiusborderRadiusLGGlobalToken

    Pagination

    Less variablesComponent TokenNote
    @pagination-item-bgitemBg-
    @pagination-item-sizeitemSize-
    @pagination-item-size-smitemSizeSM-
    @pagination-font-familyfontFamilyGlobalToken
    @pagination-font-weight-activefontWeightStrongGlobalToken
    @pagination-item-bg-activeitemActiveBg-
    @pagination-item-link-bgitemLinkBg-
    @pagination-item-disabled-color-activeitemDisabledColorActive-
    @pagination-item-disabled-bg-activeitemDisabledBgActive-
    @pagination-item-input-bgitemInputBg-
    @pagination-mini-options-size-changer-topminiOptionsSizeChangerTop-

    Popover>

    Less variablesComponent TokenNote
    @popover-bgcolorBgContainer-
    @popover-colorcolorTextGlobalToken
    @popover-min-widthminWidth-
    @popover-min-height-Deprecated for style change
    @popover-arrow-widthsizePopupArrowGlobalToken
    @popover-arrow-color-Deprecated for style change
    @popover-arrow-outer-color-Deprecated for style change
    @popover-distancemarginXXSGlobal Token
    @popover-padding-horizontal-Deprecated for style change

    Radio

    Less variablesComponent TokenNote
    @radio-sizeradioSize-
    @radio-top-Deprecated
    @radio-border-widthlineWidthGlobal Token
    @radio-dot-sizedotSize-
    @radio-dot-color-Deprecated
    @radio-dot-disabled-colordotColorDisabled-
    @radio-solid-checked-colorbuttonSolidCheckedColor-
    @radio-button-bgbuttonBg-
    @radio-button-checked-bgbuttonCheckedBg-
    @radio-button-colorbuttonColor-
    @radio-button-hover-colorcolorPrimaryHoverGlobal Token
    @radio-button-active-colorcolorPrimaryActiveGlobal Token
    @radio-button-padding-horizontalbuttonPaddingInline-
    @radio-disabled-button-checked-bgbuttonCheckdBgDisabled-
    @radio-disabled-button-checked-colorbuttonCheckdColorDisabled-
    @radio-wrapper-margin-rightwrapperMarginInlineEnd-

    Rate

    Less variablesComponent TokenNote
    @rate-star-colorstarColor-
    @rate-star-bgstarBg-
    @rate-star-sizestarSize-
    @rate-star-hover-scalestarHoverScale-

    Result

    Less variablesComponent TokenNote
    @result-icon-font-sizeiconFontSize-
    @result-title-font-sizetitleFontSize-
    @result-subtitle-font-sizesubtitleFontSize-
    @result-extra-marginextraMargin-

    Segment

    Less variablesComponent TokenNote
    @segmented-container-paddingpadding-
    @segmented-label-coloritemColor-
    @segmented-hover-bgitemHoverBg-
    @segmented-bg-Could be customized with className or style
    @segmented-label-hover-coloritemHoverColor-
    @segmented-selected-bgitemSelectedBg-

    Skeleton

    Less variablesComponent TokenNote
    @skeleton-block-radiusblockRadius-
    @skeleton-title-heighttitleHeight-
    @skeleton-colorgradientFromColor-
    @skeleton-to-colorgradientToColor-
    @skeleton-paragraph-margin-topparagraphMarginTop-
    @skeleton-paragraph-li-heightparagraphLiHeight-
    @skeleton-paragraph-li-margin-top-Deprecated for style change

    Slider

    Less 变量Component Token备注
    @slider-margin-Could be customized with className or style
    @slider-rail-background-colorrailBg-
    @slider-rail-background-color-hoverrailHoverBg-
    @slider-track-background-colortrackBg-
    @slider-track-background-color-hovertrackHoverBg-
    @slider-handle-border-widthhandleLineWidth-
    @slider-handle-background-color-Deprecated
    @slider-handle-colorhandleColor-
    @slider-handle-color-hoverhandleActiveColor-
    @slider-handle-color-focushandleActiveColor-
    @slider-handle-color-focus-shadow- Deprecated
    @slider-handle-color-tooltip-openhandleActiveColor-
    @slider-handle-sizehandleSize-
    @slider-handle-margin-top-Deprecated
    @slider-handle-margin-left-Deprecated
    @slider-handle-shadow-Deprecated
    @slider-dot-border-colordotBorderColor-
    @slider-dot-border-color-activedotActiveBorderColor-
    @slider-disabled-colortrackBgDisabled-
    @slider-disabled-background-color-Deprecated

    Statistic

    Less variablesComponent TokenNote
    @statistic-title-font-sizetitleFontSize-
    @statistic-content-font-sizecontentFontSize-
    @statistic-font-familyfontFamilyGlobalToken

    Step

    Less variablesComponent TokenNote
    @process-tail-colorcolorSplitGlobalToken
    @steps-nav-arrow-colornavArrowColor-
    @steps-backgroundcolorBgContainer-
    @steps-icon-sizeiconSize-
    @steps-icon-custom-sizecustomIconSize-
    @steps-icon-custom-topcustomIconTop-
    @steps-icon-custom-font-sizecustomIconFontSize-
    @steps-icon-topiconTop-
    @steps-icon-font-sizeiconFontSize-
    @steps-icon-margin-Deprecated
    @steps-title-line-heighttitleLineHeight-
    @steps-small-icon-sizeiconSizeSM-
    @steps-small-icon-margin-Deprecated
    @steps-dot-sizedotSize-
    @steps-dot-top-Deprecated
    @steps-current-dot-sizedotCurrentSize-
    @steps-description-max-widthdescriptionMaxWidth-
    @steps-nav-content-max-widthstepsNavContentMaxWidth-
    @steps-vertical-icon-widthiconSize-
    @steps-vertical-tail-width-Deprecated
    @steps-vertical-tail-width-sm-Deprecated

    Tabs

    Less variablesComponent TokenNote
    @tabs-card-head-backgroundcardBg-
    @tabs-card-heightcardHeight-
    @tabs-card-active-coloritemSelectedColor-
    @tabs-card-horizontal-paddingcardPadding-
    @tabs-card-horizontal-padding-smcardPaddingSM-
    @tabs-card-horizontal-padding-lgcardPaddingLG-
    @tabs-title-font-sizetitleFontSize-
    @tabs-title-font-size-lgtitleFontSizeLG-
    @tabs-title-font-size-smtitleFontSizeSM-
    @tabs-ink-bar-colorinkBarColor-
    @tabs-bar-marginhorizontalMargin-
    @tabs-horizontal-gutterhorizontalItemGutter-
    @tabs-horizontal-marginhorizontalItemMargin-
    @tabs-horizontal-margin-rtlhorizontalItemMarginRTL-
    @tabs-horizontal-paddinghorizontalItemPadding-
    @tabs-horizontal-padding-lghorizontalItemPaddingLG-
    @tabs-horizontal-padding-smhorizontalItemPaddingSM-
    @tabs-vertical-paddingverticalItemPadding-
    @tabs-vertical-marginverticalItemMargin-
    @tabs-scrolling-size-Deprecated
    @tabs-highlight-coloritemSelectedColor-
    @tabs-hover-coloritemHoverColor-
    @tabs-active-coloritemActiveColor-
    @tabs-card-guttercardGutter-
    @tabs-card-tab-active-border-top-Deprecated

    Tag

    Less variablesComponent TokenNote
    @tag-border-radiusborderRadiusSMGlobal Token
    @tag-default-bgdefaultBg-
    @tag-default-colordefaultColor-
    @tag-font-sizefontSizeSMGlobal Token
    @tag-line-heightlineHeightSMGlobal Token

    Timeline

    Less variablesComponent TokenNote
    @timeline-widthtailWidthtailWidth is a number without units, @timeline-width with units
    @timeline-colortailColor-
    @timeline-dot-border-widthdotBorderWidth-
    @timeline-dot-color-Deprecated
    @timeline-dot-bgdotBg-
    @timeline-item-padding-bottomitemPaddingBottom-

    Tooltip

    Less variablesComponent TokenNote
    @tooltip-max-width-Can be directly modified by className or style
    @tooltip-colorcolorTextLightSolidGlobal Token
    @tooltip-bgcolorBgSpotlightGlobal Token
    @tooltip-arrow-widthsizePopupArrowGlobal Token
    @tooltip-distancemarginXXSGlobal Token
    @tooltip-arrow-color-same as @tooltip-bg,Deprecated
    @tooltip-border-radiusborderRadiusGlobal Token

    Transfer

    Less variablesComponent TokenNote
    @transfer-header-heightheaderHeight-
    @transfer-item-heightitemHeight-
    @transfer-disabled-bgcolorBgContainerDisabledGlobal Token
    @transfer-list-heightlistHeight-
    @transfer-item-hover-bgcontrolItemBgHoverGlobal Token
    @transfer-item-selected-hover-bgcontrolItemBgActiveHoverGlobal Token
    @transfer-item-padding-verticalitemPaddingBlock-
    @transfer-list-search-icon-top-Deprecated

    Typography

    Less variablesComponent TokenNote
    @typography-title-font-weightfontWeightStrongGlobal Token
    @typography-title-margin-toptitleMarginTop-
    @typography-title-margin-bottomtitleMarginBottom-

    Upload

    Less variablesComponent TokenNote
    @upload-actions-coloractionsColor-