Reference

Toggle Field

<k-toggle-field>

<k-toggle-field v-model="toggle" label="Toggle" name="toggle" />

Props

autofocus

Boolean (default: false)

If true, the field will be instantly focused when the form is created

disabled

Boolean (default: false)

If true, the field is disabled and cannot be filled in or edited

help

String (default: null)

Sets the help text below the field

icon

String (default: null)

Sets the icon, that is shown on the right next to the input.

label

String (default: null)

Sets the label text for the field.

name

String (default: null)

The name of the field must be defined to get fields in fieldsets up and running.

required

Boolean (default: false)

If true, the field must not be empty

text

String|Array (default: ['off', 'on'])

The text to display next to the toggle. This can either be a string that doesn't change when the toggle switches. Or an array with the first value for the false text and the second value for the true text.

value / v-model

Boolean (default: null)

Methods

focus()

The focus event can be used to set the focus on the field.

Events

@input

The input event is triggered when the value changes.

CSS class

.k-toggle-field