Shadix

Label

Renders an accessible label associated with a form control.

<.label>Email address</.label>

Examples

Default

<.label>Email address</.label>

With input

A label paired with an input using the for attribute.

<div class="flex flex-col gap-1.5">
  <.label for="email">Email address</.label>
  <input id="email" type="email" placeholder="you@example.com" class="border rounded px-3 py-2 text-sm" />
</div>

Props

Name Type Default Values
class :string
for :string
rest :global
inner_block (slot) :slot