@@ -3,7 +3,7 @@ title: Qwik UI | Tabs
33---
44
55import { Tab , TabList , TabPanel , Tabs } from ' @qwik-ui/headless' ;
6- import { Example01 } from ' ./examples' ;
6+ import { Example01 , VerticalTabsExample } from ' ./examples' ;
77import { CodeExample } from ' ../../../../../components/code-example/code-example' ;
88import { KeyboardInteractionTable } from ' ../../../../../components/keyboard-interaction-table/keyboard-interaction-table' ;
99import { APITable } from ' ../../../../../components/api-table/api-table' ;
@@ -80,6 +80,34 @@ import { APITable } from '../../../../../components/api-table/api-table';
8080
8181 </CodeExample >
8282
83+ ## Vertical
84+
85+ by default, the tabs are horizontal, but you can adjust the underlying behavior to be vertical by setting the ` vertical ` prop to true.
86+
87+ <VerticalTabsExample >
88+ ``` tsx
89+ <Tabs vertical >
90+ <h3 id = " tablist-1" >Danish Composers</h3 >
91+ <TabList >
92+ <Tab >Maria Ahlefeldt</Tab >
93+ <Tab >Carl Andersen</Tab >
94+ <Tab >Ida Henriette da Fonseca</Tab >
95+ </TabList >
96+ <TabPanel >
97+ <p >
98+ Maria Theresia Ahlefeldt (16 January 1755 – 20 December 1810) was a ...
99+ </p >
100+ </TabPanel >
101+ <TabPanel >
102+ <p >Carl Joachim Andersen (29 April 1847 – 7 May 1909) was a ...</p >
103+ </TabPanel >
104+ <TabPanel >
105+ <p >Ida Henriette da Fonseca (July 27, 1802 – July 6, 1858) was a ...</p >
106+ </TabPanel >
107+ </Tabs >
108+ ```
109+ </VerticalTabsExample >
110+
83111## Accessibility
84112
85113### Keyboard interaction
@@ -111,7 +139,6 @@ import { APITable } from '../../../../../components/api-table/api-table';
111139 description: ' In "vertical mode", moves focus to the previous tab.' ,
112140 },
113141 {
114- /* {
115142 keyTitle: ' Home' ,
116143 description: ' Moves focus to the first tab.' ,
117144 },
@@ -126,7 +153,6 @@ import { APITable } from '../../../../../components/api-table/api-table';
126153 {
127154 keyTitle: ' PageDown' ,
128155 description: ' Moves focus to the first tab.' ,
129- }, */
130156 },
131157 ]}
132158/>
@@ -143,24 +169,22 @@ import { APITable } from '../../../../../components/api-table/api-table';
143169 description:
144170 ' Toggle between automatic or manual. The automatic behavior moves between tabs when hover. The manual behavior moves between tabs on click.' ,
145171 },
172+ {
173+ name: ' selectedIndex' ,
174+ type: ' number' ,
175+ description: ' A way to set the selected index programmatically' ,
176+ },
146177 {
147178 name: ' vertical' ,
148179 type: ' boolean' ,
149180 description:
150181 ' If set to true, the behavior of UpArrow and DownArrow will navigate between tabs vertically instead of horizontally.' ,
151182 },
152- ]}
153- />
154-
155- ### TabList
156-
157- <APITable
158- propDescriptors = { [
159183 {
160- name: ' labelledBy ' ,
161- type: ' string ' ,
184+ name: ' onSelectedIndexChange$ ' ,
185+ type: ' (index: number) => void ' ,
162186 description:
163- ' The aria-labelledby for this tablist. Mainly for accessibility purpose. ' ,
187+ ' An event hook that getting notified whenever the selected index changes ' ,
164188 },
165189 ]}
166190/>
@@ -176,8 +200,13 @@ import { APITable } from '../../../../../components/api-table/api-table';
176200 },
177201 {
178202 name: ' onClick' ,
179- type: ' PropFunction<( ) => void> ' ,
203+ type: ' (event: QwikMouseEvent ) => void' ,
180204 description: ' A custom click handler to wire to tab click event' ,
181205 },
206+ {
207+ name: ' disabled' ,
208+ type: ' boolean' ,
209+ description: ' Set the disabled state of a specific tab' ,
210+ },
182211 ]}
183212/>
0 commit comments