Card

Displays a card with header, content, and footer.

Log in to your account

Enter your email below to Log in to your account

Size

Use the size prop to change the size of the card. The small size variant uses smaller spacing.

Small Card

This card uses the small size variant.

The card component supports a size prop 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
Featured

Design systems meetup

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

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::card::*;

#[component]
pub fn CardAnatomy() -> impl IntoView {
    view! {
        <Card>
            <CardHeader>
                <CardTitle />
                <CardDescription />
            </CardHeader>
            <CardContent />
            <CardFooter />
        </Card>
    }
}

API Reference

Card

Contains all the parts of a card.

Custom Attributes
NameTypeDefaultDescription
sizeString""

Specify the size to render the card.

Implements global attributes.

CardContent

Contains the content displayed in the card body.

Implements global attributes.

CardDescription

A summary that describes the card content.

Implements global attributes.

CardFooter

Contains card footer content.

Implements global attributes.

CardHeader

Renders at the top of the card. Contains the card title and card description.

Implements global attributes.

CardTitle

The title of the card.

Implements global attributes.