@ultraviolet/form
TypeScript icon, indicating that this package has built-in type declarations

3.8.2 • Public • Published

Ultraviolet Form

npm version

Ultraviolet Form is an extension of Ultraviolet UI including everything to build forms using React. It is using React Hook Form under the hood.

Get Started

$ pnpm add @ultraviolet/form @emotion/react @emotion/styled

Usage

To use the library you need to put a ThemeProvider from @emotion/react with the theme that comes from @ultraviolet/ui then wrap all your fields inside a Form:

import { ThemeProvider } from '@emotion/react'
import { Form, TextInputField } from '@ultraviolet/form'
import { theme } from '@ultraviolet/ui'
import { useForm } from '@ultraviolet/form'

export default function App() {
  const methods = useForm()
  return (
    <ThemeProvider theme={theme}>
      <Form methods={methods}>
        <TextInputField name="example" />
      </Form>
    </ThemeProvider>
  )
}

Documentation

Checkout our documentation website.

/@ultraviolet/form/

    Package Sidebar

    Install

    npm i @ultraviolet/form

    Weekly Downloads

    2,662

    Version

    3.8.2

    License

    Apache-2.0

    Unpacked Size

    137 kB

    Total Files

    104

    Last publish

    Collaborators

    • phiphi
    • mprost
    • scaleway-bot