Common Form Attributes
Common form attributes are attributes that are shared by a variety of elements.
import { View, Text, TextInput } from '@react-pdf/renderer';
const field = { height: 18, borderWidth: 1, borderColor: '#c9c2b6' };
const label = { fontSize: 9, color: '#3e3e3e', marginBottom: 4 };
const Reference = () => (
<View>
<Text style={label}>Reference</Text>
<TextInput
name="ref"
value="INV-0042"
defaultValue="INV-0042"
required
readOnly
style={field}
/>
</View>
);Show previewHide preview
Supported attributes
| Prop name | Description | Type | Default |
|---|---|---|---|
| name | Describes the name of the specific element when submitting the form | String | empty |
| required | Describes if the specific element needs to have a value when submitting the form | Boolean | false |
| noExport | If set to true the specific element is not exported at a form submission | Boolean | false |
| readOnly | Defines if the specific element is editable or not. If set to true, the user shall not edit the value. | Boolean | false |
| value | Defines the value of the specific element. For further information look at the element. | String, Number | undefined |
| defaultValue | Describes what the default state for the value is. Can be used when resetting the form. | String, Number | undefined |