react-code-dataset / wp-calypso /client /devdocs /design /wordpress-components-gallery /radio-control.tsx
react-code-dataset / wp-calypso /client /devdocs /design /wordpress-components-gallery /radio-control.tsx
Download wp-calypso/client/devdocs/design/wordpress-components-gallery/radio-control.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 537 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/devdocs/design/wordpress-components-gallery/radio-control.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/devdocs/design/wordpress-components-gallery/radio-control.tsx
-
curl -L -o radio-control.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/devdocs/design/wordpress-components-gallery/radio-control.tsx
537 Bytes
| import { RadioControl } from '@wordpress/components'; | |
| import { useState } from 'react'; | |
| const options = [ | |
| { label: 'Public', value: 'public' }, | |
| { label: 'Private', value: 'private' }, | |
| { label: 'Password Protected', value: 'password' }, | |
| ]; | |
| const RadioExample = () => { | |
| const [ option, setOption ] = useState( 'public' ); | |
| return ( | |
| <RadioControl | |
| label="Post visibility" | |
| help="Help text for this radio control" | |
| options={ options } | |
| selected={ option } | |
| onChange={ setOption } | |
| /> | |
| ); | |
| }; | |
| export default RadioExample; | |