For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/en/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/en/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/en/components/card.md.

Card

Card groups related content and actions into a self-contained region whose boundary serves information structure rather than decoration.

Live preview

Enter credentials to continue

Login to your account

Enter your email below to login to your account

Usage

Include CSS

Import Tailwind and one full A3S UI style bundle.

@import "tailwindcss";
@import "@a3s-lab/ui/a3s.css";

Or import only the base CSS, Card component CSS, and one style pack.

@import "tailwindcss";
@import "@a3s-lab/ui/base.css";
@import "@a3s-lab/ui/components/card.css";
@import "@a3s-lab/ui/styles/a3s.css";

Using CDN or bundler imports? See the Installation page.

Add your card HTML

<div class="card">
  <header>
    <h2>Card Title</h2>
    <p>Card Description</p>
    <div class="card-action">Card Action</div>
  </header>
  <section> <p>Card Content</p></section>
  <footer>
    <p>Card Footer</p>
  </footer>
</div>

HTML structure

<div class="card">

The card container. Use data-size="sm" for a denser layout.

<header>

The card header.

<h2> or <h3>
The card title.
<p> Optional
The card description.
<div class="card-action"> Optional
Action or metadata placed in the top-right of the header. Use <menu class="card-action"> when the content is a list of commands.
<section>
The main card content.
<footer> Optional
Footer actions or secondary content at the bottom of the card.

Examples

Size

Use data-size="sm" to set the size of the card to small. The small size variant uses smaller spacing.

Live preview

Small Card

This card uses the small size variant.

The card component supports a size attribute that can be set to sm for a more compact appearance.

Image

Add an image before the card header to create a card with an image.

Live preview
Event cover

Design systems meetup

A practical talk on component APIs, accessibility, and shipping faster.

Featured

RTL

Add dir="rtl" to the card or an ancestor.

Live preview

تسجيل الدخول إلى حسابك

أدخل بريدك الإلكتروني أدناه لتسجيل الدخول إلى حسابك