Skip to main content

CnIndexSidebar

Schema-driven right sidebar with tabs for search, faceted filters, and column visibility. Typically used alongside CnIndexPage.

Wraps: NcAppSidebar, NcAppSidebarTab, NcTextField, NcSelect, NcCheckboxRadioSwitch, NcPopover. See NcAppSidebar for the underlying primitive.

Try it

Loading CnIndexSidebar playground…

CnIndexSidebar showing Search tab with search input and filter dropdowns for Industry and Client type

Anatomy

+-------------------------------+
| [icon] Entity Title [×] | ← header: schema icon + title + close button
+-------------------------------+
| [🔍 Search] [▦ Columns] | ← tab bar
+-------------------------------+
| |
| Search |
| [ Type to search... ] | ← full-text search input
| |
| Filters |
| Field A ⓘ [Select... ▾] | ← auto-generated from schema.properties
| Field B ⓘ [Select... ▾] | only properties with enum/facetable shown
| |
+-------------------------------+

── Columns tab ──────────────
| Column Visibility |
| Select which columns to show |
| |
| Properties |
| ☑ name ☑ email ☐ phone | ← toggle checkboxes
| |
| Metadata |
| ☑ created ☐ updated |
+-------------------------------+
RegionDescription
HeaderSchema icon (via CnIcon), entity title, and a close button that emits update:open
Search tabFull-text search input and faceted filter dropdowns auto-generated from the schema
Columns tabCheckboxes to toggle each column's visibility; grouped by property group and Metadata
Filter controlsOne control per filterable schema property; shows live counts when facetData is provided

Usage

<CnIndexSidebar
:schema="schema"
:search-value="search"
:active-filters="filters"
:facet-data="facets"
:visible-columns="columns"
@search="onSearch"
@filter-change="onFilterChange"
@columns-change="onColumnsChange" />

When using CnIndexPage, the sidebar is managed internally — you do not need to wire it up separately.

Props

PropTypeDefaultDescription
schemaObjectnullSchema object — drives auto-generated filters (from properties) and the column list
titleString''Sidebar header title; defaults to schema.title when empty
iconString''MDI icon name or emoji shown in the header; defaults to schema.icon
openBooleantrueControls sidebar open/closed state (use with v-model:open)
searchValueString''Current search term (controlled); bind to your store's search state
searchPlaceholderString'Type to search...'Placeholder text inside the search input
activeFiltersObject{}Currently active filter values: { fieldName: [selectedValues] }
facetDataObject{}Live facet counts from the backend: { fieldName: { values: [{ value, count }] } } — shows counts next to each filter option
visibleColumnsArraynullArray of column keys currently shown in the table; controls the Columns tab checkboxes
columnGroupsArray[]Additional custom column groups to add to the Columns tab
showMetadataBooleantrueWhen true, includes a built-in "Metadata" group with created, updated, uuid columns
propertiesGroupLabelString''Override the label for the auto-generated properties column group
defaultTabString'search-tab'ID of the tab that is active when the sidebar opens. Built-in values: 'search-tab', 'columns-tab'. Use your custom tab's id for custom tabs
searchTabLabelString'Search'Label for the Search tab button
columnsTabLabelString'Columns'Label for the Columns tab button
searchLabelString'Search'Heading inside the Search tab
filtersLabelString'Filters'Heading above the filter controls
columnsHeadingString'Column Visibility'Heading inside the Columns tab
columnsDescriptionString'Select which columns to display in the table'Subtitle inside the Columns tab
userIsAdminBooleantrueWhether the current user is an admin. When false, schema properties with adminOnly: true are hidden from the filter list in the Search tab.

Events

EventPayloadDescription
searchsearchTermEmitted when the search input changes
filter-change{ key, values }Emitted when a filter selection changes; values is the updated array of selected values for that key
columns-changevisibleKeys[]Emitted when the user toggles a column; payload is the full updated array of visible column keys
update:openisOpenEmitted when the close button is clicked; use with v-model:open
tab-changetabIdEmitted when the user switches tabs; payload is the new tab's id string

Slots

SlotDescription
#search-aboveContent rendered above the search field in the Search tab (e.g. hints, quick actions). Only the section is rendered when the slot has content.
#search-extraContent rendered at the bottom of the Search tab, below the search field and filters
#columns-extraAdditional content rendered at the bottom of the Columns tab
#tabsInject one or more additional NcAppSidebarTab components after the built-in Search and Columns tabs

Icon Resolution

The sidebar header displays an icon from the icon prop (or schema.icon). Icons are resolved via the CnIcon registry — make sure your app has called registerIcons() with the required icon components before using this sidebar.

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnIndexSidebar.vue and update automatically whenever the component changes.

Props

NameTypeRequiredDefaultDescription
titlestring''Sidebar title. Defaults to schema.title when not set.
iconstring''MDI icon name or emoji. Defaults to schema.icon when not set.
schemaobjectnullSchema object for auto-generating filters, columns, and labels
visibleColumnsarraynullArray of currently visible column keys
searchValuestring''Current search term
openbooleantrueWhether sidebar is open
activeFiltersobject\{\}Current active facet filters: { fieldName: [values] }
facetDataobject\{\}Live facet data from API: { fieldName: { values: [{value, count}] } }
columnGroupsarray[]Additional column groups beyond schema properties and the built-in Metadata. Each group: { id: string, label: string, columns: Array<{key, label}>, expanded?: boolean }
showMetadatabooleantrueWhether to include the built-in Metadata column group
searchPlaceholderstring() =&gt; t('nextcloud-vue', 'Type to search...')Search input placeholder
searchTabLabelstring() =&gt; t('nextcloud-vue', 'Search')Search tab label
columnsTabLabelstring() =&gt; t('nextcloud-vue', 'Columns')Columns tab label
searchLabelstring() =&gt; t('nextcloud-vue', 'Search')Search section heading
filtersLabelstring() =&gt; t('nextcloud-vue', 'Filters')Filters section heading
columnsHeadingstring() =&gt; t('nextcloud-vue', 'Column visibility')Columns section heading
columnsDescriptionstring() =&gt; t('nextcloud-vue', 'Select which columns to display in the table')Columns section description
propertiesGroupLabelstring''Override label for the schema properties group. Defaults to schema.title.
defaultTabstring'search-tab'ID of the tab that should be active when the sidebar opens. Built-in IDs are 'search-tab' and 'columns-tab'. Use the id you set on your custom NcAppSidebarTab for custom tabs.
userIsAdminbooleantrueWhether the current user is an admin. When false, schema properties with adminOnly: true are hidden from filters.

Events

NamePayloadDescription
update:open
search
tab-change
columns-change
filter-change

Slots

NameBindingsDescription
search-above
search-extra
columns-extra
tabs