Form
Form manages values, validation, and submission state for a group of inputs.
Source
LLM docs
Package
Examples
1
Properties
36
Hooks
2
Playground
Basics
Form manages values, validation, and submission state. Give each Form.Field a name and put a Form.Input inside it (it binds to that field's value, change handler and error), then trigger submission with Form.Submit.Loading demo…
import { Block, Form } from '@plocks/ui';
export function Demo() {
return (
<Form
initialValues={{ name: '', email: '' }}
onSubmit={(values) => console.log('submit', values)}
>
<Block style={{ width: '100%', maxWidth: 400 }}>
<Form.Field name="name">
<Form.Input label="Full name" placeholder="Ada Lovelace" />
</Form.Field>
<Form.Field name="email">
<Form.Input label="Email" placeholder="ada@example.com" />
</Form.Field>
<Form.Submit>Create account</Form.Submit>
</Block>
</Form>
);
}React Native design for iOS, Android, and Web.
Quick Links
Resources