EN
Getting started
19 · Cards

Card and tabs

Using two components together to show different aspects of a record in a single card with tabs. All the options of each component are described on its own page (Basic card, Tabs).

PRO acun:card · acun:tabs
01

Card with tabs

Put the acun:tabs component in the body of the card. The tabs are rendered from the tabs array (key => title), and each acun:tab-panel takes the same key as value. Switching happens in the browser; no request goes to the server.

LIVE EXAMPLE
<acun:card title="Customer summary">
    <acun:slot:actions><acun:button variant="ghost" size="sm">Edit</acun:button></acun:slot:actions>

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

Starting tab and pill style

When the page opens, the first tab is selected; to start with another tab, give its key with active. variant="pills" renders the tabs as filled buttons.

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

Props and slots

The values the component accepts.

PropDefaultDescription
card: title, subtitlenullTitle and the small text below it
card: collapsible, closablefalseCollapse and close buttons
card: paddingtruefalse: the content touches the edges
tabs: tabs[]key => title
tabs: activefirst keyStarting tab
tabs: variantunderlineunderline · pills
tab-panel: value — Required. Key of the tab
Slots: card: actions, footer, default content · tabs: acun:tab-panel items.
Acun UI · Card and tabsDetailed usage and examples