Hanzo GUI

Form

A simple form component for native and web

  • Works on native and web.
  • Outputs accessible forms.
  • Works with every Hanzo GUI prop.

Installation

Form is already installed in @hanzo/gui, or you can install it independently:

npm install @hanzogui/form

Anatomy

import { Form } from '@hanzo/gui' // or '@hanzogui/form'

export default () => (
  <Form>
    {/* ... */}
    <Form.Trigger asChild>
      <Button />
    </Form.Trigger>
  </Form>
)

API Reference

Form

PropTypeDefaultRequired
onSubmit() => void-

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 Hanzo GUI Props.

Last updated on

On this page