Skip to main content

CnActionsBar

Toolbar that combines an item count display, a primary Add button, a view-mode toggle (Cards / Table), and an overflow actions menu containing Refresh, Import, Export, Copy-selected, and Delete-selected. All built-in mass actions are individually toggle-able.

Wraps: NcButton, NcActions

Try it​

Loading CnActionsBar playground…

Usage​

<CnActionsBar
:pagination="pagination"
:object-count="items.length"
:selected-ids="selectedIds"
add-label="Add Client"
add-icon="AccountGroup"
@add="createNew"
@refresh="reload"
@show-import="openImport"
@show-export="openExport"
@show-copy="openMassCopy"
@show-delete="openMassDelete"
@view-mode-change="viewMode = $event" />

Custom action items can be injected into the overflow menu:

<CnActionsBar ...>
<template #action-items>
<NcActionButton @click="openReport">
<template #icon><ChartBar :size="20" /></template>
Export report
</NcActionButton>
</template>
</CnActionsBar>

Props​

PropTypeDefaultDescription
paginationObjectnullPagination state { total, page, pages, limit } — used to render "Showing X of Y"
objectCountNumber0Number of currently visible items
selectableBooleantrueWhether rows/cards can be selected
selectedIdsArray[]Currently selected item IDs — controls disabled state of mass actions
addLabelString'Add'Label for the primary Add button
addIconString''MDI icon name for the Add button (falls back to Plus)
showAddBooleantrueWhether to show the Add button
addDisabledBooleanfalseWhether the Add button is disabled
addHrefStringnullURL the Add button links to. The button becomes a real link (middle-click, open in new tab) and still emits add on a plain click; a ctrl/cmd/shift click opens a new tab and emits nothing. Wins over addTo.
addToString|Objectnullvue-router location (path or { name, params }) the Add button links to. The href is resolved through the router; a plain click routes in place and still emits add, so the host must not navigate on add itself; a ctrl/cmd/shift click opens a new tab and emits nothing. Ignored when the router cannot resolve it. CnIndexPage sets it for a named source's addRoute.
headerActionsArray[]Page-level actions in the overflow menu: { id, label, icon?, disabled?, href?, to?, linkTarget? }. Clicking emits header-action. An entry with href (a finished URL) or to (vue-router location) renders as a real link (NcActionLink, linkTarget as its target) that still emits header-action on a plain click, so the host must not navigate for it again; a ctrl/cmd/shift click opens a new tab and emits nothing. CnIndexPage resolves a manifest entry's href (an instance path through generateUrl()) and target into href / linkTarget before handing it over, and emits nothing upward for it.
viewModeString'table'Current view mode: 'table', 'cards', or 'map'
showViewToggleBooleantrueWhether to show the Cards/Table toggle (each option carries a leading icon)
cardsLabelString''Label for the cards/grid view-toggle option (defaults to "Cards")
tableLabelString''Label for the table/list view-toggle option (defaults to "Table")
cardsIconString''MDI icon name for the cards option (defaults to the built-in grid icon); resolved via CnIcon
tableIconString''MDI icon name for the table option (defaults to the built-in list icon); resolved via CnIcon
showMapBooleanfalseWhether to render the third "Map" toggle segment. Off by default, so existing two-segment consumers are unchanged
mapLabelString''Label for the map view-toggle option (defaults to "Map"). Only shown when showMap
mapIconString''MDI icon name for the map option (defaults to the built-in map-marker icon); resolved via CnIcon
showSearchBooleanfalseShow an inline search field on the left of the bar; emits search on input. The field takes the place of the "Showing X of Y" counter unless showCountWithSearch is set
searchPlacementString''Board look only: 'toolbar' draws the search field on row 1, before Filter and the view switch, instead of at the start of row 2
searchValueString''Current value of the inline search field (controlled)
searchPlaceholderString''Placeholder / accessible label for the inline search field
showCountWithSearchBooleanfalseKeep the "Showing X of Y" counter visible beside the inline search field: after the search and any #after-search controls, before the view toggle, on one line, moving to the next row on a narrow bar when there is no room. It is an aria-live="polite" region there, so a changed total is announced. Like the counter without search, it only shows text while pagination.total is above 0; at 0 the region stays mounted but empty and visually hidden, so results coming back after none are announced too. No effect without showSearch
refreshingBooleanfalseWhether a refresh is currently in progress
refreshDisabledBooleanfalseWhether the Refresh action is disabled
showMassImportBooleantrueWhether to show the Import action
showMassExportBooleantrueWhether to show the Export action
showMassCopyBooleantrueWhether to show the Copy selected action
showMassDeleteBooleantrueWhether to show the Delete selected action
inlineActionCountNumber2How many actions to show inline (rest go in overflow)
showRequestFeatureBooleanfalseShow a built-in "Request a feature" entry in the overflow (after Refresh + headerActions). Emits @request-feature; the host opens the CnSuggestFeatureModal

