Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
A simple 2 button toggle to switch. Usually used to switch the type of layout to be shown on
a SearchResults
widget.
Property Name | Description | Type | Required |
---|---|---|---|
onToggle | Toggle value handler | (newValue: string) => void | true |
defaultCardView | Default value for the component. | Possible values: grid , list | true |
GridIcon | Icon for the grid view | React.FC | true |
ListIcon | Icon for the list view | React.FC | true |
import { GridIcon, ListBulletIcon } from '@radix-ui/react-icons';
import CardViewSwitcher from '@/components/CardViewSwitcher';
...
<CardViewSwitcher
onToggle={(value) => { console.log(value)}}
defaultCardView={'list'}
GridIcon={GridIcon}
ListIcon={ListBulletIcon}
/>
npx sc-search new-component -w -s styled -l typescript -n CardViewSwitcher -o <destination/path>