Skip to content

hd-tab

Attributes and example

hd-tab

One pane of hd-tabs, directly inside it.

AttributeWhat it is
namerequiredWhat selected and event.value call it, e.g. today.
labelrequiredThe text on its tab.
iconSemantic icon on its tab, before the label.
badgeA badge on its tab: a count (1 and up, 99+ past 99) or dot; empty or 0 shows none. Screen readers hear the count with the label.
badge-toneThe badge in the alert colour (--hd-tabs-badge-alert, else danger).One of accent, alert. Default accent.
pulseThe badge pulses, e.g. while an alert holds; not at reduced motion.Default false.
colorIts own accent in place of the theme’s, for its tab and the indicator under it: a theme colour name (accent, lit, cool, good, warn, danger, chart-1…) or #rrggbb.
open-whenOpens this tab when it turns true, e.g. open-when="{{ doorbell.alarm_generic }}", saying so as change; never for what holds when the tabs appear, nor within 30 seconds of a touch.Default false.
<hd-tab name="month" label="Month"><p>This month</p></hd-tab>

Styling

Set CSS variables on the component element. Its internal elements live in Shadow DOM; only the exposed named parts can be styled with ::part.

No component-specific CSS variables are exposed. Use the host element’s sizing and the documented theme variables.

Style the host

hd-tab {  --hd-accent: #2563eb;  max-width: 100%;}
Theme variables