|
Download wp-calypso/client/components/forms/range/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/range/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/forms/range/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/range/README.md
1.21 kB
| # Range | |
| Range is a React component used to render a range input field. It is essentially an enhanced version of `<input type="range" />`, enabling support for a value tooltip and content to be shown at the ends of the range field. | |
|  | |
| ## Usage | |
| Refer to the following code snippet for a typical usage example: | |
| ```jsx | |
| <Range | |
| minContent={ <Gridicon icon="minus-small" /> } | |
| maxContent={ <Gridicon icon="plus-small" /> } | |
| max="100" | |
| value={ this.state.rangeValue } | |
| onChange={ this.onChange } | |
| showValueLabel | |
| />; | |
| ``` | |
| The Range component does not track its own value state, much like any other form input in React. Refer to the <a href="http://facebook.github.io/react/docs/forms.html">React Forms documentation</a> for more guidance on tracking form value state. | |
| ## Props | |
| Props not listed below will be passed automatically to the rendered range input element. | |
| ### `minContent` (`string` or `Element`) | |
| Content to be shown preceding the range input. | |
| ### `maxContent` (`string` or `Element`) | |
| Content to be shown following the range input. | |
| ### `showValueLabel` (`boolean`) | |
| A boolean indicating whether a tooltip is to be shown with the current range value. | |