Events​

EventPayloadDescription
add—Add button clicked
refresh—Refresh action triggered
request-feature—Built-in "Request a feature" overflow item clicked (only when showRequestFeature)
view-mode-change'table' | 'cards'View toggle changed
show-import—Import action triggered
show-export—Export action triggered
show-copy—Copy selected action triggered
show-delete—Delete selected action triggered
clear-selection—Selection strip's Clear control clicked; the host should empty its selection (CnIndexPage does this and re-emits select with [])

Slots​

SlotScopeDescription
after-search—Refinement controls beside the search field on the bar's LEFT side (e.g. an NcActions filter menu with a funnel icon) — the left side groups the visual controls (search, filters, view toggle)
filters—Inline filter controls rendered inside the bar, between the view toggle and the add/actions (e.g. a CnQuickFilterBar segmented toggle).
actions—Custom buttons rendered between the sidebar toggle and the primary Add button.
actions-end—Custom buttons rendered AFTER the primary Add button, immediately before the overflow menu (e.g. CnIndexPage's saved-views control) — for content that belongs grouped with "browse/manage" controls rather than with the app-specific buttons in #actions.
header-actions—Extra buttons placed after the Add button, before the overflow menu
action-items—Extra NcActionButton items injected into the overflow menu
mass-actions{ count, selectedIds }Extra mass-action items at the bottom of the overflow menu (optional mirror of the strip's actions)
selection-actions{ count, selectedIds }The host's bulk-action buttons (NcButton family) in the contextual selection strip shown while selectable and a selection is active — the primary bulk-actions surface, with a live role="status" count and a built-in Clear control

Upgrading: #actions used to render after the Add button. It now renders before it, and the old position is the new #actions-end. Content passed to #actions therefore moves to the other side of Add — move it to #actions-end to keep the previous placement.

Set documentationUrl to add a Documentation entry to the overflow menu (just before Request a feature). It renders as a link that opens the URL in a new tab (target="_blank", rel="noopener noreferrer"); customise the wording with documentationLabel. Empty (the default) hides it. This mirrors the widget Actions menu's Documentation entry. CnIndexPage forwards its own documentationUrl / documentationLabel props here.

Reference (auto-generated)​

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

OpenRegister reliance​

heavy: this component cannot work without OpenRegister. 0 direct references, 30 files reached through imports.

Through: CnActionDialog, CnAssignDialog, CnBuildiqEditButton, CnBulkJobProgress, CnCellRenderer, CnDataTable, CnFkResolveCell, CnFlowDetail, CnGraphCanvas, CnIndexPage, CnSchemaFormDialog.

See the reliance overview for the filterable list.

Props​

NameTypeRequiredDefaultDescription
layout('' &#124; 'board' &#124; 'nextcloud')''board draws the toolbar of the board look: no band, two rows (saved views, Filter and the view switch; then the search field and the active filters). Empty follows the cnLook the app provides.
activeFilterChipsArray<{key: string, label: string}>[]The active filters as chips for row 2 of the board toolbar: { key, label }, the label reading "Team: Woo". Removing one emits remove-filter with the chip; "Clear all" emits clear-filters.
disabledViewModesArray<string>[]Board look: view modes the switch draws although the page cannot open them, as disabled segments (the boards always draw table, cards, board and map). Ignored without the board look.
viewSwitchArray<string>&#124;nullnullBoard look: the view switch's segments and their order (manifest config.viewSwitch), list included; every other offered view is listed under More views. Null keeps the fixed order.
viewModeLinksunion\{\}Board look: view modes that open another PAGE instead of switching in place, by mode: { board: { href, to? } }. Such a segment is drawn as a link in its place in the switch; to (a router location) is pushed on a plain click, href serves a new tab. A mode the page offers in place stays a button. Ignored without the board look.
activeFilterCountunionnullThe number on the Filter button's badge. Empty (null) counts the activeFilterChips.
showBuildiqButtonbooleantrueWhether the bar draws the in-app buildiq edit button. A page that draws it in its own header (the board look) passes false so there is one square, not two.
bulkNounstring''The plural the board bulk band names ("With the selected cases").
bulkBandAlwaysbooleanfalseBoard look: draw the bulk band also before anything is selected, its buttons disabled until there is a selection, as DqZaken and DqWerkbord draw it. Only when the band has an action to offer.
bulkLeadstring''Board look: the band's lead instead of "With the selected …" ("1 zaak geselecteerd").
bulkCancelbooleanfalseBoard look: a Cancel button at the end of the band that clears the selection.
bulkHintstring''The 13px hint after the board bulk band's buttons (config.bulkHint).
paginationobjectnullPagination state: { total, page, pages, limit }
objectCountnumber0Number of currently visible objects (for "Showing X of Y")
selectablebooleantrueWhether rows/cards can be selected
selectedIdsarray[]Currently selected IDs
addLabelstring() =&gt; t('nextcloud-vue', 'Add')Label for the Add button
addIconstring''MDI icon name for the Add button (e.g. 'AccountGroup'). Falls back to Plus icon.
addHrefunionnullURL the Add button links to. Makes the button a real link (middle-click, open in new tab) that still emits add on click. addTo is ignored when set.
addTounionnullvue-router location (path or { name, params }) the Add button links to. The button becomes a real link whose plain click routes in place and still emits add; the host must then not navigate on add itself. Ignored when the router cannot resolve it.
inlineActionCountnumber0How many action buttons to show inline (rest go in overflow dropdown)
showMassImportbooleantrueWhether to show the built-in mass Import action
showMassExportbooleantrueWhether to show the built-in mass Export action
showMassCopybooleantrueWhether to show the built-in mass Copy action
showMassDeletebooleantrueWhether to show the built-in mass Delete action
viewModestring'table'Current view mode: 'table', 'cards', 'list', or 'map'
availableViewModesArray<'cards' &#124; 'table' &#124; 'list' &#124; 'calendar'>['cards', 'table']Which view-mode segments to render, in order. Defaults to the historical two-segment control; add 'list' to expose the list view.
showViewTogglebooleantrueWhether to show the view-mode toggle
cardsLabelstring''Label for the cards/grid view-toggle option (defaults to "Cards")
tableLabelstring''Label for the table/list view-toggle option (defaults to "Table")
cardsIconstring''MDI icon name for the cards option (defaults to the built-in grid icon). Resolved via CnIcon.
tableIconstring''MDI icon name for the table option (defaults to the built-in list icon). Resolved via CnIcon.
showMapbooleanfalseWhether to render the "Map" segment in the view toggle (back-compat bridge; equivalent to adding 'map' to availableViewModes).
mapLabelstring''Label for the map view-toggle option (defaults to "Map").
mapIconstring''MDI icon name for the map option (defaults to the built-in map-marker icon). Resolved via CnIcon.
listLabelstring''Label for the list view-toggle option (defaults to "List")
listIconstring''MDI icon name for the list option (defaults to the built-in list icon). Resolved via CnIcon.
showSortSelectbooleanfalseShow a standalone sort dropdown (useful in card/list views).
sortOptionsArray<{ value: string, label: string }>[]Options for the sort dropdown.
sortValuestring''The currently selected sort option value (controlled).
sortLabelstring() =&gt; t('nextcloud-vue', 'Sort by')Accessible label for the sort dropdown.
showSearchbooleanfalseWhether to show the inline search field on the left of the bar
searchPlacementstring''Where the board look draws the search field: '' (the default) at the start of row 2, 'toolbar' on row 1 before Filter and the view switch (DqTeamwachtrij). No effect outside the board look.
searchValuestring''Current value of the inline search field (controlled)
searchPlaceholderstring''Placeholder / accessible label for the inline search field
showCountWithSearchbooleanfalseKeep the "Showing X of Y" counter visible beside the inline search field, after any #after-search controls. By default the search field takes the counter's place. No effect without showSearch.
refreshingbooleanfalseWhether the refresh action is currently in progress
refreshDisabledbooleanfalseWhether the refresh action is disabled (e.g. when required selections are missing)
addDisabledbooleanfalseWhether the Add button is disabled (e.g. when required selections are missing)
showAddbooleantrueWhether to show the Add button
showCountbooleantrueWhether the "Showing 20 of 258" line renders where the search field is not. false drops it, for a page whose title line already says how many there are. True by default.
showActionsMenubooleantrueWhether the overflow Actions menu (Refresh, Import, Export, mass actions, header actions) renders. false drops it, for a page that offers its actions as buttons elsewhere (CnIndexPage headerButtons). True by default.
showSidebarTogglebooleanfalseWhether to show the Search/Columns sidebar toggle button. Lets the index sidebar default to closed and be opened on demand.
sidebarOpenbooleanfalseCurrent open state of the sidebar (controls the toggle's pressed state).
headerActionsunion[]Manifest-declared page-level actions rendered in the overflow dropdown between Refresh and the #action-items slot. Each entry is { id, label, icon?, disabled? }. The bar emits @header-action({ action: id, id }) on click; handler resolution happens upstream (CnIndexPage). An entry with href (URL) or to (vue-router location) renders as a real link, with linkTarget as its target; it still emits header-action, so the host must not navigate for it again.
bulkActionsArray<{ id: string, label: string, icon?: string, disabled?: boolean, menu?: boolean }>[]Declarative bulk actions, rendered in the contextual selection strip that appears while a selection is active. The strip already had a #selection-actions slot, which only a hand-written host component can fill — so a page declared in an app manifest could carry row actions and header actions but never a bulk one. This prop is that missing vocabulary; the slot stays, and both render side by side in one row. Clicking emits bulk-action with the id AND the current selection. An entry with menu: true is listed under a More menu after the buttons instead of as a button of its own.
documentationUrlstring''When set, adds a Documentation entry to the overflow menu (after Refresh, before headerActions). Opens the URL in a new tab. Empty string hides the entry.
documentationLabelstring() =&gt; t('nextcloud-vue', 'Documentation')Label for the Documentation overflow entry.

Events​

NamePayloadDescription
toggle-sidebar—User clicked the Search/Columns sidebar toggle. No payload.
view-mode-change—User clicked one of the view-mode toggle buttons (Cards / Table). Payload is the selected mode string.
refresh—User clicked the Refresh entry in the overflow Actions menu. The host should re-fetch the underlying list.
header-action—User clicked a manifest-declared page-level header action. Payload: { action: id, id }.
show-import—User clicked the Import mass action. Host should open the import modal.
show-export—User clicked the Export mass action. Host should open the export modal.
show-copy—User clicked the Copy-selected mass action. Disabled while no row is selected.
show-delete—User clicked the Delete-selected mass action. Disabled while no row is selected.
remove-filter—User removed an active filter chip (board look). Payload: the chip { key, label }.
clear-filters—User clicked "Clear all" beside the active filter chips (board look). No payload.
bulk-action—Declarative bulk actions, from bulkActions. They render in the SAME strip as a host's slot buttons and before them, so a page that declares some in its manifest and hand-writes others gets one row of buttons rather than two groups in different places.
clear-selection—User clicked the selection strip's Clear control. No payload — the host should empty its selection (CnIndexPage does this and re-emits select with an empty array).
add—User clicked the primary Add button. No payload.
search—Emitted when the user types in the inline search field.
sort-change—Emitted when the user picks an option from the standalone sort dropdown.

Slots​

NameBindingsDescription
filters—filters Inline filter controls (chips) at the start of the board look's row 1.
actions-end—actions-end
filter-menu—filter-menu
after-search—after-search Refinement controls rendered beside the search field on the LEFT side of the bar (e.g. a filter menu button). Convention: the left side groups the VISUAL controls — search, filters, view toggle — while the right cluster holds the ACT controls (add, overflow); the standalone sort select is a display control too but keeps its legacy right-side placement.
actions—actions
action-items—action-items
mass-actionscount, selectedIdsmass-actions
selection-actionscount, selectedIdsselection-actions The host app's bulk-action buttons (NcButton family), rendered inside the contextual selection strip that appears while a selection is active. This strip is the primary bulk-actions surface; #mass-actions remains available for hosts that ALSO want the actions listed in the overflow menu (optional — strip-only is fine).

Additional props​

PropTypeDefaultDescription
showSidebarToggleBooleanfalseWhether to show the Search/Columns sidebar toggle button (lets the index sidebar default to closed and open on demand).
sidebarOpenBooleanfalseCurrent open state of the sidebar (controls the toggle button's pressed state).
availableViewModesArray['cards','table']Which view-mode segments to show, in order (add list).
listLabelString''Label for the list view-toggle option.
listIconString''MDI icon for the list view-toggle option.
showSortSelectBooleanfalseShow a standalone sort dropdown (card/list views).
sortOptionsArray[]Options { value, label } for the sort dropdown.
sortValueString''Selected sort option value (controlled).
sortLabelString(i18n)Accessible label for the sort dropdown.

showCount and showActionsMenu​

showCount (default true): false drops the "Showing 20 of 258" line. showActionsMenu (default true): false drops the overflow Actions menu (Refresh, Import, Export, mass actions, header actions), for a page that offers its actions as buttons elsewhere (CnIndexPage headerButtons).

Board layout​

Under the board look (layout="board", or the app's cnLook) the bar draws no band and lays out two rows: the quick-filter chips, the saved-view chips and the "Save view" button, a labelled Filter button carrying the number of active filters, and an icon-only view switch (table, cards, board, map) on row 1; the search field, "Active:", one removable chip per activeFilterChips entry and "Clear all" on row 2. New props: layout, activeFilterChips ({ key, label }), activeFilterCount, showBuildiqButton, bulkNoun and bulkHint. New events: remove-filter and clear-filters. While rows are selected the bulk band renders as its own region after the toolbar element, not inside it. With bulkBandAlways the band shows before a selection too, its buttons disabled until rows are selected (DqZaken, DqWerkbord), when it has an action to offer. bulkLead replaces the band's lead ("1 zaak geselecteerd") and bulkCancel ends it with a Cancel button that clears the selection. Without the look the bar renders as before.

showBuildiqButton (Boolean, default true): set false when the page draws the buildiq square in its own header.

Disabled view segments​

Under the board look disabledViewModes (an array of modes) draws view switch segments the page cannot open, in the fixed order table, cards, board, map, disabled and titled <mode>: not available on this list. A mode that is also offered renders once, enabled. CnIndexPage fills it from config.viewSwitch. viewModeLinks ({ board: { href, to? } }) draws a mode that opens another page as a link in its place in the switch: a plain click pushes to on the router when given, and href serves a new tab; a mode the page offers in place stays a button.