Type alias SwitchProps

SwitchProps: {
    className?: string;
    hasError?: boolean;
    id?: string;
    isChecked?: boolean;
    isDisabled?: boolean;
    onChange?: ((event) => void);
}

Type declaration

  • Optional className?: string

    Additional css classes to help with unique styling of the switch

  • Optional hasError?: boolean

    True when (input related to) switch is erroneous

    Default

    false
    
  • Optional id?: string

    Optional unique identifier

  • Optional isChecked?: boolean

    If true, the component is checked.

  • Optional isDisabled?: boolean

    Enabled status of switch

    Default

    false
    
  • Optional onChange?: ((event) => void)

    Callback fired when the state is changed.

      • (event): void
      • Parameters

        • event: ChangeEvent<HTMLInputElement>

          The event source of the callback. You can pull out the new value by accessing event.target.value (string). You can pull out the new checked state by accessing event.target.checked (boolean).

        Returns void