Skip to main content

FormInput

Stentor API Reference


Stentor API Reference / stentor-models/src / FormInput

Interface: FormInput

Defined in: packages/stentor-models/src/Form/FormField.ts:75

Form field base class

Extended by​

Properties​

name​

name: string

Defined in: packages/stentor-models/src/Form/FormField.ts:81

Name of the form input, this is not human readable and is used to identify the field.

For example: "SERVICE" or "FULL_NAME"


title?​

optional title?: string

Defined in: packages/stentor-models/src/Form/FormField.ts:85

Optional title used to display on the input


type​

type: "CARD" | "TEXT" | "DROPDOWN" | "CHECK" | "CHIPS" | "DATE" | "DATERANGE" | "DATETIME"

Defined in: packages/stentor-models/src/Form/FormField.ts:89

Type of the input


shape?​

optional shape?: "ROUND" | "SQUARE"

Defined in: packages/stentor-models/src/Form/FormField.ts:93

Optional, used to shape the input. Not applicable to all inputs.


condition?​

optional condition?: string

Defined in: packages/stentor-models/src/Form/FormField.ts:100

A condition that must be met for the field to be shown.

For example: "issue === 'service_repair'" - issue is a field name in this example


mandatory?​

optional mandatory?: boolean

Defined in: packages/stentor-models/src/Form/FormField.ts:104

Is the field required.


mandatoryError?​

optional mandatoryError?: string

Defined in: packages/stentor-models/src/Form/FormField.ts:108

Error message to show when the field is required but not filled out.


mandatoryGroup?​

optional mandatoryGroup?: string

Defined in: packages/stentor-models/src/Form/FormField.ts:112

Group fields together where one of the fields in the group is required.


style?​

optional style?: object

Defined in: packages/stentor-models/src/Form/FormField.ts:118

React.CSSProperties style object to apply to the field.

For example: {{ width: '300px', height: '150px' }}