Skip to content

Checklist ​

The checklist input type renders a multi-select checkbox list. It supports flat items, grouped/treeview layouts, and cascade filtering. The value stored is an array of selected itemValue values.

Files:

  • PHP: src/Hydrates/Inputs/ChecklistHydrate.php
  • Vue: vue/src/js/components/inputs/Checklist.vue

Hydrate ​

Class: ChecklistHydrate
Config type: checklist
Output type: input-checklist

The hydrate sets type to input-checklist and applies the default requirements. Items can be provided statically or loaded via connector.

Default Requirements ​

KeyDefaultDescription
itemValue'id'Field used as the stored value
itemTitle'name'Field displayed for each item
default[]No items selected by default
cascadeKey'items'Key used when cascading filtered items

Config Usage ​

Static items ​

php
[
    'type'      => 'checklist',
    'name'      => 'permissions',
    'label'     => 'Permissions',
    'items'     => [
        ['id' => 1, 'name' => 'Read'],
        ['id' => 2, 'name' => 'Write'],
        ['id' => 3, 'name' => 'Delete'],
    ],
]

Remote items via connector ​

php
[
    'type'      => 'checklist',
    'name'      => 'category_ids',
    'label'     => 'Categories',
    'connector' => 'Blog:Category|repository:list',
]

With selected label ​

php
[
    'type'          => 'checklist',
    'name'          => 'country_ids',
    'label'         => 'Select Countries',
    'selectedLabel' => 'Selected Countries',
    'connector'     => 'Location:Country|repository:list',
]

Treeview (grouped items) ​

Set isTreeview: true and ensure items have a nested items key for child groups.

php
[
    'type'       => 'checklist',
    'name'       => 'region_ids',
    'label'      => 'Regions',
    'isTreeview' => true,
    'connector'  => 'Location:Region|repository:list:withs=children',
]

Vue Component ​

Component: VInputChecklist (v-input-checklist)
File: vue/src/js/components/inputs/Checklist.vue

Renders checkboxes in a responsive grid. Supports flat list, grouped treeview, card style, and max selection limit.

Props ​

PropTypeDefaultDescription
modelValueArray[]Selected values (array of itemValue)
itemsArray[]List of item objects
itemValueString'id'Key used as the checkbox value
itemTitleString'name'Key used as the checkbox label
labelStringnullInput label shown above checkboxes
subtitleStringnullSecondary label shown below the main label
labelColorString'grey-darken-1'Label text color
subtitleColorString'grey-darken-1'Subtitle text color
disabledBooleanfalseDisable all checkboxes
readonlyBooleanfalseMake all checkboxes read-only
isTreeviewBooleanfalseRender items as a collapsible treeview
isCardBooleanfalseRender each item as a card instead of a plain checkbox
maxNumber|StringnullMaximum number of selectable items
mandatoryStringnullDot-path key on each item; if truthy, that item cannot be deselected
flexColumnBooleantrueLay out label and checkboxes side-by-side on md+ screens
checkboxPositionString'right''left' or 'right' — side the checkbox icon appears
checkboxHighlightedBooleanfalseHighlight selected checkbox rows with a background
checkboxHighlightedColorString'grey-lighten-5'Background color when highlighted
checkboxColObject{ cols:3, sm:6, md:4, lg:3 }Vuetify column breakpoints for each checkbox
orderByStringnullItem key to sort by
orderByDirectionString'asc''asc' or 'desc'
chunkFieldStringnullGroup items by this field key
chunkCharacterString'_'Delimiter used to auto-detect groups from itemTitle
chunkTitleKeyString'name'Key used when deriving group labels
truncateItemLabelBooleanfalseTruncate long labels with ellipsis
noGroupAllSelectableBooleanfalseHide the "select all" checkbox on treeview group headers
hasGroupBottomDividerBooleantrueShow a divider below each group header in treeview
openAllGroupsBooleanfalseExpand all treeview groups on mount
closeAllGroupsBooleanfalseCollapse all treeview groups on mount
cardStatsArray[]Stat definitions { key, label } shown inside each card item
groupExpandGapString'4'Gap between treeview groups (Vuetify spacing unit)
groupExpandTitlePropsObject{}Extra props passed to group header title when chunkField is set

Behavior ​

  • Max selection — when max is set (or inferred from rules: 'max:N'), checkboxes disable once the limit is reached. Mandatory items are always pre-selected and cannot be deselected.
  • Treeview — when isTreeview: true, items must have a nested items array. Group headers get a "select all" checkbox; openAllGroups / closeAllGroups control initial state.
  • Card mode — when isCard: true, each item renders as a VInputCheckboxCard. Use cardStats to show metric values inside each card.
  • Grouping without treeview — when chunkField is set, flat items are grouped by that field value. Alternatively, chunkCharacter splits itemTitle on a delimiter to infer group names.

See Also ​