Skip to content

WeDtCheckboxFilter

A compact and intuitive toggle-style filter component that behaves like a checkbox. It supports highlighted states, raw value output, and direct integration with WeDataTable filter.

vue
<template>
  <WeDtCheckboxFilter
    v-model="filters.enabled"
    label="Enabled"
  />
</template>

<script setup>
const filters = ref({
  enabled: null,
})
</script>

Modes

The component can work in two modes:

  1. Structured filter mode (default)

Emits an object like:

vue
{
  operator: '=',
  value: true
}
  1. Raw value mode

By enabling emitRawValue = true, the component emits only the toggled raw value without wrapping it in a filter object.

Props

PropTypeDefaultDescription
labelStringnullLabel shown next to the checkbox
emitRawValueBooleanfalseWhen true, v-model returns only the raw toggled value
trueValueanytrueValue assigned when the component is toggled on
falseValueanynullValue assigned when toggled off