Skip to content

Checkbox Card ​

VInputCheckboxCard is a card-style selectable item used for multi-select UIs. Clicking the card toggles the value in/out of the modelValue array. There is no corresponding PHP hydrate — this component is used directly in Vue templates.

Vue Component ​

Registered as: VInputCheckboxCardFile: vue/src/js/components/inputs/CheckboxCard.vue

Props ​

PropTypeDefaultDescription
modelValueArray—Array of currently selected values (v-model)
valueString | NumbernullThe value this card represents; toggled in/out of modelValue
titleString(required)Card heading text
descriptionString''Optional body text below the title
statsArraynullArray of { label, value, color? } stat blocks shown at the bottom
disabledBooleanfalseDisables click and dims the card
readonlyBooleanfalsePrevents value changes without dimming
checkboxColorString'primary'Vuetify color of the embedded checkbox
activeColorStringnullCard background color when selected
activeTitleColorStringnullTitle text color when selected
checkboxOnRightBooleanfalsePlaces the checkbox in the card's append slot instead of prepend

Usage ​

vue
<VInputCheckboxCard
  v-model="selectedPlans"
  :value="plan.id"
  :title="plan.name"
  :description="plan.description"
  :stats="[
    { label: 'Users', value: plan.users, color: 'primary' },
    { label: 'Storage', value: plan.storage, color: 'success' },
  ]"
  checkboxColor="success"
/>

Behaviour ​

  • The component operates on an array modelValue. Clicking toggles value in or out of that array using Array.includes / Array.filter.
  • When value is in modelValue the card switches to elevated variant and applies border-primary; otherwise it uses outlined with border-grey-lighten-4.
  • stats renders a responsive grid of metric blocks inside a v-card-text at the bottom of the card. Each stat takes equal column width.

See Also ​