Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 879 Bytes

File metadata and controls

35 lines (24 loc) · 879 Bytes

PrimitiveCheckbox

Static checkbox for usage outside forms as visual indicator without focusing and clicking

Props

All available props see in PrimitiveCheckbox.props.ts

Figma

Component in figma project

Usage

<template>
  <primitive-checkbox :value="value">
    <input type="checkbox" :checked="value" @change="onChange" />
  </primitive-checkbox>
</template>

<script setup lang="ts">
import { PrimitiveCheckbox } from '@tok/ui/components/PrimitiveCheckbox';
import { ref } from 'vue';

const value = ref(false);

const onChange = (event: Event) => {
  const target = event.target as HTMLInputElement;
  const _value = target.value;

  // manipulate with _value
};
</script>