Skip to content

Kirby 3.5.7.1

Checkboxes Input

<k-checkboxes-input>

<k-input
    type="checkboxes"
    v-model="value"
    :options="[
        { value: 'a', text: 'Option A' },
        { value: 'b', text: 'Option B' }
    ]"
    :required="true"
    :min="2"
    :max="5"
    @input="input"
/>

Props

autofocus

Boolean (default: false)

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

disabled

Boolean (default: false)

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

id

String (default: null)

The id for the input element.

max

Number (default: null)

The maximum number of allowed selections.

min

Number (default: null)

The minimum number of required selections

options

Array (default: null)

Defines all options that are available. Options must be defined as an array of objects:

[
  { value: 'a', text: 'Option A' },
  { value: 'b', text: 'Option B' },
  { value: 'c', text: 'Option C' }
]

required

Boolean (default: false)

If true, the input must not be empty

theme

String (default: null)

By default, inputs are as unstyled as possible to provide a clean boilerplate. If you need the typical field input look, you can set the theme to field

value / v-model

Array | String (default: null)

The value for the input should be provided as array. Each value in the array corresponds with the value in the options. If you provide a string, the string will be split by comma.

Methods

focus()

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

Events

@input

The input event is triggered when the value changes.

@invalid

The invalid event is triggered when the input validation fails. This can be used to react on errors immediately.

CSS class

.kirby-checkboxes-input