--- order: 5 title: zh-CN: 带标签的滑块 en-US: Graduated slider --- ## zh-CN 使用 `marks` 属性标注分段式滑块,使用 `value` / `defaultValue` 指定滑块位置。当 `included=false` 时,表明不同标记间为并列关系。当 `step=null` 时,Slider 的可选值仅有 `marks` 标出来的部分。 ## en-US 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. ```tsx import React from 'react'; import { Slider } from 'antd'; import type { SliderMarks } from 'antd/lib/slider'; const marks: SliderMarks = { 0: '0°C', 26: '26°C', 37: '37°C', 100: { style: { color: '#f50', }, label: 100°C, }, }; const App: React.FC = () => ( <>

included=true

included=false

marks & step

step=null

); export default App; ```