Hero

DHero is a large banner section: BackgroundImage accepts any CSS image (URL or gradient), content goes into hero-content, and an optional Overlay layer sits between them.

Gradient background— BackgroundImage + ContentClass

Blazor + daisyUI

Components for every Blazor rendering mode, styled with pure daisyUI CSS.

Explore components
<DHero Class="min-h-[300px] rounded-box" ContentClass="text-center"
       BackgroundImage="linear-gradient(to top right, oklch(35% .08 240), oklch(75% .12 200))">
    <div class="max-w-md">
        <h1 class="text-5xl font-bold">Blazor + daisyUI</h1>
        <p class="py-6 opacity-90">
            Components for every Blazor rendering mode, styled with pure daisyUI CSS.
        </p>
        <a class="btn btn-primary" href="components/buttons">Explore components</a>
    </div>
</DHero>
Overlay— The Overlay fragment renders a hero-overlay div before the content

Overlay layer

The Overlay fragment renders a hero-overlay div before the content.

<DHero Class="min-h-[220px] rounded-box" ContentClass="text-center"
       BackgroundImage="linear-gradient(45deg, oklch(50% .1 300), oklch(60% .15 180))">
    <Overlay>
        @* hero-overlay is styled by daisyUI itself; leave it empty *@
    </Overlay>
    <ChildContent>
        <div class="max-w-sm">
            <h2 class="text-3xl font-bold">Overlay layer</h2>
            <p class="py-4">The <c>Overlay</c> fragment renders a <c>hero-overlay</c> div before the content.</p>
        </div>
    </ChildContent>
</DHero>
Plain (no background)

Content only

A hero without a background is just a centered section.

<DHero Class="min-h-[160px] bg-base-200 rounded-box">
    <div class="flex items-center gap-6">
        <DAvatar Shape="DaisyAvatarShape.Circle" SizeClass="w-20">
            <img src="https://picsum.photos/id/1005/160/160" alt="hero avatar" />
        </DAvatar>
        <div>
            <h2 class="text-2xl font-bold">Content only</h2>
            <p class="opacity-70">A hero without a background is just a centered section.</p>
        </div>
    </div>
</DHero>

API

DHero

Parameters

Name Type Default Binding Description
BackgroundImage string — — Any CSS image value for the background (a URL or a linear-gradient(...) ), rendered as an inline background-image style.
ContentClass string — — Extra classes for the inner hero-content element (e.g. text-center ).
Overlay RenderFragment — — Optional overlay layer rendered inside the hero (before the content).
OverlayClass string — — Extra classes for the overlay element ( hero-overlay is already styled by daisyUI).
ChildContent RenderFragment — — The hero content (placed inside hero-content ).
Class string — — Additional CSS classes appended to the component's computed daisyUI classes.
Style string — — Inline styles applied to the root element.
DAvatar

Parameters

Name Type Default Binding Description
Src string — — Image URL. When empty, the avatar renders in placeholder mode using the Placeholder content.
Alt string — — The alt attribute of the rendered <img> .
SizeClass string w-12 — Tailwind width/size utility for the inner element, e.g. w-24 .
Shape DaisyAvatarShape Squircle — Corner shape of the avatar ( rounded-box , rounded-full , or square).
SquareSquircleCircle
Status DaisyStatus None — Online/offline indicator rendered by daisyUI.
NoneOnlineOffline
Placeholder RenderFragment — — Content shown when Src is not set (initials, icon, ...).
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.