Skip to content

zk-label ​

Renders a <label> element with optional icon, prefix, and suffix slots. Used internally by zk-input, zk-select, and zk-textarea.

Props ​

PropTypeDefaultDescription
labelstring|nullnullLabel text
forstring|nullnullExplicit for attribute — takes priority over id and name
namestring|nullnullFallback for for resolution
idstring|nullnullFallback for for resolution when for is absent
msrstring|nullnullMaterial Symbols icon as label content
classstring|nullnullCSS class(es)
iconBeforestring|nullnullLeading icon
iconAfterstring|nullnullTrailing icon
prefixstring|nullnullText prefix inside the label
suffixstring|nullnullText suffix inside the label

for resolution order ​

  1. Explicit for prop
  2. id prop
  3. name prop

Examples ​

Standalone label ​

blade
<x-form.label label="Email address" for="user-email" />

Icon-only label (accessibility) ​

blade
<x-form.label msr="search" for="search-input" />

Notes ​

  • This component has no public x-zk-* alias — it is used internally by other form components.
  • The for resolution means you rarely need to pass for explicitly if name or id is already provided.

Documentation of 3.2.0 , built from c93e21f on 3.2.0 by pipeline #2919741884 on 2026-10-06.