File size: 537 Bytes
1e92f2d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
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;
|