Card

Login to your account

Enter your email below to login to your account

Usage

Include CSS

Import Tailwind and one full Basecoat style bundle.

@import "tailwindcss";
@import "basecoat-css/vega.css";

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

@import "tailwindcss";
@import "basecoat-css/base.css";
@import "basecoat-css/components/card.css";
@import "basecoat-css/styles/vega.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.

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.

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.

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

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