gov-form-switch
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
checked | checked | Switch button state | boolean | false |
disabled | disabled | Makes the switch component disabled. | boolean | false |
identifier | identifier | Custom switch identifier. | string | undefined |
invalid | invalid | Indicates the entered value does not conform to the format expected by the application. | boolean | undefined |
name | name | Name of the switch. | string | undefined |
noLabel | no-label | When you can't use the form label. | boolean | false |
required | required | Set whether the input is required or not. Please note that this is necessary for accessible inputs when the user is required to fill them. | boolean | false |
size | size | Switch's size. | "l" | "m" | "s" | "xl" | "xs" | "m" |
value | value | Value of switch | string | undefined |
Events
| Event | Description | Type |
|---|---|---|
gov-blur | Emitted when the switch loses focus. | CustomEvent<FormSwitchEvent> |
gov-change | Emitted when the switch change value. | CustomEvent<FormSwitchEvent> |
gov-focus | Emitted when the switch has focus. | CustomEvent<FormSwitchEvent> |
Methods
getRef() => Promise<HTMLInputElement>
Returns the reference of the native element
Returns
Type: Promise<HTMLInputElement>
Dependencies
Used by
Depends on
Graph
Built with StencilJS