EN
Getting started
15 · Cards

Basic card

Groups content on a white surface, together with a header, an actions area and a footer. It is the basic container for summaries, lists and forms in dashboards, and it can be collapsed and closed.

acun:card
01

Basic usage

title and subtitle make up the card header; both are optional. Content goes in the default slot and is shown in a padded body.

LIVE EXAMPLE
<acun:card title="Kadıköy warehouse" subtitle="IST-04 · 148 orders">
    <p class="text-sm text-gray-600 dark:text-zinc-400">112 orders shipped this month; 36 orders are waiting.</p>
</acun:card>
PropValues
titleCard title
subtitleShort description below the title
03

Equal-height cards

acun:card is a vertical flex box, and its body fills the remaining height (flex-1). When cards side by side in a grid stretch to the same height, their footers stay aligned even if the body texts differ in length; no extra class is needed.

LIVE EXAMPLE
<div class="grid gap-4 md:grid-cols-3">
    <acun:card title="Kadıköy warehouse" subtitle="148 orders">
        <p class="text-sm text-gray-600 dark:text-zinc-400">36 orders are waiting to ship.</p>
        <acun:slot:footer><acun:button size="sm" variant="ghost">Show orders</acun:button></acun:slot:footer>
    </acun:card>

    <acun:card title="Ankara warehouse" subtitle="205 orders">
        <p class="text-sm text-gray-600 dark:text-zinc-400">198 orders shipped this month. Because of the new carrier contract, Thursday pickups start two hours early; warehouse teams need to update their packing plans accordingly.</p>
        <acun:slot:footer><acun:button size="sm" variant="ghost">Show orders</acun:button></acun:slot:footer>
    </acun:card>

    <acun:card title="Izmir warehouse" subtitle="64 orders">
        <p class="text-sm text-gray-600 dark:text-zinc-400">All orders have shipped.</p>
        <acun:slot:footer><acun:button size="sm" variant="ghost">Show orders</acun:button></acun:slot:footer>
    </acun:card>
</div>
04

Header actions

The actions slot sits to the right of the header; you can put a badge, a small button or a dropdown there. Examples with dropdowns are on the Cards with actions page.

LIVE EXAMPLE
<acun:card title="Open tickets" subtitle="38 tickets">
    <acun:slot:actions>
        <acun:badge variant="success">Up to date</acun:badge>
        <acun:button size="sm" variant="ghost">All</acun:button>
    </acun:slot:actions>
    <p class="text-sm text-gray-600 dark:text-zinc-400">12 tickets are awaiting a reply today; 3 tickets are resolved.</p>
</acun:card>
PropValues
actionsSlot; right of the header
05

Collapsing and closing

collapsible adds an arrow to the header that collapses the body, and closable adds an X that hides the card. Both work only in the browser; when the page is reloaded, the card is open again.

LIVE EXAMPLE
<div class="grid gap-4 md:grid-cols-2">
    <acun:card title="Shipping notes" collapsible>
        <p class="text-sm text-gray-600 dark:text-zinc-400">Carriers are busy on the Anatolian side on Tuesdays; deliveries may be a day late.</p>
    </acun:card>

    <acun:card title="Announcement" closable>
        <p class="text-sm text-gray-600 dark:text-zinc-400">The October sale starts on Monday, October 7. The support team should review the new return policy.</p>
    </acun:card>
</div>
PropValues
collapsibletrue | false
closabletrue | false
06

Without padding

:padding="false" removes the body padding; tables and lists reach the edges of the card. For a list, use acun:list-group together with flush.

LIVE EXAMPLE
<acun:card title="Recent orders" :padding="false">
    <acun:list-group flush>
        <acun:list-group.item>Ayşe Yılmaz · Wireless headphones <span class="ms-auto text-xs text-gray-500 dark:text-zinc-400">09:42</span></acun:list-group.item>
        <acun:list-group.item>Mehmet Kaya · Smart watch <span class="ms-auto text-xs text-gray-500 dark:text-zinc-400">09:17</span></acun:list-group.item>
        <acun:list-group.item>Zeynep Arslan · Laptop bag <span class="ms-auto text-xs text-gray-500 dark:text-zinc-400">08:55</span></acun:list-group.item>
    </acun:list-group>
</acun:card>
PropValues
paddingtrue | false
07

Free-form content

Without a title, you can use the card as a free-form surface; welcome and summary cards are built this way.

