Unform

Usage with Styled Components

Usage with Styled Components

With Unform you create your components for input sources. You can customize the inputs with any styling library you want or even with pure CSS.

When using Unform in the Web, <Form /> component automatically renders an HTML form, and you can style it using any library or pure CSS as well.

Using classNames

1export default function MyForm() {
2 return <Form className="my-form">...</Form>
3}

Using Styled Components

styles.js
1import styled from 'styled-components'
2import { Form as Unform } from '@unform/web'
3
4export const Form = styled(Unform)`
5 // Form CSS
6`
MyForm.js
1import { Form } from './styles'
2
3export default function MyForm() {
4 return <Form>...</Form>
5}
Edit this page on GitHub