Ga naar hoofdinhoud

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…

CnFacetSidebar showing search and filter tabs

Props

PropTypeDefaultDescription
schemaObject(required)Schema with facetable properties
facetDataObject{}Live facet data with field names as keys, each containing a values array with value/count pairs
activeFiltersObject{}Current active filters with field names as keys and value or value arrays
loadingBooleanfalseLoading state
titleString'Filters'Sidebar title
clearLabelString'Clear all'Clear all button label
userIsAdminBooleantrueWhether the current user is an admin. When false, schema properties with adminOnly: true are hidden from the filter list.

Events

EventPayloadDescription
filter-change{ key, values }Filter changed (values is always an array)
clear-allClear 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

NameTypeRequiredDefaultDescription
schemaobjectnullSchema definition — reads facetable properties
facetDataobject\{\}Live facet data from API: { fieldName: { values: [{value, count}] } }
activeFiltersobject\{\}Current active filters: { fieldName: value | [values] }
loadingbooleanfalseWhether facet data is loading
titlestring() =&gt; t('nextcloud-vue', 'Filters')Sidebar title
clearLabelstring() =&gt; t('nextcloud-vue', 'Clear all')Clear all button label
userIsAdminbooleantrueWhether the current user is an admin. When false, schema properties with adminOnly: true are hidden from filters.

Events

NamePayloadDescription
clear-all
filter-change