HelixOverviewComponentsMapsGraphIntroductionInstallationDeriving a themeSandboxTheme builderVisual testingCortexDocsEngramActiveTraceActiveRecallActiveServicesInsightsGet in touchSource on GitHub
Loading the reference
Quick FiltersView sourceEdit in SandboxView MarkdownCopy MarkdownOpen in ClaudeOpen in CursorA row of presets for a Data Table, each a partial view with a count, and a button that saves the view.ExperimentalSince 0.238.0DataUsageimport'@fusion.dev/helix/quick-filters'import'@fusion.dev/helix-headless/quick-filters'Preview
API referenceFilterhelix-quick-filterOne preset in a Quick Filters row: a name and the parts of a Data Table's view it sets.
PropTypeDescriptioncountnumberHow many rows the preset shows, where the table cannot count them, as a
table in server mode cannot. Left unset, the row counts the rows the
table holds.viewstringDefault""The parts of the table's view the preset sets, as JSON, such as
{"filters":[{"field":"status","operator":"any","values":["Overdue"]}]}.
Only the parts it names are set.
ReadTypeDescriptionpartsPartialViewThe parts of the view the preset sets, read from view. Text that is not JSON sets nothing.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The preset's name.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Roothelix-quick-filtersA row of presets for a Data Table, each a partial view with a count, and a button that saves the view.
PropTypeDescriptionfallbackLabelstringDefault"Quick filters"The name the element gives itself where label is empty.forstringDefault""The id of the DataTable the presets set the view of, in the same document or shadow root.labelstringDefault""The name of the list, which a screen reader announces before its items.removeLabelstringDefault"Remove {name}"The name of the button that removes a saved view. {name} is the view's name.savedLabelstringDefault"View {count}"The name a saved view is given. {count} is how many views are saved, with this one.saveLabelstringDefault"Save view"The words on the button that saves the view. Empty draws no button.viewKeystringDefault""Keeps saved views in this browser's storage under this key, and draws them
after the presets you write. Left unset, Save view only fires its events.
ReadTypeDescriptiontableToolTable|nullThe bound table, once it is in the tree.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The presets, as QuickFilter elements.
EventTypeDescriptionhelix-before-view-saveHelixBeforeViewSaveEventSave view was pressed, with the view and the name it is saved under. Cancelable: cancel it to keep the view yourself.helix-view-saveHelixViewSaveEventFired after a view is saved, with the view and its name.
MethodTypeDescriptionchoose(view: PartialView) => booleanSets the parts of the view one preset names.removeSaved(index: number) => voidRemoves a view kept in storage, by its place among the saved ones.saveView(label: unknown) => booleanSaves the table's whole view, as Save view does. Returns whether it was saved.
PartDescriptioncountHow many rows a preset shows, after its name.listThe row of buttons.nameA preset's name, inside its button.presetOne preset's button.preset-pressedAdded to preset while the view holds it.preset-savedAdded to preset for a view kept in browser storage.removeThe button after a saved preset that removes it.saveThe button that saves the view.
CSS PropertyDescription--quick-filters-background-colorThe fill of the track the presets sit in.--quick-filters-pressed-background-colorThe fill of the preset the view holds.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Filterhelix-headless-quick-filterOne preset in a Quick Filters row: a name and the parts of a Data Table's view it sets.
PropTypeDescriptioncountnumberHow many rows the preset shows, where the table cannot count them, as a
table in server mode cannot. Left unset, the row counts the rows the
table holds.viewstringDefault""The parts of the table's view the preset sets, as JSON, such as
{"filters":[{"field":"status","operator":"any","values":["Overdue"]}]}.
Only the parts it names are set.
ReadTypeDescriptionpartsPartialViewThe parts of the view the preset sets, read from view. Text that is not JSON sets nothing.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The preset's name.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Roothelix-headless-quick-filtersA row of presets for a Data Table, each a partial view with a count, and a button that saves the view.
PropTypeDescriptionfallbackLabelstringDefault"Quick filters"The name the element gives itself where label is empty.forstringDefault""The id of the DataTable the presets set the view of, in the same document or shadow root.labelstringDefault""The name of the list, which a screen reader announces before its items.removeLabelstringDefault"Remove {name}"The name of the button that removes a saved view. {name} is the view's name.savedLabelstringDefault"View {count}"The name a saved view is given. {count} is how many views are saved, with this one.saveLabelstringDefault"Save view"The words on the button that saves the view. Empty draws no button.viewKeystringDefault""Keeps saved views in this browser's storage under this key, and draws them
after the presets you write. Left unset, Save view only fires its events.
ReadTypeDescriptiontableToolTable|nullThe bound table, once it is in the tree.whenSettledPromise<void>Resolves a frame after the first update, when transitions are switched on.
SlotDescription(default)The presets, as QuickFilter elements.
EventTypeDescriptionhelix-before-view-saveHelixBeforeViewSaveEventSave view was pressed, with the view and the name it is saved under. Cancelable: cancel it to keep the view yourself.helix-view-saveHelixViewSaveEventFired after a view is saved, with the view and its name.
MethodTypeDescriptionchoose(view: PartialView) => booleanSets the parts of the view one preset names.removeSaved(index: number) => voidRemoves a view kept in storage, by its place among the saved ones.saveView(label: unknown) => booleanSaves the table's whole view, as Save view does. Returns whether it was saved.
PartDescriptioncountHow many rows a preset shows, after its name.listThe row of buttons.nameA preset's name, inside its button.presetOne preset's button.preset-pressedAdded to preset while the view holds it.preset-savedAdded to preset for a view kept in browser storage.removeThe button after a saved preset that removes it.saveThe button that saves the view.
Custom stateDescriptionsettledSet one frame after the first render. Transitions wait for it, so an element does not animate its own arrival.
Examples
NameDescriptionPreviewPresets above an invoice table, each with how many invoices it shows, and a button that saves the view.PreviewPresets above an invoice table, each with how many invoices it shows, and a button that saves the view.