Link, Kbd & Label
Inline text components: DLink (themed underlined anchors),
DKbd (keyboard keys) and DLabel (muted inline captions).
All three are pure markup — they render identically in static SSR.
Link colors— link-primary … link-error
@foreach (var color in _colors)
{
<DLink Href="#" Color="@color">@color</DLink>
}
@code {
private static readonly DaisyColor[] _colors =
[
DaisyColor.Primary, DaisyColor.Secondary, DaisyColor.Accent, DaisyColor.Neutral,
DaisyColor.Info, DaisyColor.Success, DaisyColor.Warning, DaisyColor.Error,
];
}Underline only on hover— HoverUnderlineOnly
HoverUnderlineOnly="true" emits daisyUI's link-hover, which
hides the underline until the pointer is over the link.
<p class="max-w-xl opacity-80">
<code>HoverUnderlineOnly="true"</code> emits daisyUI's <code>link-hover</code>, which
hides the underline until the pointer is over the link.
</p>
<div class="flex gap-6 items-center mt-2">
<DLink Href="#">Always underlined</DLink>
<DLink Href="#" HoverUnderlineOnly="true" Color="DaisyColor.Info">Underline on hover</DLink>
</div>Keyboard keys— kbd-xs … kbd-xl
A
XSmall
A
Small
A
Medium
A
Large
A
ExtraLarge
Press
Ctrl+K
to search, or
Esc
to close.
<div class="flex flex-wrap gap-6 items-center">
@foreach (var size in _sizes)
{
<div class="flex flex-col items-center gap-1">
<DKbd Size="@size">A</DKbd>
<span class="text-xs opacity-60">@size</span>
</div>
}
</div>
<div class="flex flex-wrap gap-3 items-center mt-4 text-sm">
<span>Press</span>
<DKbd Size="DaisyKbdSize.Small">Ctrl</DKbd><span>+</span><DKbd Size="DaisyKbdSize.Small">K</DKbd>
<span class="opacity-60">to search, or</span>
<DKbd>Esc</DKbd>
<span class="opacity-60">to close.</span>
</div>
<div class="mt-4 flex items-center gap-3">
<DLink Color="DaisyColor.Primary" id="kbd-counter-link"
@onclick="() => _presses++">Click me (a DLink, not a button)</DLink>
<span class="badge badge-primary badge-lg" id="kbd-counter-badge">@_presses</span>
</div>
@code {
private int _presses;
private static readonly DaisyKbdSize[] _sizes =
[
DaisyKbdSize.XSmall, DaisyKbdSize.Small, DaisyKbdSize.Medium,
DaisyKbdSize.Large, DaisyKbdSize.ExtraLarge,
];
}Labels— muted inline captions
API token
Read-only scope, revoked nightly.
Saved (only editors see this)
<div class="flex flex-col gap-4 max-w-sm">
<div class="flex flex-col gap-1">
<DLabel>API token</DLabel>
<input class="input input-bordered" placeholder="d5_live_…" readonly />
<DLabel>Read-only scope, revoked nightly.</DLabel>
</div>
<p class="text-sm">
Saved
<DLabel>(only editors see this)</DLabel>
</p>
</div>Tips
DLinkis a real<a> : give it anHref so middle-click / "open in new tab" keep working; addTarget for new tabs.Ghost has no daisyUI link variant —DLink Color="Ghost"renders a plain contextual-colored link.DKbdsizes follow thekbd-xs…kbd-xl scale;Medium (default) emits no size class.- daisyUI 5's
.label is just muted inline-flex text — the oldlabel-text span is gone, so no nested element is needed.
API
DLink
Parameters
| Name | Type | Default | Binding | Description |
|---|---|---|---|---|
| Href | string | — | — | Link target URL. When null nothing is rendered as an href (daisyUI still styles the anchor via the link class). Note: under Blazor's <base href> , Href="#" resolves to the app root and navigates there on click — action links (with only an @onclick ) should omit it. |
| Target | string | — | — | Link target ( _blank , _self , ...). When null the default browser behavior applies. |
| Color | DaisyColor | Default | — | Semantic color of the link ( link-primary , link-secondary , ...). Ghost has no daisyUI link equivalent; no class is emitted. DefaultPrimarySecondaryAccentInfoSuccessWarningErrorGhostNeutral |
| HoverUnderlineOnly | bool | False | — | When true only the underline is emphasized on hover ( link-hover ); daisyUI's default underline animation is kept. |
| ChildContent | RenderFragment | — | — | The link content (text and/or icon markup). |
| Class | string | — | — | Additional CSS classes appended to the component's computed daisyUI classes. |
| Style | string | — | — | Inline styles applied to the root element. |
DKbd
Parameters
| Name | Type | Default | Binding | Description |
|---|---|---|---|---|
| Size | DaisyKbdSize | Medium | — | Key size ( kbd-xs ... kbd-xl ); Medium emits no class. XSmallSmallMediumLargeExtraLarge |
| ChildContent | RenderFragment | — | — | The key legend (e.g. Ctrl , ⌘ ). |
| Class | string | — | — | Additional CSS classes appended to the component's computed daisyUI classes. |
| Style | string | — | — | Inline styles applied to the root element. |
DLabel
Parameters
| Name | Type | Default | Binding | Description |
|---|---|---|---|---|
| ChildContent | RenderFragment | — | — | The label text/markup. |
| Class | string | — | — | Additional CSS classes appended to the component's computed daisyUI classes. |
| Style | string | — | — | Inline styles applied to the root element. |