EN
Getting started
59 · Forms

Option cards

Turns a radio button or checkbox into a clickable card with a title, a description and an icon. Suited to a small number of options that need explaining.

PRO acun:option-card
01

Single choice

The default type is radio. Give the cards in the same group the same name and each a different value; mark the initially selected one with checked. The whole card is clickable and the selected card is highlighted.

LIVE EXAMPLE
<div class="grid gap-3 md:grid-cols-3">
    <acun:option-card name="billing_period" value="monthly" title="Monthly" description="Renews every month" />
    <acun:option-card name="billing_period" value="yearly" title="Yearly" description="Two months free" checked />
    <acun:option-card name="billing_period" value="lifetime" title="Lifetime" description="One-time payment" />
</div>
PropValues
typeradio | checkbox
nameGroup name
valueSubmitted value
checkedInitially selected
02

With icons

icon adds an acun:icon to the right of the title. The icon starts gray and turns to the brand color when the card is selected. Use it to convey the difference between the options at a glance.

LIVE EXAMPLE
<div class="grid gap-3 md:grid-cols-3">
    <acun:option-card name="shipping_method" value="standard" title="Standard shipping" description="Delivered in 2–4 business days" icon="truck" checked />
    <acun:option-card name="shipping_method" value="express" title="Express shipping" description="At your door the next day" icon="bolt" />
    <acun:option-card name="shipping_method" value="pickup" title="Store pickup" description="Collect it at your nearest branch" icon="building-storefront" />
</div>
PropValues
iconacun:icon name
03

Multiple choice

With type="checkbox", more than one card can be selected. In a classic form, add [] to the end of the name so the values are submitted as an array.

LIVE EXAMPLE
<div class="grid gap-3 md:grid-cols-2">
    <acun:option-card type="checkbox" name="notifications[]" value="sms" title="SMS" description="Shipping status updates" checked />
    <acun:option-card type="checkbox" name="notifications[]" value="email" title="Email" description="Monthly summary" />
</div>
PropValues
typecheckbox
04

Rich description

If description is not given, the content you write inside the card is shown as the description. Use it for parts that need emphasis, such as an amount.

LIVE EXAMPLE
<div class="grid gap-3 md:grid-cols-2">
    <acun:option-card name="plan" value="starter" title="Starter" checked>
        <strong class="text-gray-900 dark:text-zinc-100">₺1,250</strong> per month, up to 5 users
    </acun:option-card>
    <acun:option-card name="plan" value="pro" title="Professional">
        <strong class="text-gray-900 dark:text-zinc-100">₺2,000</strong> per month plus priority support
    </acun:option-card>
</div>
PropValues
descriptionPlain-text description
(slot)Content shown when there is no description
05

Disabled option

The disabled attribute is passed to the inner field; the card is dimmed and cannot be selected. Suited to options that are not available right now but whose existence you want to show.

LIVE EXAMPLE
<div class="grid gap-3 md:grid-cols-2">
    <acun:option-card name="payment" value="card" title="Credit card" description="Pay in full or in installments" checked />
    <acun:option-card name="payment" value="cod" title="Cash on delivery" description="Not available in this region" disabled />
</div>
PropValues
disabledCannot be selected and looks dimmed
06

With Livewire

If you give only wire:model, the group name and the card ids are generated from that property. Checkbox cards bind to an array property.

BLADE
@foreach (['standard' => 'Standard shipping', 'express' => 'Express shipping', 'pickup' => 'Store pickup'] as $value => $label)
    <acun:option-card wire:model.live="shippingMethod" :value="$value" :title="$label" />
@endforeach

<acun:option-card type="checkbox" wire:model="channels" value="sms" title="SMS" />
PropValues
wire:modelRadio: a single value · checkbox: an array
API

Props and slots

The values the component accepts.

PropDefaultDescription
title — Card title (required)
descriptionnullDescription below the title; otherwise the slot content
typeradioradio · checkbox
namenullGroup name; otherwise the wire:model value
valuenullValue submitted when selected
checkedfalseInitially selected
iconnullacun:icon name to the right of the title; in the brand color when the card is selected
Slots: Default slot: shown as the description when description is not given. Other attributes such as disabled and required are added to the inner input.
Acun UI · Option cardsDetailed usage and examples