Components
You’re browsing the documentation for an old version of Flux. Go to v2.x ->

Input

Capture user data with various forms of text input.

Username This will be publicly displayed.
Copy to clipboard
<flux:input wire:model="username" label="Username" description="This will be publicly displayed." />

Longhand

Flux makes it easy to wrap your inputs in a field with label/description and error messages. If you need more control over the layout of these fields, you can assemble the individual field components.

Copy to clipboard
<flux:field>    <flux:label>Username</flux:label>    <flux:description>This will be publicly displayed.</flux:description>    <flux:input />    <flux:error name="username" /></flux:field>

Class targeting

Unlike other form components, Flux's input component is composed of two underlying elements: an input element and a wrapper div. The wrapper div is there to add padding where icons should go.

This is typically fine, however, if you need to pass classes into the input component and have them directly applied to the input element, you can do so using the class:input attribute instead of simply class:

Copy to clipboard
<flux:input class="max-w-xs" class:input="font-mono" />

Types

Use the browser's various input types for different situations: text, email, password, etc.

Email
Password
Date
<flux:input type="email" label="Email" /><flux:input type="password" label="Password" /><flux:input type="date" max="2999-12-31" label="Date" />

File

Flux provides a special input component for file uploads. It's a simple wrapper around the native input[type="file"] element.

Logo
Attachments
<flux:input type="file" wire:model="logo" label="Logo"/><flux:input type="file" wire:model="attachments" label="Attachments" multiple />

Smaller

Use the size prop to make the input's height more compact.

<flux:input size="sm" placeholder="Filter by..." />

Disabled

Prevent users from interacting with an input by disabling it.

Email
<flux:input disabled label="Email" />

Readonly

Useful for locking an input during a form submission.

Public API key
<flux:input readonly variant="filled" />

Invalid

Signal to users that the contents of an input are invalid.

<flux:input invalid />

Input masking

Restrict the formatting of text content for unique cases by using Alpine's mask plugin

<flux:input mask="(999) 999-9999" value="7161234567" />

Icons

Append or prepend an icon to the inside of a form input.

<flux:input icon="magnifying-glass" placeholder="Search orders" /><flux:input icon-trailing="credit-card" placeholder="4444-4444-4444-4444" /><flux:input icon-trailing="loading" placeholder="Search transactions" />

Icon buttons

Append a button to the inside of an input to provide associated functionality.

<flux:input placeholder="Search orders">    <x-slot name="iconTrailing">        <flux:button size="sm" variant="subtle" icon="x-mark" class="-mr-1" />    </x-slot></flux:input><flux:input type="password" value="password">    <x-slot name="iconTrailing">        <flux:button size="sm" variant="subtle" icon="eye" class="-mr-1" />    </x-slot></flux:input>

Clearable, copyable, and viewable inputs

Flux provides three special input properties to configure common input button behaviors. clearable for clearing contents, copyable for copying contents, and viewable for toggling password visibility.

<flux:input placeholder="Search orders" clearable /><flux:input type="password" value="password" viewable /><flux:input icon="key" value="FLUX-1234-5678-ABCD-EFGH" readonly copyable />

Keyboard hint

Hint to users what keyboard shortcuts they can use with this input.

⌘K
<flux:input kbd="⌘K" icon="magnifying-glass" placeholder="Search..."/>

As a button

To render an input using a button element, pass "button" into the as prop.

<flux:input as="button" placeholder="Search..." icon="magnifying-glass" kbd="⌘K" />

With buttons

Attach buttons to the beginning or end of an input element.

<flux:input.group>    <flux:input placeholder="Post title" />    <flux:button icon="plus">New post</flux:button></flux:input.group><flux:input.group>    <flux:select variant="listbox" class="max-w-fit">        <flux:option selected>USD</flux:option>        <!-- ... -->    </flux:select>    <flux:input placeholder="$99.99" /></flux:input.group>

Text prefixes and suffixes

Append text inside a form input.

https://
.brand.com
<flux:input.group>    <flux:input.group.prefix>https://</flux:input.group.prefix>    <flux:input placeholder="example.com" /></flux:input.group><flux:input.group>    <flux:input placeholder="chunky-spaceship" />    <flux:input.group.suffix>.brand.com</flux:input.group.suffix></flux:input.group>

Input group labels

If you want to use an input group in a form field with a label, you will need to wrap the input group in a field component.

Website
https://
<flux:field>    <flux:label>Website</flux:label>    <flux:input.group>        <flux:input.group.prefix>https://</flux:input.group.prefix>        <flux:input wire:model="website" placeholder="example.com" />    </flux:input.group>    <flux:error name="website" /></flux:field>
Copyright © 2025 Wireable LLC ·Terms of Service
Built with by
Caleb Porzio and Hugo Sainte-Marie