Skip to content

SkInputCheckbox

A customizable checkbox input component with optional label placement on the left or right.

Example Usage

Example

false

With Choices

[]
vue
<template>
  <sk-input-checkbox v-model="value" placement="left" label="True / False Trigger" class="mb-m" />
  <sk-input-checkbox
    v-model="value"
    placement="left"
    label="True / False Trigger"
    :disabled="true"
    class="mb-m"
  />
  {{ value }}
  <h3>With Choices</h3>
  <sk-input-checkbox v-model="value2" label="Cheese" value="Cheese" class="mb-m" />
  <sk-input-checkbox v-model="value2" label="Salami" value="Salami" class="mb-m" />
  <sk-input-checkbox v-model="value2" label="Bread" value="Bread" class="mb-m" />
  {{ value2 }}
</template>

<script setup>
import { ref } from 'vue';

const value = ref(false);
const value2 = ref([]);
</script>

Reference

Properties

NameTypeDefaultDescription
v-modelBoolean, ArrayfalseThe current value of the checkbox, for binding.
binaryBooleantrueWhether the checkbox represents a binary true/false value.
labelString'' (empty)Optional label for the checkbox.
valueString, Number, BooleanundefinedThe value to be emitted on selection, useful for non-binary checks.
placementString'right'Determines the placement of the label ('left' or 'right').
disabledBooleanfalseDisables the checkbox if set to true.

Events

NameParametersDescription
@inputeventEmitted when the checkbox value changes.
@update:modelValueeventEmitted with the new value when it changes.