Skip to main content
Used alongside useDashboardReport for fully customizable dashboards. Below is an example with shadcn showing fully custom styling.
App.tsx

Working with filters

useDashboard returns a filters array describing the dashboard’s available filters and an applyFilters function for updating them. Each filter has a type of "select", "multiselect", "date", or "tenant", plus a label, current value, and an options list. The example below renders each filter type with a native control and applies updates via applyFilters:
App.tsx

Filter shapes

The "tenant" filter only appears if you have multiple Tenants defined in the BI platform and the viewing tenant has a mapping to the dashboard’s owner tenant. For example, a parent organization can use a multiselect tenant filter to view any subset of the child organizations it maps to.

applyFilters payload

applyFilters accepts an array of { label, value } objects. label must match a filter’s label from the filters array, and value must match the shape expected for that filter:
  • "select"value: string
  • "multiselect"value: string[]
  • "date"value: { startDate?: Date; endDate?: Date; preset?: string }
  • "tenant"value: string | string[] (coerce numeric tenant IDs to strings; pass an array when the tenant filter is multi-select)

Parameters

string
required
The name of the dashboard to load
object
Configuration options for the dashboard

Returns

boolean
Whether the dashboard data is currently loading
Record<string, QuillReport[]> | null
The dashboard sections containing reports, organized by section name. See the QuillReport reference for the full schema.
DashboardFilter[]
Available filters for the dashboard. These are typically rendered with html select or similar UI components.
(filters: Array<{ label: string; value: string | string[] | { startDate?: Date; endDate?: Date }; } | Filter>) => void
Function to apply filters to the dashboard