Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Card

Card is a container for grouping related content.

When To Use It

Use card views to group related information and actions into clear, reusable panels such as summaries, status blocks, or settings modules.

Constructing a Card

use vizia::prelude::*;

Card::new(cx, |cx| {
    CardHeader::new(cx, |cx| Label::new(cx, "Project status"));

    CardContent::new(cx, |cx| {
        Label::new(cx, "All systems operational");
    });

    CardFooter::new(cx, |cx| {
        Button::new(cx, |cx| Label::new(cx, "Dismiss"));
    });
});

Card APIs

ViewConstructor
CardCard::new(cx, content)
CardHeaderCardHeader::new(cx, content)
CardContentCardContent::new(cx, content)
CardFooterCardFooter::new(cx, content)

Components and Styling

SelectorDescription
cardRoot card container.
card-headerOptional header region.
card-contentMain body region.
card-footerOptional footer/actions region.

Accessibility

  • Use heading-like text in CardHeader for better scanning.
  • Keep actionable controls in CardFooter keyboard reachable and clearly labeled.