diff --git a/docs/content/components/slider.md b/docs/content/components/slider.md index c29c38efa..92bf57dd6 100644 --- a/docs/content/components/slider.md +++ b/docs/content/components/slider.md @@ -38,6 +38,7 @@ An input where the user selects a value from within a given range. ## Features + -import * as Slider from 'radix-vue'; - -export default () => ( - - - - - - -); ``` ## API Reference @@ -86,9 +82,9 @@ export default () => ( ### Root Contains all the parts of a slider. It will render an `input` for each thumb when used within a `form` to ensure events propagate correctly. -``` + - The reading direction of the slider. If omitted, inherits globally - from DirectionProvider or assumes LTR (left-to-right) - reading mode. - - ), + description: ' The reading direction of the slider. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. ', }, { name: 'inverted', @@ -202,17 +172,13 @@ Contains all the parts of a slider. It will render an `input` for each thumb whe required: false, type: 'number', default: '0', - description: ( - - The minimum permitted steps between multiple thumbs. - - ), + description: ' The minimum permitted steps between multiple thumbs. ', }, - ]} + ]" /> -``` + ### Track -The track that contains the `Slider.Range`. -``` +The track that contains the `SliderRange`. + -``` + ### Range -The range part. Must live inside `Slider.Track`. -``` +The range part. Must live inside `SliderTrack`. + -``` + ### Thumb A draggable thumb. You can render multiple thumbs. -``` + -``` + ## Examples ### Vertical orientation Use the `orientation` prop to create a vertical slider. -```jsx line=6 -// index.jsx -import * as Slider from 'radix-vue'; -import './styles.css'; - -export default () => ( - - - - - - -); +```vue line=11 +// index.vue + + + ``` ```css line=7,18,26 /* styles.css */ .SliderRoot { - position: relative; - display: flex; - align-items: center; + position: relative; + display: flex; + align-items: center; } -.SliderRoot[__data-orientation='vertical'__] { - flex-direction: column; - width: 20px; - height: 100px; +.SliderRoot[data-orientation="vertical"] { + flex-direction: column; + width: 20px; + height: 100px; } .SliderTrack { - position: relative; - flex-grow: 1; - background-color: grey; + position: relative; + flex-grow: 1; + background-color: grey; } -.SliderTrack[__data-orientation='vertical'__] { - width: 3px; +.SliderTrack[data-orientation="vertical"] { + width: 3px; } .SliderRange { - position: absolute; - background-color: black; + position: absolute; + background-color: black; } -.SliderRange[__data-orientation='vertical'__] { - width: 100%; +.SliderRange[data-orientation="vertical"] { + width: 100%; } .SliderThumb { - display: block; - width: 20px; - height: 20px; - background-color: black; + display: block; + width: 20px; + height: 20px; + background-color: black; } ``` @@ -378,53 +345,70 @@ export default () => ( Add multiple thumbs and values to create a range slider. -```jsx line=4,8-9 -import * as Slider from 'radix-vue'; - -export default () => ( - - - - - - - -); +```vue line=8,12-13 +// index.vue + + + ``` ### Define step size Use the `step` prop to increase the stepping interval. -```jsx line=4 -import * as Slider from 'radix-vue'; - -export default () => ( - - - - - - -); +```vue line=9 +// index.vue + + + ``` ### Prevent thumb overlap Use `minStepsBetweenThumbs` to avoid thumbs with equal values. -```jsx line=4 -import * as Slider from 'radix-vue'; - -export default () => ( - - - - - - - -); +```vue line=9-11 +// index.vue + + + ``` ## Accessibility @@ -432,74 +416,40 @@ export default () => ( Adheres to the [Slider WAI-ARIA design pattern](https://www.w3.org/WAI/ARIA/apg/patterns/slidertwothumb). ### Keyboard Interactions -``` + -``` + + + +Ï