mediahwcz-icon

Icon

Renders a Lucide icon as inline SVG with sizing, coloring, and accessible labeling.

Attributes

AttributeTypeDefaultDescription
iconstring''Lucide icon name in kebab-case (e.g. chevron-down); resolved against the Lucide icon set.
labelstring''Accessible label; renders the icon as role="img" with aria-label unless decorative or role override it.
decorativebooleanfalseMarks the icon decorative: aria-hidden="true", no role or label.
rolestring''Explicit ARIA role for the SVG (defaults to img when a label is present).
stroke-widthstring'2'SVG stroke width (default 2).
heightstring'16'SVG height in pixels (default 16); overridden by size.
widthstring'16'SVG width in pixels (default 16); overridden by size.
sizestring | undefined—Sets both width and height at once.
colorstring''CSS color applied to the SVG (stroke inherits currentColor).
fillstring'none'SVG fill (default none).
Inherited from Hwc
AttributeTypeDefaultDescription
i18nstring''Per-instance text overrides as key: text pairs, merged over the global z-i18n script and the built-in defaults.
floatingstring''Floating UI placement options (for example offset and shiftPadding) parsed as key: value pairs.
force-prevent-rerenderbooleanfalseSkips re-rendering after the first render; an existing data-host-inner child is adopted as the rendered DOM.
templatestring''Selector or id of an external element or <template> whose inner content is cloned in place of an inline template[data-fn="template"] child.
Inherited from Base
AttributeTypeDefaultDescription
clsstring''Adds classes to named parts as key: classes pairs; a plain string targets the default part.
stlstring''Adds inline styles to named parts as key: styles pairs; a plain string targets the default part.

Custom Styling (cls / stl)

Default cls target:svg · defaultstl target:svg

KeyDefault classclsstlDescription
svg—yesnoThe generated SVG element; the default cls/stl target.

CSS Variables

VariableDefaultScopeDescription
--z-icon-image-size1.25rem.z-icon-imageSize of image-style icons.

i18n Keys

KeyDefaultPlaceholdersDescription
label—Accessible label override; takes precedence over the label attribute.

Data Hooks

AttributeValuesApplies toRoleDescription
data-host-inner · from Hwc—descendantconfigMarks the rendered inner wrapper so force-prevent-rerender can adopt server-rendered DOM without re-rendering.
data-reactive · from Hwc—descendantconfigOpts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates.

Child Content

script[data-fn="config"][type="application/json"]

JSON configuration script parsed by the base class (i18n, cls, stl, floating).

AttributeRequiredTypeDescription
data-fnyesconfigMarks the script as configuration (value: config).
data-reactivenobooleanRe-parses the configuration when the script mutates.

select[data-fn="data-source"]

Hidden select parsed into grouped option data by the base class.

AttributeRequiredTypeDescription
data-fnyesdata-sourceMarks the select as the data source (value: data-source).
data-reactivenobooleanRe-parses the options when the select mutates.

optgroup · repeatable

Groups options under a label.

AttributeRequiredTypeDescription
labelyesstringGroup header text; also the default group key.
disablednobooleanDisables every option in the group.
data-keynostringOverrides the group key used in the parsed data.
data-keywordsnocomma-separated stringComma-separated keywords stored with the group's data.

option · repeatable

One option entry within the group.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated; searched alongside the label and value.

option · repeatable

One ungrouped option entry.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated.

template[data-fn="icons"]

Instance-level icon repository.

AttributeRequiredTypeDescription
data-fnyesiconsMarks the template as an icon source (value: icons).
data-reactivenobooleanRe-parses the icons when the template mutates.

* · repeatable

One icon element.

AttributeRequiredTypeDescription
data-keyyesstringIcon key referenced by $icons.

template[data-fn="template"]

Deferred content template mounted by the base class.

AttributeRequiredTypeDescription
data-fnyestemplateMarks the template for deferred mounting (value: template).
data-reactivenobooleanRe-parses the template when it mutates.

CSS Classes

ClassRoleApplies toDescription
.z-iconrootz-iconRoot class applied to the host.
.z-icon-imageelement.z-iconImage-style icon presentation.
.z-svgelement.z-iconBase class for inline SVG sizing/alignment.

Accessibility

  • Without a label, role, or decorative, the SVG carries no ARIA attributes; set label for meaningful icons and decorative for purely visual ones.
  • The generated SVG carries data-icon/data-lucide with the icon name.