How it works › Toolbar presets

Toolbar presets

The one-row bar: the view selector, a query bar, Filter and Display, with everything else inside Display. Zach's pick was the mix of the proposals ("Definitely yes I like the mix"), with the differences between apps kept as presets: each preset is two attributes on the same element.

preset =

The bar and its presets toolbar="bar"

Live

robotparts' 1,149 actuators under toolbar="bar". Pick a preset above: the element redraws its bar and keeps its view, its filters, its query and its selection. Type brand: in the query bar, tick a few rows, open Display.

The live view starts when it scrolls into sight.

From the example The bar: data-ui's toolbar · every attribute is read live (CONTRACT §15)

index.html
<data-views src="views.base" toolbar="bar" views="auto" filters="pills" display="panel" selectable></data-views>

The presets

PresetAttributesOn the bar
Mix (default)toolbar="bar" views="auto"the views decide (auto): tabs, the ones that do not fit in "N more…"; with filters set, only Filter is promoted
Shopifytoolbar="bar" views="dropdown" promote=""three elements: the view chip, the search, Display
Notiontoolbar="bar" views="tabs" promote=""the view tabs (overflow into "N more…"), the search, Display
Obsidiantoolbar="bar" views="dropdown" promote="sort group filter properties"the chip, then Sort · Group · Filter · Properties as words that say what is set

The gallery has each one as its own example, with the rest of the bar's attributes: the mix (filters="pills rail": the one Filter button shows and hides the rail), Shopify (display="popover"), Notion and Obsidian.

The attributes

AttributeValues (default first)Does
toolbarfull | bar | compact | nonebar is the one-row chrome; full stays the default and draws what it drew.
viewsauto | dropdown | tabsThe view selector: one chip with Bases' view menu, every view as a tab, or tabs while they fit (re-decided on resize).
promotea set of sort group filter propertiesWhich of Display's sections also sit on the bar, in that order; "" promotes none. Absent: filters="expanded" promotes all four, any other filters promotes Filter, else the views decide (tabs ⇒ Filter, the chip ⇒ all four).
filterspills, expanded, query-tokens, railHow the one all-views filter shows: removable pills under the bar, tokens in the query bar, a Filter button that shows and hides the linked rail.
displaypanel | popoverWhere View settings opens: a resizable side panel inside the element, or a popover on the button.
selectableabsent | presentA checkbox per row (shift-click a range, ctrl/cmd-click one); the bulk band lies over the header with "N selected", the actions and Show only selected.
labelsauto | iconsauto drops the tools' labels first as the bar narrows, before anything moves into "…".
querytextThe query bar's text, parsed as typing is; read back el.queryText.

How it behaves

Comes from docs/CONTRACT.md §15 and its notes, and docs/peps/0002-toolbar.md in docs/.