Ultraviolet Form is an extension of Ultraviolet UI including everything to build forms using React. It is using React Hook Form under the hood.
$ pnpm add @ultraviolet/form @emotion/react @emotion/styled
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>
)
}
Checkout our documentation website.