4.1.1 • Published 5 years ago
@usercentric/uc-design-system-forms v4.1.1
UCDS Forms
Provides a robust form management layer powered by final-form.
yarn add @usercentric/uc-design-system-formsUsage
The package provides a Form component, that utilizes React context and final-form to manage the
state of all fields within itself. To operate correctly, all field components provided in the core
package have an equivalent component in this package that automatically connects to the parent form
instance, they are: Autocomplete, CheckBox, CheckBoxController, DatePickerInput,
DateTimeSelect, Input, RadioButtonController, Select, Switch, TextArea, and much more.
import Form, { Input, Select } from '@usercentric/uc-design-system-forms'
;<Form onSubmit={this.handleSubmit}>
<Input name="name" label="Name" />
<Select name="fruit" label="Fruit">
<option value="apple">Apple</option>
<option value="banana">Banana</option>
<option value="orange">Orange</option>
<option value="other">Other</option>
</Select>
</Form>