Select base theme

Select color scheme

Toggle dark mode

GitHub repository

Input

A text input component for forms and user data entry with built-in styling and accessibility features.

Your API key is encrypted and stored securely.

Basic

Field

Use Field, FieldLabel, and FieldDescription to create an input with a label and description.

Choose a unique username for your account.

Field Group

Use FieldGroup to show multiple Field blocks and to build forms.

We'll send updates to this address.

Disabled

Use the disabled prop to disable the input.

This field is currently disabled.

Invalid

Use the invalid prop to use invalid styling.

This field contains validation errors.

File

Select a picture to upload.

Inline

Use a horizontal Field to create an inline input. Pair with a Button to create a search input with a button.

Grid

Use a grid layout to place multiple inputs side by side.

Required

Use the required prop to indicate required fields.

This field must be filled out.

Badge

Use a Badge in the label to highlight a recommended field.

Input Group

To add icons, text, or buttons inside an input, use the InputGroup component.

https://

Button Group

To add buttons to an input, use the ButtonGroup component.

Form

A full form example with multiple inputs, a select, and a button.

We'll never share your email with anyone.

Anatomy

Import all parts and piece them together.

use leptos::prelude::*;
use singlestage::*;

#[component]
pub fn InputAnatomy() -> impl IntoView {
    view! { <Input /> }
}

API Reference

Input

A form input field.

Custom Attributes
NameTypeDefaultDescription
defaultString""

Sets the default value of the element. Setting `value` sets this once at page load. Use this for subsequent updates.

input_typeString""

Renamed <input> `type` attribute to avoid name collisions.

invalidboolfalse

Toggle whether or not the input is disabled.

valueString""

A reactive signal coupled to the input's value.

Implements global and input attributes.