Icons

daisyUI ships no icons, so DaisyBlazorUI provides DIcon with a deliberately minimal built-in set (DaisyIcons, ~2 KB of inline SVG). Every glyph is stroke-based with stroke="currentColor", so icons always match the surrounding text — and theme — automatically. Need more icons? Load them from any CDN with DaisyIcon.FromUrl instead of bloating the assembly.

Built-in set— DaisyIcons.All — every glyph bundled with the library
warning
info
check
success
x-mark
error
plus
minus
search
trash
chevron-down
bars
@foreach (var icon in DaisyIcons.All)
{
    <DIcon Icon="@icon" Size="DaisySize.Large" />
}
Sizes— xs = 12 px, sm = 14 px, md = 16 px, lg = 20 px (inline width/height — no Tailwind required)
xs
sm
md
lg
thin stroke
bold stroke
<DIcon Icon="@DaisyIcons.Warning" Size="DaisySize.ExtraSmall" />
<DIcon Icon="@DaisyIcons.Warning" Size="DaisySize.Small" />
<DIcon Icon="@DaisyIcons.Warning" Size="DaisySize.Medium" />
<DIcon Icon="@DaisyIcons.Warning" Size="DaisySize.Large" />
 
<DIcon Icon="@DaisyIcons.Info" StrokeWidth="0.75" Size="DaisySize.Large" />
<DIcon Icon="@DaisyIcons.Info" StrokeWidth="3" Size="DaisySize.Large" />
Color inheritance— currentColor means icons follow the text color — including daisy semantic colors
primary success warning error
<span class="flex items-center gap-2"><DIcon Icon="@DaisyIcons.Search" /> primary</span>
<span class="flex items-center gap-2 text-[var(--color-success)]"><DIcon Icon="@DaisyIcons.Success" /> success</span>
<span class="flex items-center gap-2 text-[var(--color-warning)]"><DIcon Icon="@DaisyIcons.Warning" /> warning</span>
<span class="flex items-center gap-2 text-[var(--color-error)]"><DIcon Icon="@DaisyIcons.Error" /> error</span>
 
<DButton Color="DaisyColor.Primary" IconStart="@DaisyIcons.Plus">Icon inside a button matches its label</DButton>
Remote (CDN) icons— DaisyIcon.FromUrl — zero assembly weight, rendered with CSS mask-image so currentColor still applies

Remote glyphs are rendered as a CSS mask over background-color: currentColor, so they behave exactly like built-ins (monochrome, theme-aware) with no JavaScript and no assembly bloat. Works in every rendering mode, but needs network access — and a CSP that allows the icon host. Any SVG URL works; these come from the Iconify API.

rocket
brain
sparkles
ghost
pizza
siren
<DIcon Icon="@icon" Size="DaisySize.Large" />
 
<DButton Color="DaisyColor.Accent" IconStart="@DaisyIcon.FromUrl("brain", "https://api.iconify.design/lucide/brain.svg")">CDN icon in a button</DButton>
<DAlert Color="DaisyColor.Info" Icon="@DaisyIcon.FromUrl("siren", "https://api.iconify.design/lucide/siren.svg")">CDN icon in an alert</DAlert>
 
@code {
    private static readonly DaisyIcon[] _remoteIcons =
    [
        DaisyIcon.FromUrl("rocket", "https://api.iconify.design/lucide/rocket.svg"),
        DaisyIcon.FromUrl("brain", "https://api.iconify.design/lucide/brain.svg"),
        DaisyIcon.FromUrl("sparkles", "https://api.iconify.design/lucide/sparkles.svg"),
        DaisyIcon.FromUrl("ghost", "https://api.iconify.design/lucide/ghost.svg"),
        DaisyIcon.FromUrl("pizza", "https://api.iconify.design/lucide/pizza.svg"),
        DaisyIcon.FromUrl("siren", "https://api.iconify.design/lucide/siren.svg"),
    ];
}

API

DIcon

Parameters

Name Type Default Binding Description
Icon DaisyIcon — — The icon to render (built-in from DaisyIcons or String) ).
Size DaisySize Medium — Rendered size (xs=12px, sm=14px, md=16px, lg=20px) via inline width/height.
ExtraSmallSmallMediumLargeExtraLarge
StrokeWidth double 1.5 — Stroke width for built-in glyphs (heroicons geometry is designed for 1.5).
Label string — — Accessible label. When set the icon gets role="img" + aria-label ; otherwise it is hidden from assistive tech (decorative).
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.
DAlert

Parameters

Name Type Default Binding Description
Color DaisyColor Default — Contextual color (e.g. alert-info , alert-success ); Default emits no class.
DefaultPrimarySecondaryAccentInfoSuccessWarningErrorGhostNeutral
Variant DaisyVariant Default — Style variant (e.g. alert-outline , alert-soft ); Default emits no class.
DefaultOutlineDashSoftLink
Icon DaisyIcon — — Optional leading icon (e.g. DaisyIcons.Warning or a CDN icon via DaisyIcon.FromUrl ).
IconSize DaisySize Large — Icon size for Icon .
ExtraSmallSmallMediumLargeExtraLarge
ChildContent RenderFragment — — The alert's message content.
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.