Mixins / foldkit-mixins-ui

OtpFieldView

interface · packages/mixins-ui/src/otpField.ts:29

interface OtpFieldView<Message> {
  readonly id?: string | undefined
  readonly name?: string | undefined
  readonly label: string
  readonly length?: number | undefined
  readonly value: string
  readonly onChange: (value: string) => NoInfer<Message>
  readonly pattern?: keyof typeof PATTERNS | undefined
  readonly groups?: ReadonlyArray<number> | undefined
  readonly disabled?: boolean | undefined
  readonly readOnly?: boolean | undefined
  readonly invalid?: boolean | undefined
  readonly mask?: boolean | string | undefined
  readonly style?: NamedStyle<typeof OtpFieldSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

Members

OtpFieldView.id

property · packages/mixins-ui/src/otpField.ts:31

readonly id?: string | undefined

The input's id, for a label or a form to name it.

OtpFieldView.name

property · packages/mixins-ui/src/otpField.ts:33

readonly name?: string | undefined

The form field the code submits under.

OtpFieldView.label

property · packages/mixins-ui/src/otpField.ts:35

readonly label: string

The field's accessible name: what the code is for.

OtpFieldView.length

property · packages/mixins-ui/src/otpField.ts:37

readonly length?: number | undefined

How many characters the code has. Default 6.

OtpFieldView.value

property · packages/mixins-ui/src/otpField.ts:38

readonly value: string

OtpFieldView.onChange

property · packages/mixins-ui/src/otpField.ts:40

readonly onChange: (value: string) => NoInfer<Message>

The Message for what was typed, already kept to the pattern and length.

OtpFieldView.pattern

property · packages/mixins-ui/src/otpField.ts:42

readonly pattern?: keyof typeof PATTERNS | undefined

Which characters a cell takes; default digits.

OtpFieldView.groups

property · packages/mixins-ui/src/otpField.ts:44

readonly groups?: ReadonlyArray<number> | undefined

The cells in runs, a separator between them: [3, 3]. Default one run.

OtpFieldView.disabled

property · packages/mixins-ui/src/otpField.ts:45

readonly disabled?: boolean | undefined

OtpFieldView.readOnly

property · packages/mixins-ui/src/otpField.ts:47

readonly readOnly?: boolean | undefined

The code can be read and copied, not typed.

OtpFieldView.invalid

property · packages/mixins-ui/src/otpField.ts:49

readonly invalid?: boolean | undefined

The code is refused: the input is aria-invalid, and each cell carries data-invalid.

OtpFieldView.mask

property · packages/mixins-ui/src/otpField.ts:55

readonly mask?: boolean | string | undefined

Hide the code: the input is a password field and each filled cell shows a dot (mask of true), or the mark given. The value the application holds is the real one.

OtpFieldView.style

property · packages/mixins-ui/src/otpField.ts:57

readonly style?: NamedStyle<typeof OtpFieldSlots> | undefined

A style of OtpFieldSlots, for the field's look.

OtpFieldView.mixins

property · packages/mixins-ui/src/otpField.ts:59

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.