CardViewSwitcher
This topic describes the anatomy, API reference, and variations of the CardViewSwitcher primitive component.
Anatomy
import { CardViewSwitcher } from '@sitecore-search/ui';
const MyCardViewSwitcher = () => (
<CardViewSwitcher.Root>
<CardViewSwitcher.Item value="grid">
Use icon or text as children
</CardViewSwitcher.Item>
<CardViewSwitcher.Item value="list">
Use icon or text as children
</CardViewSwitcher.Item>
</CardViewSwitcher.Root>
);Using the component
The following tabs describe use of the CardViewSwitcher primitive component.
API reference
CardViewSwitcher.Root
The CardViewSwitcher.Root component contains all the components of the card view switcher.
Children: CardViewSwitcher.Item
|
Name |
Description |
Default |
|---|---|---|
|
|
Event handler called when any item is clicked. RequestResponse | |
|
|
String. The controlled stateful value of the item that is pressed. list or grid |
grid |
CardViewSwitcher.Item
The CardViewSwitcher.Item component is an item in the group.
Parent: CardViewSwitcher.Root
|
Name |
Description |
Default |
|---|---|---|
|
|
String. Card value type. list or grid |
grid |
|
|
Content to be displayed. |
