-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add info about
Slider
React component (#120)
* docs: add info about `Slider` React component * remove direction very new but not very useful * correct usage example
- Loading branch information
1 parent
edcb2b6
commit f47a61f
Showing
3 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
docs/development/api-wrapper/types/react-component/slider-props.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
title: SliderProps | ||
description: Type definition for props of ReactComponent.PanelSkeleton. | ||
--- | ||
|
||
The `SliderProps` object is used to render a slider. | ||
|
||
:::note | ||
|
||
This type is deducted from Spotify's internal usage. It may not be accurate and may change in the future. | ||
|
||
::: | ||
|
||
```ts | ||
type SliderProps = { | ||
value: number; | ||
max: number; | ||
step: number; | ||
labelText?: string; | ||
isInteractive?: boolean; | ||
forceActiveStyles?: boolean; | ||
onDragStart: (value: number) => void; | ||
onDragMove: (value: number) => void; | ||
onDragEnd: (value: number) => void; | ||
onStepForward?: (value: number) => void; | ||
onStepBackward?: (value: number) => void; | ||
} | ||
``` | ||
#### Properties | ||
| Property | Type | Description | | ||
| :--- | :--- | :--- | | ||
| value | `number` | The current value of the slider. | | ||
| max | `number` | The maximum value the slider can have. | | ||
| step | `number` | The increment/decrement value when the slider is moved. | | ||
| labelText | `string` | `undefined` | The label text displayed for the slider. | | ||
| isInteractive | `boolean` | `undefined` | Determines if the slider is interactive. | | ||
| forceActiveStyles | `boolean` | `undefined` | Forces the active styles regardless of interaction state. | | ||
| onDragStart | `(value: number) => void` | Callback function when dragging starts. | | ||
| onDragMove | `(value: number) => void` | Callback function when the slider is being dragged. | | ||
| onDragEnd | `(value: number) => void` | Callback function when dragging ends. | | ||
| onStepForward | `(value: number) => void` | `undefined` | Callback function when the slider steps forward. **Deprecated.** | | ||
| onStepBackward | `(value: number) => void` | `undefined` | Callback function when the slider steps backward. **Deprecated.** | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters