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
Slider with InputNumber
Slider with icon
Customize tooltip
Event
Graduated slider
Vertical
Control visible of ToolTip
Reverse
Draggable track
API
range
tooltip
Methods
Design Token

Slider

  • SelectSwitch

    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

    A Slider component for displaying current value and intervals in range.

    When To Use

    To input a value in a range.

    Examples

    Basic

    Basic slider. When range is true, display as dual thumb mode. When disable is true, the slider will not be interactable.

    expand codeexpand code
    Slider with icon

    You can add an icon beside the slider to make it meaningful.

    expand codeexpand code
    Event

    The onChange callback function will fire when the user changes the slider's value. The onAfterChange callback function will fire when onmouseup fired.

    expand codeexpand code
    Vertical

    The vertical Slider.

    expand codeexpand code
    Reverse

    Using reverse to render slider reversely.

    expand codeexpand code
    Slider with InputNumber

    Synchronize with InputNumber component.

    expand codeexpand code
    Customize tooltip

    Use tooltip.formatter to format content of Tooltip. If tooltip.formatter is null, hide it.

    expand codeexpand code
    Graduated slider

    Using marks property to mark a graduated slider, use value or defaultValue to specify the position of thumb. When included is false, means that different thumbs are coordinative. when step is null, users can only slide the thumbs onto marks.

    expand codeexpand code
    Control visible of ToolTip

    When tooltip.open is true, ToolTip will always show, or ToolTip will not show anyway, even if dragging or hovering.

    expand codeexpand code
    Draggable track

    Make range track draggable when set range.draggableTrack.

    expand codeexpand code

    API

    Common props ref:Common props

    PropertyDescriptionTypeDefaultVersion
    autoAdjustOverflowWhether to automatically adjust the popup positionbooleantrue5.8.0
    autoFocusWhether get focus when component mountedbooleanfalse
    defaultValueThe default value of slider. When range is false, use number, otherwise, use [number, number]number | [number, number]0 | [0, 0]
    disabledIf true, the slider will not be intractablebooleanfalse
    keyboardSupport using keyboard to move handlersbooleantrue5.2.0+
    dotsWhether the thumb can drag over tick onlybooleanfalse
    includedMake effect when marks not null, true means containment and false means coordinativebooleantrue
    marksTick mark of Slider, type of key must be number, and must in closed interval [min, max], each mark can declare its own styleobject{ number: ReactNode } | { number: { style: CSSProperties, label: ReactNode } }
    maxThe maximum value the slider can slide tonumber100
    minThe minimum value the slider can slide tonumber0
    rangeDual thumb modebooleanfalse
    reverseReverse the componentbooleanfalse
    stepThe granularity the slider can step through values. Must greater than 0, and be divided by (max - min) . When marks no null, step can be nullnumber | null1
    tooltipThe tooltip relate propstooltip-4.23.0
    valueThe value of slider. When range is false, use number, otherwise, use [number, number]number | [number, number]-
    verticalIf true, the slider will be verticalbooleanfalse
    onAfterChangeFire when onmouseup is fired(value) => void-
    onChangeCallback function that is fired when the user changes the slider's value(value) => void-
    trackStyleThe style of slider track (the active range)CSSProperties-
    railStyleThe style of slider rail (the background)CSSProperties-
    handleStyleThe style of slider handleCSSProperties-

    range

    PropertyDescriptionTypeDefaultVersion
    draggableTrackWhether range track can be dragbooleanfalse4.10.0

    tooltip

    PropertyDescriptionTypeDefaultVersion
    openIf true, Tooltip will show always, or it will not show anyway, even if dragging or hoveringboolean-4.23.0
    placementSet Tooltip display position. Ref Tooltipstring-4.23.0
    getPopupContainerThe DOM container of the Tooltip, the default behavior is to create a div element in body(triggerNode) => HTMLElement() => document.body4.23.0
    formatterSlider will pass its value to formatter, and display its value in Tooltip, and hide Tooltip when return value is nullvalue => ReactNode | nullIDENTITY4.23.0

    Methods

    NameDescriptionVersion
    blur()Remove focus
    focus()Get focus

    Design Token

    Component Token

    Global Token

    Disabled:
    0°C26°C37°C100°C
    Reversed:

    included=true

    0°C26°C37°C100°C
    0°C26°C37°C100°C

    included=false

    0°C26°C37°C100°C

    marks & step

    0°C26°C37°C100°C

    step=null

    0°C26°C37°C100°C