Input Field
The Input Field component is an enhanced wrapper for the native HTML <input> element. It provides built-in functionality for real-time character filtering.
Props
Prop | Type | Default | Description |
|---|---|---|---|
value | string | '' | The input's bound value. |
type | 'text' | 'password' | 'textarea' | 'text' | The type of the input field. |
characterFilter | string[] | undefined | Array of allowed characters. If set, other characters are rejected. |
class | string | '' | CSS classes to apply to the input. |
overrideDefaultStyling | boolean | false | If true, removes the base fluid-input-field class. |
...rest | HTMLInputAttributes | — | Standard HTML <input> attributes. |
Samples
Basic Text
Standard text input with reactive binding.
Value:
0
<InputField 1
placeholder="Enter your name" 2
bind:value={textValue} 3
class="w-full"4
/>Password
Secure entry for passwords and sensitive data.
Value:
0
<InputField1
type="password"2
placeholder="Enter password"3
bind:value={passwordValue}4
class="w-full"5
/>Textarea
Multiline text input for longer messages.
Value:
0
<InputField1
type="textarea"2
placeholder="Enter your message..."3
bind:value={textAreaValue}4
class="w-full h-32"5
/>Numeric Only
Using characterFilter to restrict input to digits.
Value:
0
<InputField1
placeholder="Numbers only..."2
bind:value={numericValue}3
characterFilter={['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']}4
class="w-full"5
/>Error State
Applying custom error styling for validation feedback.
Value: invalid-email@
0
<InputField1
class="w-full fluid-input-field-error"2
placeholder="Error styling"3
bind:value={errorValue}4
/>