跳到主要内容

Form controls

Give textual form controls like <input>s and <textarea>s an upgrade with custom styles, sizing, focus states, and more.

Example

For textual form controls—like inputs and textareas—use the FormControl component. FormControl adds some additional styles for general appearance, focus state, sizing, and more.

结果
Loading...
实时编辑器

Sizing

Use size on <FormControl> to change the size of the input.

结果
Loading...
实时编辑器

Disabled

Add the disabled prop on an input to give it a grayed out appearance and remove pointer events.

结果
Loading...
实时编辑器

Readonly

Add the readOnly prop on an input to prevent modification of the input's value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.

结果
Loading...
实时编辑器

Readonly plain text

If you want to have readonly elements in your form styled as plain text, use the plaintext prop on FormControls to remove the default form field styling and preserve the correct margin and padding.

结果
Loading...
实时编辑器

File input

结果
Loading...
实时编辑器

Color

结果
Loading...
实时编辑器

API

FormControl