LIVE EXAMPLE
<acun:card>
    <div class="flex flex-wrap items-center justify-between gap-6">
        <div class="max-w-md">
            <h3 class="text-lg font-semibold text-brand-600 dark:text-brand-400">Good morning, Ayşe 👋</h3>
            <p class="mt-2 text-sm text-gray-600 dark:text-zinc-400">214 orders came in yesterday, 18% more than last week's average.</p>
            <acun:button size="sm" variant="outline" class="mt-4">Open sales report</acun:button>
        </div>
        <acun:icon name="shopping-bag" size="24" stroke="1.2" class="text-brand-200 dark:text-brand-500/30" />
    </div>
</acun:card>
08

Composing from parts

If the header needs more than text (an icon, a badge, action buttons), or the body and footer need their own styling, write the card with the acun:card.header, acun:card.body and acun:card.footer parts. When the content starts with a part, the card draws only its box; the collapse and close buttons still appear in the header. If you give the header no title, the slot is the title itself. Give :collapsible="false" to a composed card that you place inside a collapsible card; otherwise the inner header shows the outer card's buttons.

LIVE EXAMPLE
<acun:card collapsible>
    <acun:card.header subtitle="486 packages today · 3 carriers">
        <acun:icon name="truck" size="4" class="text-brand-600 dark:text-brand-400" />
        Shipment tracking
        <acun:badge variant="success">Live</acun:badge>

        <acun:slot:actions>
            <acun:button size="sm" variant="white">
                <acun:icon name="arrow-path" size="4" /> Refresh
            </acun:button>
        </acun:slot:actions>
    </acun:card.header>

    <acun:card.body>
        <dl class="grid grid-cols-3 gap-4 text-sm">
            <div>
                <dt class="text-gray-500 dark:text-zinc-400">Delivered</dt>
                <dd class="mt-1 text-lg font-semibold tabular-nums text-gray-900 dark:text-zinc-100">312</dd>
            </div>
            <div>
                <dt class="text-gray-500 dark:text-zinc-400">In transit</dt>
                <dd class="mt-1 text-lg font-semibold tabular-nums text-gray-900 dark:text-zinc-100">158</dd>
            </div>
            <div>
                <dt class="text-gray-500 dark:text-zinc-400">Late</dt>
                <dd class="mt-1 text-lg font-semibold tabular-nums text-red-600 dark:text-red-400">16</dd>
            </div>
        </dl>
    </acun:card.body>

    <acun:card.footer>
        <span class="text-xs text-gray-500 dark:text-zinc-400">Last updated 09:42</span>
        <acun:button size="sm" variant="soft" class="ms-auto">Go to shipping report</acun:button>
    </acun:card.footer>
</acun:card>
PropValues
acun:card.headertitle, subtitle; slot: header content · actions slot
acun:card.bodypadding (default true)
acun:card.footerFooter
09

Header with a badge, edge-to-edge body

A slot given together with title is appended to the header (e.g. a count badge). :padding="false" opens the body up to the edges; it suits lists and tables.

LIVE EXAMPLE
<acun:card>
    <acun:card.header title="Support team">
        <acun:badge>8 people</acun:badge>
    </acun:card.header>

    <acun:card.body :padding="false">
        <ul class="divide-y divide-gray-100 border-t border-gray-100 text-sm dark:divide-zinc-800 dark:border-zinc-800">
            <li class="flex items-center justify-between gap-3 px-5 py-3">
                <span class="font-medium text-gray-900 dark:text-zinc-100">Ahmet Yılmaz</span>
                <span class="text-gray-500 dark:text-zinc-400">Billing · 42 tickets</span>
            </li>
            <li class="flex items-center justify-between gap-3 px-5 py-3">
                <span class="font-medium text-gray-900 dark:text-zinc-100">Elif Kaya</span>
                <span class="text-gray-500 dark:text-zinc-400">Technical support · 37 tickets</span>
            </li>
            <li class="flex items-center justify-between gap-3 px-5 py-3">
                <span class="font-medium text-gray-900 dark:text-zinc-100">Murat Demir</span>
                <span class="text-gray-500 dark:text-zinc-400">Shipping and returns · 51 tickets</span>
            </li>
        </ul>
    </acun:card.body>
</acun:card>
API

Props and slots

The values the component accepts.

PropDefaultDescription
titlenullCard title
subtitlenullDescription below the title
collapsiblefalseButton that collapses the body
closablefalseButton that hides the card
paddingtruefalse: body without padding (tables, lists)
card.header: title · subtitlenullTitle and secondary line; without title, the slot is the title itself (icon, text, badge)
card.body: paddingtruefalse: body without padding
Slots: actions (right of the header), footer (footer), default content (body) · Composed: acun:card.header (actions slot), acun:card.body, acun:card.footer
Acun UI · Basic cardDetailed usage and examples