Card

DCard renders card with an optional image, title (string or TitleContent slot) and right-aligned Actions inside .card-body.

Card— Title string, TitleContent slot with badges, image via ImageSrc, Side="true" for card-side. The Open button composes with DModal.

Simple card

A card with just a title and body text. The class parameter merges with card.

Sample photo

With image

badge
slot title

Image on top, custom TitleContent with badges.

Side layout

card-side lays image and body out horizontally.

<DCard Title="Simple card" Class="bg-base-200 shadow">
    <p>A card with just a title and body text. The class parameter merges with <code>card</code>.</p>
</DCard>
 
<DCard Class="bg-base-200 shadow" ImageSrc="https://picsum.photos/id/1043/640/360" ImageAlt="Sample photo">
    <TitleContent>
        <h2 class="card-title">With image</h2>
        <div class="badge badge-primary">badge</div>
        <div class="badge badge-accent">slot title</div>
    </TitleContent>
    <ChildContent>
        <p>Image on top, custom <code>TitleContent</code> with badges.</p>
    </ChildContent>
    <Actions>
        <DButton Color="DaisyColor.Primary">Like</DButton>
        <DButton>Skip</DButton>
    </Actions>
</DCard>
 
<DCard Title="Side layout" Side="true" Class="bg-base-200 shadow">
    <ChildContent>
        <p><code>card-side</code> lays image and body out horizontally.</p>
    </ChildContent>
    <Actions>
        <DButton Color="DaisyColor.Accent" Variant="DaisyVariant.Soft"
                 OnClick="@(() => _showDetails = true)">Open</DButton>
    </Actions>
</DCard>
 
<DModal @bind-Open="_showDetails" Title="Card details" BoxClass="max-w-md">
    <p>This modal was opened by the <code>Open</code> button on the side-layout card —
       components compose: cards, modals and buttons are all independent.</p>
    <div class="modal-action">
        <DButton Color="DaisyColor.Primary" OnClick="@(() => _showDetails = false)">Got it</DButton>
    </div>
</DModal>
 
@code {
    private bool _showDetails;
}
Divider— Horizontal divider with optional centered text; Vertical="true" for inline separators.

Plain content above

or

plain content below. Vertical dividers inline:

<DDivider>or</DDivider>
 
<div class="flex items-center">
    <DButton Color="DaisyColor.Ghost">A</DButton>
    <DDivider Vertical="true" />
    <DButton Color="DaisyColor.Ghost">B</DButton>
</div>

API

DCard

Parameters

Name Type Default Binding Description
Title string — — Simple text title rendered as .card-title inside the card body.
TitleContent RenderFragment — — Custom title markup; takes precedence over Title .
ChildContent RenderFragment — — Card body content (goes inside the .card-body element).
Actions RenderFragment — — Actions rendered right-aligned in a .card-actions row at the bottom of the body.
ImageSrc string — — Optional image URL rendered in a figure above the body.
ImageAlt string — — Alt text for the optional image.
Side bool False — Lays the card out horizontally (daisyUI card-side).
BodyClass string — — Extra classes merged into the inner .card-body element.
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
DDivider

Parameters

Name Type Default Binding Description
ChildContent RenderFragment — — Optional text rendered inside the divider line.
Vertical bool False — Renders a vertical divider (daisyUI divider-vertical).
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
DModal

Parameters

Name Type Default Binding Description
Open bool False @bind-Open Whether the modal is open. Supports two-way binding (@bind-Open).
Title string — — Simple text title rendered inside the modal box.
TitleContent RenderFragment — — Custom title markup; takes precedence over Title .
ChildContent RenderFragment — — Modal body content. Put action buttons in a <div class="modal-action">.
BoxClass string — — Extra classes for the inner .modal-box element.
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
DButton

Parameters

Name Type Default Binding Description
Type string button — The native type attribute: button , submit or reset .
Color DaisyColor Default — Contextual color (e.g. btn-primary , btn-ghost ); Default emits no class.
DefaultPrimarySecondaryAccentInfoSuccessWarningErrorGhostNeutral
Variant DaisyVariant Default — Style variant (e.g. btn-outline , btn-soft ); Default emits no class.
DefaultOutlineDashSoftLink
Size DaisySize Medium — Size (e.g. btn-xs , btn-lg ); Medium emits no class.
ExtraSmallSmallMediumLargeExtraLarge
Disabled bool False — Disables the button (native disabled ).
IconStart DaisyIcon — — Icon rendered before the button content (daisy's btn gap handles spacing).
IconEnd DaisyIcon — — Icon rendered after the button content.
IconSize DaisySize? — — Icon size; defaults to the button Size when null .
ExtraSmallSmallMediumLargeExtraLarge
Shape DaisyButtonShape Default — btn-square / btn-circle — use with an icon and no text for icon-only buttons.
DefaultSquareCircle
Wide bool False — btn-wide : widens the button to width:100% of its container, capped at 16rem . When both Wide and Block are set, btn-block wins on width (it is declared later in daisyUI's cascade at equal specificity) and the button fills its container, still capped at 16rem by btn-wide 's max-width .
Block bool False — btn-block : the button fills the full width of its container ( width:100% ). When both Block and Wide are set, btn-block wins on width (it is declared later in daisyUI's cascade at equal specificity).
ChildContent RenderFragment — — The button's inner text and content.
OnClick EventCallback<MouseEventArgs> — — Invoked when the button is clicked.
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
Connection lost — reconnecting…
Connection failed.
The server has stopped.