react-code-dataset / wp-calypso /client /devdocs /design /wordpress-components-gallery /toggle-control.tsx
react-code-dataset / wp-calypso /client /devdocs /design /wordpress-components-gallery /toggle-control.tsx
Download wp-calypso/client/devdocs/design/wordpress-components-gallery/toggle-control.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 475 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/devdocs/design/wordpress-components-gallery/toggle-control.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/devdocs/design/wordpress-components-gallery/toggle-control.tsx
-
curl -L -o toggle-control.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/devdocs/design/wordpress-components-gallery/toggle-control.tsx
475 Bytes
| import { ToggleControl } from '@wordpress/components'; | |
| import { useState } from 'react'; | |
| const ToggleControlExample = () => { | |
| const [ hasFixedBackground, setHasFixedBackground ] = useState( true ); | |
| return ( | |
| <ToggleControl | |
| label="Does this have a fixed background?" | |
| help={ hasFixedBackground ? 'Has fixed background' : 'No fixed background' } | |
| checked={ hasFixedBackground } | |
| onChange={ setHasFixedBackground } | |
| /> | |
| ); | |
| }; | |
| export default ToggleControlExample; | |