Tabs
Tabs. It is copied into your app’s ui/ by qatjs add tabs: the code is yours to edit.
Example
The details of order 10482.
import Tabs from './ui/tabs/tabs.qx'
export default function Example() {
let tab = state('details')
return (
<Tabs
label="Order"
items={[
{ id: 'details', label: 'Details' },
{ id: 'history', label: 'History', count: 3 },
{ id: 'notes', label: 'Notes' },
]}
bind:value={tab}
>
{(id) => <p>The {id} of order 10482.</p>}
</Tabs>
)
}tab stateAdd it
npx qatjs add tabsTabs
As a custom element: <ui-tabs>.
| Prop | Type | Attribute |
|---|---|---|
items | TabItem[] | property only |
value | string | yes |
label | string | yes |
variant | 'underline' | 'enclosed' | yes |
| Event | Detail |
|---|---|
on:update:value | CustomEvent<string> |
Keys
| Key | Does |
|---|---|
| ← → | choose |
| Home, End | jump |
| Tab | one stop, then the panel |