Usage
import { Form } from 'nr1'
Examples
Props
Form fields to display.
Appends class names to the component.
Should be used only for positioning and spacing purposes.
Form .LAYOUT_TYPE .NORMAL
Layout of the form:
- Form.LAYOUT_TYPE.NORMAL: The form fields will be aligned vertically
- Form.LAYOUT_TYPE.SPLIT: Except for Radio and Checkbox components, the form field labels will be placed on the left side and the input on the right.
The SPLIT
layout supports various sizes which can be specified
through the splitSizeType
prop.
<One ofForm.LAYOUT_TYPE.NORMAL,Form.LAYOUT_TYPE.SPLIT,>
Spacing property. Spacing is defined as a tuple of zero to four
values, which follow the same conventions as CSS properties like
margin
or padding
. To omit a value, use SPACING_TYPE.OMIT
.
<Array of<One ofForm.SPACING_TYPE.EXTRA_LARGE,Form.SPACING_TYPE.LARGE,Form.SPACING_TYPE.MEDIUM,Form.SPACING_TYPE.NONE,Form.SPACING_TYPE.OMIT,Form.SPACING_TYPE.SMALL,>
>
Form .SPLIT_SIZE_TYPE .MEDIUM
Specifies the size of the columns when using the split layout.
<One ofForm.SPLIT_SIZE_TYPE.LARGE,Form.SPLIT_SIZE_TYPE.MEDIUM,Form.SPLIT_SIZE_TYPE.SMALL,>
Inline style for custom styling.
Should be used only for positioning and spacing purposes.
Adds a data-test-id
attribute. Use it to target the component in unit and
E2E tests.
For a test id to be valid, prefix it with your nerdpack id, followed up by a dot.
For example, my-nerdpack.some-element
.
Note: You might not see data-test-id
attributes as they are removed
from the DOM, to debug them pass a e2e-test
query parameter to the URL.