CnFacetSidebar
Auto-generated faceted search sidebar from schema. Renders filter controls for properties marked as facetable, with live counts from the API.
Wraps: NcButton, NcSelect, NcTextField, NcCheckboxRadioSwitch, NcLoadingIcon
Try it
Loading CnFacetSidebar playground…

Props
| Prop | Type | Default | Description |
|---|---|---|---|
schema | Object | (required) | Schema with facetable properties |
facetData | Object | {} | Live facet data with field names as keys, each containing a values array with value/count pairs |
activeFilters | Object | {} | Current active filters with field names as keys and value or value arrays |
loading | Boolean | false | Loading state |
title | String | 'Filters' | Sidebar title |
clearLabel | String | 'Clear all' | Clear all button label |
userIsAdmin | Boolean | true | Whether the current user is an admin. When false, schema properties with adminOnly: true are hidden from the filter list. |
Events
| Event | Payload | Description |
|---|---|---|
filter-change | { key, values } | Filter changed (values is always an array) |
clear-all | — | Clear all button clicked |
Usage
<template>
<CnFacetSidebar
:schema="schema"
:facet-data="facets"
:active-filters="activeFilters"
@filter-change="onFilterChange"
@clear-all="onClearAll" />
</template>
Reference (auto-generated)
The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnFacetSidebar.vue and update automatically whenever the component changes.
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
schema | object | null | Schema definition — reads facetable properties | |
facetData | object | \{\} | Live facet data from API: { fieldName: { values: [{value, count}] } } | |
activeFilters | object | \{\} | Current active filters: { fieldName: value | [values] } | |
loading | boolean | false | Whether facet data is loading | |
title | string | () => t('nextcloud-vue', 'Filters') | Sidebar title | |
clearLabel | string | () => t('nextcloud-vue', 'Clear all') | Clear all button label | |
userIsAdmin | boolean | true | Whether the current user is an admin. When false, schema properties with adminOnly: true are hidden from filters. |
Events
| Name | Payload | Description |
|---|---|---|
clear-all | — | |
filter-change | — |