Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ControlledInput<Data, Key, Render>

Interact with a single form field.

Type parameters

  • Data

  • Key: keyof Data = keyof Data

  • Render: any = Data[Key]

Hierarchy

  • ControlledInput

Index

Properties

aria-label

aria-label: string

Aria label for the field. Is either the name or the name merged with the supplied ariaModel.

bind

bind: { aria-label: string; id: string; name: Key; value: Render; onChange: any }

Bind to an input

Type declaration

  • aria-label: string

    Aria label for the field. Is either the name or the name merged with the supplied ariaModel.

  • id: string

    Same as the aria label.

  • name: Key

    The fields name.

  • value: Render

    The current value of the field.

  • onChange:function
    • onChange(e: any): void
    • THe default on change handler. Takes e.target.value and uses it as the new field value.

      Parameters

      • e: any

      Returns void

field

field: Key

The field controlled by these functions.

value

value: Render

The fields current value.

Methods

label

  • label(): { htmlFor: string }
  • Returns the binding for a label.

    e.g. `<label {...label('field)}>Field

    Returns { htmlFor: string }

    • htmlFor: string

update

  • update(newValue: Render): void

valid

  • valid(): boolean

Generated using TypeDoc