This feature is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
ToggleGroupControlOption is a form component and is meant to be used as a child of ToggleGroupControl.
Usage
import {
__experimentalToggleGroupControl as ToggleGroupControl,
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
} from '@wordpress/components';
function Example() {
return (
<ToggleGroupControl label="my label" value="vertical" isBlock>
<ToggleGroupControlOption
value="horizontal"
label="Horizontal"
showTooltip={ true }
/>
<ToggleGroupControlOption value="vertical" label="Vertical" />
</ToggleGroupControl>
);
}
Props
label: string
Label for the option. If needed, the