v0.0.2
Demos (demo panel, opens in a new tab)

Card and tabs

Uses a card and tabs together to show the different parts of a record in a single card.

zb:card · zb:tabs zubazar/ui · free (MIT)

Card with tabs

Card with tabs: view
BLADE

Put zb:tabs in the body of the card; each zb:tab-panel takes its key from the tabs array as value.

blade
<zb:card title="Customer summary">
    <zb:slot:actions><zb:button variant="ghost" size="sm">Edit</zb:button></zb:slot:actions>

    <zb:tabs :tabs="['info' => 'Info', 'orders' => 'Orders', 'documents' => 'Documents']">
        <zb:tab-panel value="info"><p class="text-sm text-dim">Premium member · Istanbul</p></zb:tab-panel>
        <zb:tab-panel value="orders"><zb:progress :value="75" label="Annual target" /></zb:tab-panel>
        <zb:tab-panel value="documents"><zb:empty-state title="No documents" /></zb:tab-panel>
    </zb:tabs>
</zb:card>
PropValues
tabsArray of key => title
tab-panel valueKey of the tab

Starting tab and pill style

Starting tab and pill style: view
BLADE

Pick the starting tab with active; variant="pills" renders the tabs as filled buttons.

blade
<zb:card title="Kadıköy store" subtitle="KDK-04 · 148 orders">
    <zb:tabs variant="pills" active="orders" :tabs="['general' => 'General', 'orders' => 'Orders', 'team' => 'Team']">
        <zb:tab-panel value="general"><p class="text-sm text-dim">Store · 14 employees</p></zb:tab-panel>
        <zb:tab-panel value="orders"><p class="text-sm text-dim">112 orders shipped this month, 36 waiting.</p></zb:tab-panel>
        <zb:tab-panel value="team"><p class="text-sm text-dim">Ayşe Yılmaz, Mehmet Kaya</p></zb:tab-panel>
    </zb:tabs>
</zb:card>
PropValues
activeKey of the starting tab
variantunderline | pills

Props

The values the component takes. What are props and slots?

PropTypeDefaultDescription
card: title, subtitle—nullTitle and the small text below it
card: collapsible, closablebooleanfalseCollapse and close buttons
card: paddingbooleantruefalse: the content touches the edges
tabs: tabs—[]key => title
tabs: active—first keyStarting tab
tabs: variant—underlineunderline · pills
tab-panel: value— — Required. Key of the tab

Slots: card: actions, footer, default content · tabs: zb:tab-panel items.

Developer notes

Events, hooks and details
  • Switching tabs happens in the browser; no request goes to the server.
  • All the options of each component are described on its own page (Basic card, Tabs).
Zubazar UI · ZubazarDesigned for people.