Forms <hw:input-group>
View examples

Input Group

Composable shell for adding icons, text, shortcuts, buttons and helper content around existing form controls.

Usage

BLADE
<hw:input-group>
    <hw:input name="search" type="search" placeholder="Search..." />

    <hw:input-group.addon align="inline-start">
        <x-lucide-search class="size-4" />
    </hw:input-group.addon>
</hw:input-group>

InputGroup does not replace <hw:input>, <hw:textarea> or <hw:button>. Compose those existing components inside the group so their validation, old() restoration, Stimulus wiring and accessibility behavior stay intact.

Text-like Input controls always provide a stable root inside the group. Their wrapper-class configures that root and class configures the native input; clearing does not change the group's child structure.

Addons

Addons render after the form control in the DOM for predictable focus navigation. Inline addons stay in the flex layout, so text prefixes such as https:// reserve their own width instead of overlapping the input value. Use align to choose their visual position:

Text addons use a compact gap next to the control. Icon, button and keyboard-shortcut addons keep the roomier Nova spacing from the shadcn reference.

Align Description
inline-start Inline-start side of a one-line input; default.
inline-end Inline-end side of a one-line input.
block-start Above the control, useful for textarea headers.
block-end Below the control, useful for textarea footers.
BLADE
<hw:input-group>
    <hw:input name="url" placeholder="example.com" />

    <hw:input-group.addon align="inline-start">
        https://
    </hw:input-group.addon>

    <hw:input-group.addon align="inline-end">
        <hw:button type="submit" variant="ghost" size="sm">Go</hw:button>
    </hw:input-group.addon>
</hw:input-group>

Textarea

BLADE
<hw:input-group>
    <hw:textarea name="message" :counter="280" />
</hw:input-group>

Custom Controls

Use data-slot="input-group-control" on a custom control itself so the selected preset can apply the same group focus and layout styles. This remains an explicit low-level hook rather than a wrapper component: native focus, validation, name and form behavior must stay on the actual control.

BLADE
<hw:input-group>
    <input data-slot="input-group-control" name="amount" inputmode="decimal" placeholder="0.00" />

    <hw:input-group.addon align="inline-end">
        USD
    </hw:input-group.addon>
</hw:input-group>

Styling hooks

  • data-slot="input-group"
  • data-slot="input-group-addon"
  • data-align="inline-start|inline-end|block-start|block-end"
  • data-slot="input-group-control" for custom controls

Controller integrations

None. Controllers come from the components you compose inside the group, such as clear-input on <hw:input clearable>.