1. First
  2. Second
  3. Third

Card

Use cards to group related content into flexible, visually distinct blocks. Cards support headers, bodies, and footers, and can be styled extensively.

Variants

The card component does not come with predefined color variants but will reflect custom styling if the variant prop is used along with your own Tailwind utilities or theme classes.

Display related content in a styled container with optional header and footer sections. Cards support theming, sizing, and boolean customisation for borders, shadows, rings, and more.

The card component supports 9 different variants, each with its own colour scheme and styling:

Default Variant
This is the default card.
Card Footer
Dark Variant
This is the dark card.
Card Footer
Light Variant
This is the light card.
Card Footer
Brand Variant
This is the brand card.
Card Footer
Primary Variant
This is the primary card.
Card Footer
Secondary Variant
This is the secondary card.
Card Footer
Success Variant
This is the success card.
Card Footer
Warning Variant
This is the warning card.
Card Footer
Danger Variant
This is the danger card.
Card Footer
<x-andach-card variant="default">
    <x-slot:header>Default Variant</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="dark">
    <x-slot:header>Dark Variant</x-slot:header>
    <x-slot:body>This is the <strong>dark</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="light">
    <x-slot:header>Light Variant</x-slot:header>
    <x-slot:body>This is the <strong>light</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="brand">
    <x-slot:header>Brand Variant</x-slot:header>
    <x-slot:body>This is the <strong>brand</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="primary">
    <x-slot:header>Primary Variant</x-slot:header>
    <x-slot:body>This is the <strong>primary</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="secondary">
    <x-slot:header>Secondary Variant</x-slot:header>
    <x-slot:body>This is the <strong>secondary</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="success">
    <x-slot:header>Success Variant</x-slot:header>
    <x-slot:body>This is the <strong>success</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="warning">
    <x-slot:header>Warning Variant</x-slot:header>
    <x-slot:body>This is the <strong>warning</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card variant="danger">
    <x-slot:header>Danger Variant</x-slot:header>
    <x-slot:body>This is the <strong>danger</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

Slots

The card component supports three named slots:

Slot Description
header Appears at the top of the card.
body The main section of the card, usually containing most of the content.
footer Appears at the bottom, often for actions or summaries.

Customisation

In addition to these unique slot options, there are also generic arguments available for all components.

Attribute Name Type Default Value Description
variant string null Used to apply a specific styling preset or custom theme variant.
size string 'base' Controls size of all internal elements (header, body, footer).

Size Variations

Cards can be adjusted in five different sizes, which affect padding and text size across header, body, and footer:

Extra Small
This is the default card.
Card Footer
Small
This is the default card.
Card Footer
Default
This is the default card.
Card Footer
Large
This is the default card.
Card Footer
Extra Large
This is the default card.
Card Footer
<x-andach-card size="xs">
    <x-slot:header>Extra Small</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card size="sm">
    <x-slot:header>Small</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card size="base">
    <x-slot:header>Default</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer></x-andach-card>

<x-andach-card size="lg">
    <x-slot:header>Large</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card size="xl">
    <x-slot:header>Extra Large</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

Attributes

The following attributes are enabled in the config file and can be toggled using boolean props:

Without Border
This is the default card.
Card Footer
Without Divide
This is the default card.
Card Footer
With Ring
This is the default card.
Card Footer
Without Rounded
This is the default card.
Card Footer
With Shadow
This is the default card.
Card Footer
<x-andach-card :border="false">
    <x-slot:header>Without Border</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card :divide="false">
    <x-slot:header>Without Divide</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card :ring="true">
    <x-slot:header>With Ring</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card :rounded="false">
    <x-slot:header>Without Rounded</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>

<x-andach-card :shadow="false">
    <x-slot:header>With Shadow</x-slot:header>
    <x-slot:body>This is the <strong>default</strong> card.</x-slot:body>
    <x-slot:footer>Card Footer</x-slot:footer>
</x-andach-card>