Themes

Fields/Components/es-switch-field
es-switch-field

A switchable switch field.

Props

Name
Description
Type
Default
activeIcon

Icon to display when switch is on in high contrast mode.

[namespace: string
or
symbol, name: string]
or
string
or
undefined
activeText

Text to display when switch is on in high contrast mode.

string
or
undefined
disabled

If the field is disabled.

boolean
or
undefined
inactiveIcon

Icon to display when switch is off in high contrast mode.

[namespace: string
or
symbol, name: string]
or
string
or
undefined
inactiveText

Text to display when switch is off in high contrast mode.

string
or
undefined
invalid

If the field is currently in an error state.

boolean
or
undefined
label

The label of the field.

string
messages

The validation messages of the field

ValidationMessages
or
undefined
name

The name of the field.

string
readonly

If the field is editable.

boolean
or
undefined
value

The current value of the field.

boolean

ValidationMessages

Name
Description
Type
children
Record<number, Record<Severity, ValidationMessage[]>>
error
ValidationMessage[]
info
ValidationMessage[]
warning
ValidationMessage[]

Events

Event
Detail
Description
fieldchange
FieldChange<boolean>

Emitted when the value of the field is changed.

Methods

Name
Signature
Description
setPending
setPending(pending: boolean) => Promise<void>

Allows you to pause interaction with the input while an operation completes.

CSS Variables

Name
Description
--field-grid-columns

The field layout.