Input

A text field is an input field that users can type into. This component uses Radix's text field component.

Overview

The TextField component is used to capture user input and can include an optional slot for buttons and icons. It is based on the

element and supports common margin props.

Basic Example

Stateful Example with Blur Event

Hello World!

Controlled Example

Hello World!

Real World Example

The Less I Know

Rock

Breathe Deeper

Rock

Let It Happen

Rock

Borderline

Pop

Lost In Yesterday

Rock

Is It True

Rock

API Reference

rx.input

Captures user input with an optional slot for buttons and icons.

PropType | ValuesDefaultInteractive
size
"1" | "2" | ...
variant
"classic" | "surface" | ...
color_scheme
"tomato" | "red" | ...
radius
"none" | "small" | ...
auto_complete
bool
default_value
str
disabled
bool
max_length
int
min_length
int
name
str
placeholder
str
read_only
bool
required
bool
type
str
value
Union[str, int, float]
list
str
accept
str
alt
str
auto_focus
bool
capture
"True" | "False" | ...
checked
bool
default_checked
bool
form
str
form_action
str
form_enc_type
str
form_method
str
form_no_validate
bool
form_target
str
max
Union[str, int, float]
min
Union[str, int, float]
multiple
bool
pattern
str
src
str
step
Union[str, int, float]

Event Triggers

See the full list of default event triggers
TriggerDescription
on_focus Fired when the textarea is focused.
on_blur Fired when the textarea is blurred.
on_key_down Fired when a key is pressed down.
on_key_up Fired when a key is released.
on_change Fired when the value of the textarea changes.

rx.input.slot

Contains icons or buttons associated with an Input.

PropType | ValuesDefaultInteractive
color_scheme
"tomato" | "red" | ...

Built with Reflex