Search 71 components and 72 controllers by name, category or description.
Field
Laravel-aware field composition with labels, help text, validation errors and set semantics
Field wrapper
hw:field owns the name and shares it with the control, which derives its id, its Laravel error key, its old() value and its ARIA wiring from it.
We will only use this for account notifications.
{{-- The control inherits name, id and error key from the Field. Do not repeat them. --}}
<hw:field name="email" label="Email" description="We will only use this for account notifications." required>
<hw:input type="email" placeholder="name@example.com" autocomplete="email" />
</hw:field>
Validation, end to end
Submit the form empty. The failed controls gain aria-invalid and aria-describedby, and hw:field.error fills the element it keeps in the DOM precisely so that reference never dangles.
<hw:form method="post" :action="route('components.field.submit')" error-scroll novalidate class="grid gap-5">
{{-- On failure the control gains aria-invalid and aria-describedby="account_email-error",
and field.error fills the element it already keeps in the DOM. --}}
<hw:field name="account_email" label="Account email" required>
<hw:input type="email" placeholder="owner@example.com" />
</hw:field>
<hw:field name="display_name" label="Display name" description="At least 3 characters." required>
<hw:input placeholder="Ada Lovelace" />
</hw:field>
{{-- Array names derive deterministically: id contacts-0-phone, error key contacts.0.phone. --}}
<hw:field name="contacts[0][phone]" label="Primary phone" required>
<hw:input placeholder="+55 11 90000-0000" />
</hw:field>
<div>
<hw:button type="submit">Submit empty to see the errors</hw:button>
</div>
</hw:form>
Manual layout
Set :error="false" and compose field.label, field.description, the control and field.error in whatever order the design needs.
CPF or CNPJ. The mask switches on length.
{{-- :error="false" turns off the automatic error node so the primitives can be ordered freely. --}}
<hw:field name="document" required :error="false">
<hw:field.label class="font-bold">Document</hw:field.label>
<hw:field.description>CPF or CNPJ. The mask switches on length.</hw:field.description>
<hw:input clearable mask="cpf-cnpj" placeholder="000.000.000-00" />
<hw:field.error />
</hw:field>
Horizontal controls
orientation="horizontal" puts the control beside its text. Use field.content + field.title for a switch, and field.label when the control accepts a real label association.
Receive occasional product updates.
{{-- field.content + field.title when the control has no single label target. --}}
<hw:field name="marketing" orientation="horizontal">
<hw:switch value="1" checked />
<hw:field.content>
<hw:field.title>Marketing emails</hw:field.title>
<hw:field.description>Receive occasional product updates.</hw:field.description>
</hw:field.content>
</hw:field>
{{-- field.label instead, when a real label association is what you want. --}}
<hw:field name="remember" orientation="horizontal">
<hw:checkbox value="1" />
<hw:field.label>Remember me on this device</hw:field.label>
</hw:field>
Field set, group and separator
field.set adds a semantic legend, field.group stacks related fields, and field.separator marks a logical break between them.
<hw:field.set>
<hw:field.legend>Billing address</hw:field.legend>
<hw:field.description>The address associated with your payment method.</hw:field.description>
<hw:field.group class="grid gap-4 sm:grid-cols-2">
<hw:field name="street" label="Street address">
<hw:input placeholder="123 Main St" />
</hw:field>
<hw:field name="city" label="City">
<hw:input placeholder="São Paulo" />
</hw:field>
</hw:field.group>
<hw:field.group>
<hw:field name="billing_email" label="Billing email">
<hw:input type="email" placeholder="billing@example.com" />
</hw:field>
<hw:field.separator>Or</hw:field.separator>
<hw:field name="billing_phone" label="Billing phone">
<hw:input type="tel" placeholder="+55 11 90000-0000" />
</hw:field>
</hw:field.group>
</hw:field.set>
When the submitted name is not the validation key
Name derivation is deterministic — items[0][name] becomes id items-0-name and error key items.0.name. Override with error-key only when the two genuinely differ.
{{-- The browser submits settings[notifications][email], but Laravel validates
notification_email. error-key keeps the message lookup pointing at the rule. --}}
<hw:field name="settings[notifications][email]" error-key="notification_email" label="Notification email">
<hw:input type="email" placeholder="alerts@example.com" />
</hw:field>
{{-- messages renders the error state without a round trip — useful in a design review. --}}
<hw:field name="preview_only" label="What a failed field looks like" :error="false">
<hw:input value="not-an-email" aria-invalid="true" />
<hw:field.error messages="That does not look like a valid email address." />
</hw:field>