logoNamu Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
1.0.0
  • Components Overview
  • General
    • Button
    • FloatButtonNew
    • Icon
    • Typography
  • Layout
    • Divider
    • Grid
    • Layout
    • Space
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPickerNew
    • 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
    • QRCodeNew
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • TourNew
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • AppNew
    • ConfigProvider
When To Use
Examples
Basic
Block Segmented
Basic
Controlled mode
Custom Render
Dynamic
Three sizes of Segmented
With Icon
With Icon only
API
Design Token

Segmented

  • QRCodeStatistic

    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

    Segmented Controls. This component is available since antd@4.20.0.

    When To Use

    • When displaying multiple options and user can select a single option;
    • When switching the selected option, the content of the associated area changes.

    Examples

    Basic

    The most basic usage.

    expand codeexpand code
    Basic

    Disabled Segmented.

    expand codeexpand code
    Custom Render

    Custom each Segmented Item by ReactNode.

    expand codeexpand code
    Three sizes of Segmented

    There are three sizes of an Segmented: large (40px), default (32px) and small (24px).

    expand codeexpand code
    With Icon only

    Set icon without label for Segmented Item.

    expand codeexpand code
    Block Segmented

    block property will make the Segmented fit to its parent width.

    expand codeexpand code
    Controlled mode

    Controlled Segmented.

    expand codeexpand code
    Dynamic

    Load options dynamically.

    expand codeexpand code
    With Icon

    Set icon for Segmented Item.

    expand codeexpand code

    API

    Common props ref:Common props

    This component is available since antd@4.20.0

    PropertyDescriptionTypeDefaultVersion
    blockOption to fit width to its parent's widthbooleanfalse
    defaultValueDefault selected valuestring | number
    disabledDisable all segmentsbooleanfalse
    onChangeThe callback function that is triggered when the state changesfunction(value: string | number)
    optionsSet children optionalstring[] | number[] | Array<{ label: ReactNode value: string icon? ReactNode disabled?: boolean className?: string }>[]
    sizeThe size of the Segmented.large | middle | smallmiddle
    valueCurrently selected valuestring | number

    Design Token

    Component Token

    Global Token