Skip to content
daisyBlazor

Card

A daisyUI card surface that groups a header, body and actions. Outlined swaps the shadow for a border, Elevation sets the depth, and OnClick makes the whole card keyboard-accessible.
Data display.cardReplaces MudCard
Cover · <Card>
A lemon on a yellow background New

Spring campaign visual

Brand assets · uploaded by Ana

PNG · 2.4 MB

Examples

CardHeader takes CardHeaderAvatar and CardHeaderContent slots, as in MudBlazor.

NT

Northwind Traders

Enterprise plan · customer since 2021

42 seats, renews on 1 March. Usage is up 18% this quarter, close to the plan limit.

website/Examples/DataDisplay/CardBasicExample.razor Source

With images

Put a figure first for a media card, or add daisyUI's image-full class to lay the text over it.

Sneakers

Team swag

Sneakers for everyone who shipped v2.

A waffle cone on a blue background

Launch party

Ice cream on the Lisbon office rooftop, Friday at six.

website/Examples/DataDisplay/CardImageExample.razor Source

Surfaces

Outlined, flat and raised cards from the same component.

Outlined

A border, no shadow.

Flat

Elevation 0 on base-200.

Raised

Elevation 12.

website/Examples/DataDisplay/CardSurfacesExample.razor Source

Clickable

With OnClick the card gets button semantics and answers Enter and Space.

Deploy to staging

Click or press Enter to deploy

Deployed 0 times

website/Examples/DataDisplay/CardClickableExample.razor Source

API

<Card>

DaisyBlazor

Parameters

  • Elevation int
    = 1

    Shadow depth from 0 (none) to 12+ (shadow-xl); defaults to 1 (shadow-sm). Ignored when Outlined.

  • Outlined bool
    = false

    When true, draws a card-border border instead of the elevation shadow.

  • Class string
    = null

    Extra CSS classes merged onto the root element.

  • Style string
    = null

    Inline CSS styles applied to the root element.

Events

  • OnClick EventCallback<MouseEventArgs>

    Raised when the card is clicked or activated by Enter/Space; also gives it button role and focusability.

Content

  • ChildContent RenderFragment

    Content rendered inside the .card surface.

<CardHeader>

DaisyBlazor

Parameters

  • Class string
    = null

    Extra CSS classes merged onto the root element.

  • Style string
    = null

    Inline CSS styles applied to the root element.

Content

  • CardHeaderActions RenderFragment

    Action buttons pushed to the end of the header.

  • CardHeaderAvatar RenderFragment

    Avatar slot rendered at the start of the header.

  • CardHeaderContent RenderFragment

    Title area rendered next to the avatar, filling the remaining width.

  • ChildContent RenderFragment

    Free content rendered after the avatar and content slots.

<CardContent>

DaisyBlazor

Parameters

  • Class string
    = null

    Extra CSS classes merged onto the root element.

  • Style string
    = null

    Inline CSS styles applied to the root element.

Content

  • ChildContent RenderFragment

    Content rendered inside the daisyUI card-body region.

<CardActions>

DaisyBlazor

Parameters

  • Class string
    = null

    Extra CSS classes merged onto the .card-actions element.

  • Style string
    = null

    Inline CSS styles applied to the .card-actions element.

Content

  • ChildContent RenderFragment

    Buttons or other actions rendered in the .card-actions footer.

From MudCard

Card keeps MudCard's parameter names, so most markup moves over by dropping the Mud prefix. See the migration guide for the shared enums, icons and services.

<MudCard> <Card>
Something went wrong while running the docs. Reload