Form
A simple form component for native and web
Features
Works on native and web.
Outputs accessible forms.
Works with every Tamagui prop.
Installation
Form is already installed in tamagui, or you can install it independently:
yarn
npm
bun
pnpm
yarn add @tamagui/form
Anatomy
import { Form } from 'tamagui' // or '@tamagui/form'export default () => (<Form>{/* ... */}<Form.Trigger asChild><Button /></Form.Trigger></Form>)
API Reference
Form
Props
onSubmit (required)
() => void
Must use `Form.Trigger` to ensure `onSubmit` will be called.
Form.Trigger
Wrap this around your submitting element to make the form submit. We recommend using asChild to a child element of your choosing for more control.
Accepts Tamagui Props.