Skip to main content

Module card

Module card 

Source
Expand description

Card — a rounded surface that groups related content.

Doubles as gpui-component’s section/GroupBox container: pass an optional title / description to render a header, then add the body in the show closure, just like List.

Mirroring upstream GroupBox, the surface uses one of three mutually exclusive styles — it never combines a fill and a border (doing so makes the border invisible in themes where the muted surface and border share a color, e.g. the default dark theme):

sc::Card::new()
    .title("Account")
    .description("Manage your profile settings.")
    .show(ui, |ui| {
        ui.add(sc::Input::new(&mut name));
    });

Structs§

Card
A surface container with an optional header (title + description).

Enums§

CardVariant
How a Card’s surface is drawn. Matches upstream GroupBoxVariant: a card is either filled or outlined, never both.