qat

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.

Example.qx18 lines, 1 reactive nameOpen in the playground
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 state

Add it

shell1 line
npx qatjs add tabs

Tabs

As a custom element: <ui-tabs>.

Tabs: props
PropTypeAttribute
itemsTabItem[]property only
valuestringyes
labelstringyes
variant'underline' | 'enclosed'yes
Tabs: events
EventDetail
on:update:valueCustomEvent<string>

Keys

KeyDoes
← →choose
Home, Endjump
Tabone stop, then the panel