<VerticalTab label="Some Text" />
Prop | Type | Default | Description |
---|---|---|---|
label | string | Text to display within the tab | |
onClick | () => void | function that is called when the tab is clicked | |
selected | boolean | Whether this tab is selected | |
expanded | boolean | if defined and VerticalTab has children, then tab expansoin will be controlled by this | |
data-testid | string | data-testid added to the root element of the component as {data-testid} | |
onChange | func | Callback fired when the expand/collapse state is changed. Signature: function(event: React.SyntheticEvent, expanded: boolean) => void event: The event source of the callback. Warning: This is a generic event not a change event. expanded: The expanded state of the accordion | |
adminColor | bool | false | If true, semantic blue color is considered as primary color |
labelVariant | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'subtitle1' | 'subtitle2' | 'body1' | 'body2' | 'caption' | 'button' | 'overline' | 'srOnly' | 'inherit' | 'body1' | Applies the theme typography styles. |
<div><VerticalTab label="First Tab" /><VerticalTab label="Second Tab" /></div>
() => {const [selected, setSelected] = React.useState(0);return (<div style={{ width: 240 }}><VerticalTab label="Vertical Nav 1"><VerticalTablabel="Nav 6"onClick={() => setSelected(6)}selected={selected === 6}/><VerticalTab label="Vertical Nav 2"><VerticalTablabel="Nav 1"onClick={() => setSelected(1)}selected={selected === 1}/><VerticalTablabel="Nav 2"onClick={() => setSelected(2)}selected={selected === 2}/><VerticalTablabel="Nav 3"onClick={() => setSelected(3)}selected={selected === 3}/></VerticalTab><VerticalTablabel="Nav 4"onClick={() => setSelected(4)}selected={selected === 4}/></VerticalTab><VerticalTablabel="Nav 5"onClick={() => setSelected(5)}selected={selected === 5}/></div>);};