Reference
Parts and states
Every named region of the embed: what CSS it takes, its states, and the selector to style and test it.
Parts are named regions of the embed. Style them from your page with ::part() and select them in tests with [part~="name"]. Each part lists the CSS it accepts; height, width, display, position, transform, z-index and margin are on no list, so the embed keeps its layout.
Named parts, including the builder and layout controls, require the plugin release that ships with this docs update ({{PLUGIN_VERSION}} or later). The same version adds data-dbn-filter-key.
Style a part
Put the rules in a stylesheet on your page:
<style>
dbn-dashboard::part(card) {
box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}
dbn-dashboard::part(card-title) {
letter-spacing: 0.01em;
}
dbn-dashboard::part(date-filter) {
border-radius: 8px;
}
:is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(button-primary):hover {
opacity: 0.9;
}
:is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(date-filter-menu) {
border-radius: 12px;
}
</style>- In-card parts: start the rule with
dbn-dashboard::part(name)ordbn-metric::part(name). - Popover parts open outside the card. In the legacy design, menus, the date picker and dialogs open in
#dbn-portal, an element at the end of<body>; the metric builder opens in[data-dbn-embed-portal].dbn-dashboard::part(name)does not reach them. Start the rule with the host set:is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal]), which reaches every layer. - Parts that can open in a popover too use the same host set: buttons (Apply in the date picker), and the chart, table and states in the full screen view.
- The Style with column of the table below gives the right selector for each part. Copy it as it is.
- A bare
::part(name)also works, but it also matches any other web component on your page that uses the same part name. - Two embeds on one page share
#dbn-portal. A popover rule styles the popovers of both. - An element can have more than one name, for example
part="menu card-menu".::part(menu)styles every menu.::part(card-menu)styles only the card menu. ::part()takes states such as:hoverand:focus-visible. It does not reach inside a part:::part(card) spanmatches nothing.- A value the theme sets wins over a part rule. For example, when the theme sets the card corner radius (
cardCustomization.borderRadius) or the card title weight (cardTitle.fontWeight), a part rule does not change it. Change it in the theme. The Allowed CSS column marks these properties. - Text from your page flows into the embed. Your page rules for box styling (background, border, padding, shadow) never reach inside the embed. Inherited text properties do: in the legacy design,
color,font-family,font-size,line-height,letter-spacing,text-transformandcursorpass frombodyorhtmlinto the embed wherever the embed does not set them itself. In the v2 design (ui-version="v2"), the embed resetsfont-family,line-height,letter-spacing,word-spacing,text-transform,text-indent,font-style,font-variantandtext-shadow. Other inherited properties, such ascolor,font-sizeandcursor, still pass in. This is on purpose: the embed picks up your page font and text style unless you say otherwise. A value from the theme or from a part wins over the inherited one. To control them, set them in the theme or on a part, not on your page. - Use only the allowed CSS of a part. Other properties can stop working in any release.
Parts
Parts list version 1.0.0, 58 parts. The popover host set is :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal]).
| Part | What the viewer sees | Style with | Allowed CSS | Design |
|---|---|---|---|---|
dashboard | The whole dashboard, behind every card. | dbn-dashboard::part(dashboard), dbn-metric::part(dashboard) | Surface set. When the theme sets background or background-color, the theme wins | Legacy and v2 |
dashboard-header | The row with the dashboard name and actions. | dbn-dashboard::part(dashboard-header), dbn-metric::part(dashboard-header) | Surface set | Legacy and v2 |
dashboard-title | The dashboard name. | dbn-dashboard::part(dashboard-title), dbn-metric::part(dashboard-title) | Text set | Legacy and v2 |
filter-bar | The row of dashboard filters above the cards. | dbn-dashboard::part(filter-bar), dbn-metric::part(filter-bar) | Surface set | Legacy and v2 |
filter | Any one filter in the filter bar. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter) | Control set | Legacy and v2 |
filter-label | The name of a filter, above it or inside it. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter-label) | Text set. When the theme sets color or font-family, the theme wins | Legacy and v2 |
filter-select | A filter that picks one value from a list. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter-select) | Control set | Legacy and v2 |
filter-multi-select | A filter that picks many values from a list. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter-multi-select) | Control set | Legacy and v2 |
filter-number-range | A filter that takes a number range. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter-number-range) | Control set | Legacy and v2 |
filter-search | A filter where the viewer types a value. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter-search) | Control set | Legacy and v2 |
filter-menu | The list of values that opens from a filter. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(filter-menu) | Popover set | Legacy and v2 |
date-filter | The date filter button that shows the chosen range, in the filter bar or on a card. | dbn-dashboard::part(date-filter), dbn-metric::part(date-filter) | Control set. When the theme sets color or background or background-color or font-family, the theme wins | Legacy and v2 |
date-filter-menu | The date picker that opens from the date filter: presets and calendar. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(date-filter-menu) | Popover set | Legacy and v2 |
date-filter-preset | One preset in the date picker, for example “Last 7 days” or “Custom”. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(date-filter-preset) | color, background, background-color, border-radius, padding, gap, font-family, font-size, font-weight, line-height, opacity, cursor | Legacy and v2 |
date-filter-day | One day in the date picker calendar. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(date-filter-day) | color, background, background-color, border, border-color, border-radius, font-weight, opacity, cursor | Legacy and v2 |
date-filter-value | The words that say the chosen range, shown when the theme turns the date range label on. | dbn-dashboard::part(date-filter-value), dbn-metric::part(date-filter-value) | color, font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-transform | Legacy and v2 |
button-primary | The main action button, for example Apply. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(button-primary) | Control set. When the theme sets background or background-color, the theme wins | Legacy and v2 |
button-secondary | A second action button, for example Clear or Cancel. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(button-secondary) | Control set. When the theme sets background or background-color, the theme wins | Legacy and v2 |
card | One chart, table or number card. | dbn-dashboard::part(card), dbn-metric::part(card) | Surface set. When the theme sets border-radius or box-shadow, the theme wins | Legacy and v2 |
card-header | The top row of a card: title, description and actions. | dbn-dashboard::part(card-header), dbn-metric::part(card-header) | Surface set | Legacy and v2 |
card-title | The card name. | dbn-dashboard::part(card-title), dbn-metric::part(card-title) | Text set. When the theme sets color or font-size or font-weight, the theme wins | Legacy and v2 |
card-description | The short text under the card name. | dbn-dashboard::part(card-description), dbn-metric::part(card-description) | Text set. When the theme sets color or font-size or font-weight, the theme wins | Legacy and v2 |
card-actions | The buttons at the top right of a card. | dbn-dashboard::part(card-actions), dbn-metric::part(card-actions) | Control set | Legacy and v2 |
card-menu | The menu that opens from the card actions: download, full screen and more. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(card-menu) | Popover set | Legacy and v2 |
chart | The area that draws the chart. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(chart) | background, background-color, border-radius, padding, opacity | Legacy and v2 |
chart-legend | The chart legend where it is drawn as text (gauge charts). Other legends are drawn inside the chart and take color and font from the theme. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(chart-legend) | color, font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-transform, text-decoration, gap, padding | Legacy only |
chart-tooltip | The box that opens when the viewer points at a data point. Its text takes color and font from the theme tooltip fields. The v2 chart engine draws its tooltip inside the chart, so there all of it comes from the theme. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(chart-tooltip) | background, background-color, border, border-color, border-style, border-width, border-radius, box-shadow, opacity, padding | Legacy only |
single-value | The big number on a number card. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(single-value) | Text set | Legacy and v2 |
table | A table of rows inside a card. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(table) | Surface set | Legacy and v2 |
table-header | One header cell of a table. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(table-header) | Table row set. When the theme sets font-weight, the theme wins | Legacy and v2 |
table-cell | One cell in a table row. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(table-cell) | Table row set | Legacy and v2 |
empty-state | What a card shows when there is no data. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(empty-state) | Surface and text set | Legacy and v2 |
error-state | What a card shows when its data cannot load. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(error-state) | Surface and text set | Legacy and v2 |
loading-state | What a card shows while its data loads. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(loading-state) | background, background-color, border-radius, opacity, color | Legacy and v2 |
menu | Any drop-down menu. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(menu) | Popover set | Legacy and v2 |
menu-item | One row in any drop-down list: a filter value, a card menu entry. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(menu-item) | color, background, background-color, border-radius, padding, gap, font-family, font-size, font-weight, line-height, opacity, cursor | Legacy and v2 |
tooltip | A short help text that opens on hover, not on a chart. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(tooltip) | Popover set. When the theme sets padding, the theme wins | Legacy and v2 |
dialog | A window that opens over the embed, for example full screen or download. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(dialog) | Popover set | Legacy and v2 |
metric-builder | The whole screen where a viewer builds or edits a metric. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(metric-builder) | Surface set | Legacy and v2 |
builder-chart-area | The chart preview in the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-chart-area) | Surface set | Legacy and v2 |
builder-back | The back button that closes the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-back) | Control set | Legacy and v2 |
builder-title | The metric name at the top of the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-title) | Text set | Legacy and v2 |
builder-field | One column in the data panel of the metric builder, ready to drag. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-field) | color, background, background-color, border-radius, padding, gap, font-family, font-size, font-weight, line-height, opacity, cursor | Legacy and v2 |
builder-dimensions | The area in the metric builder where dimensions are dropped. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-dimensions) | Surface set | Legacy and v2 |
builder-measures | The area in the metric builder where measures are dropped. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-measures) | Surface set | Legacy and v2 |
builder-filters | The Filters button in the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-filters) | Control set | Legacy and v2 |
builder-sort | The Sort button in the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-sort) | Control set | Legacy and v2 |
builder-chart-type | The button that opens the chart type picker in the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-chart-type) | Control set | Legacy and v2 |
builder-appearance | The button that opens the chart appearance settings in the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-appearance) | Control set | Legacy and v2 |
builder-save | The Save to dashboard button at the top of the metric builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(builder-save) | Control set | Legacy and v2 |
metric-name-input | The metric name field in the window that saves or updates a metric. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(metric-name-input) | Control set | Legacy and v2 |
metric-save-confirm | The button that saves a new metric or updates an edited one. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(metric-save-confirm) | Control set | Legacy and v2 |
create-metric | The Create metric button on the dashboard. | dbn-dashboard::part(create-metric), dbn-metric::part(create-metric) | Control set | Legacy and v2 |
card-edit | The action on a card that opens the metric in the builder. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(card-edit) | Control set | Legacy and v2 |
layout-customize | The Customize layout action that lets the viewer move and resize cards. | :is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(layout-customize) | Control set | Legacy and v2 |
layout-save | The Save layout button shown while the viewer customizes the layout. | dbn-dashboard::part(layout-save), dbn-metric::part(layout-save) | Control set | Legacy and v2 |
layout-discard | The Discard button that leaves the layout as it was. | dbn-dashboard::part(layout-discard), dbn-metric::part(layout-discard) | Control set | Legacy and v2 |
layout-resize-handle | The corner handle that resizes a card while the viewer customizes the layout. The card itself is what the viewer drags to move it. | dbn-dashboard::part(layout-resize-handle), dbn-metric::part(layout-resize-handle) | background, background-color, background-image, border, border-color, border-radius, opacity, cursor | Legacy and v2 |
Allowed CSS sets (the Allowed CSS column names one of these):
| Set | Properties |
|---|---|
| Surface | color, background, background-color, background-image, border, border-color, border-style, border-width, border-radius, box-shadow, opacity, padding, gap |
| Text | color, font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-transform, text-decoration |
| Control | color, background, background-color, background-image, border, border-color, border-style, border-width, border-radius, box-shadow, opacity, padding, gap, font-family, font-size, font-weight, letter-spacing, text-transform, outline, outline-color, outline-offset, cursor |
| Popover | color, background, background-color, background-image, border, border-color, border-style, border-width, border-radius, box-shadow, opacity, padding, gap, font-family, font-size, font-weight, line-height |
| Table row | color, background-color, border-top, border-bottom, border-color, padding, font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-transform, text-decoration, text-align |
| Surface and text | color, background, background-color, background-image, border, border-color, border-style, border-width, border-radius, box-shadow, opacity, padding, gap, font-family, font-size, font-weight, font-style, line-height, letter-spacing, text-transform, text-decoration |
What the embed keeps
Where the Allowed CSS column says the theme wins, change the value in the theme. Date presets also carry a button part when selected. Their fill can still be set with ::part(date-filter-preset--selected).
To select one dashboard filter in a test, match data-dbn-filter-key on its filter part. See Pick one dashboard filter for an example.
States
A part can say what state it is in: open, selected, disabled, invalid or active. Style and select the state with its token, for example date-filter-day--selected:
<style>
:is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(date-filter-day--selected) {
background: #4f46e5;
color: #ffffff;
}
:is(dbn-dashboard, dbn-metric, #dbn-portal, [data-dbn-embed-portal])::part(menu-item):hover {
background: #f5f5f5;
}
dbn-dashboard::part(date-filter--open) {
border-color: #4f46e5;
}
</style>

5 states. A state is one more token in the part’s part attribute, written <part>--<state>.
| State | What it means | Read by screen readers as |
|---|---|---|
selected | A chosen value: a chosen option, a chosen preset, a day inside the chosen range. | aria-selected="true" |
open | The menu or picker this control opens is open now. | aria-expanded="true" |
disabled | It cannot be used now, for example a filter with no values, or Apply with nothing changed. | aria-disabled="true" |
invalid | The value fails a check: a minimum above the maximum, an end date before the start date. | aria-invalid="true" |
active | The row the keyboard or pointer is on in an open list. It does not mean “has a value”. | Keyboard focus is on the row (or the list points aria-activedescendant at it) |
| Part | States | Tokens to style and select |
|---|---|---|
filter | open, disabled, invalid | filter--open, filter--disabled, filter--invalid |
filter-select | open, disabled | filter-select--open, filter-select--disabled |
filter-multi-select | open, disabled | filter-multi-select--open, filter-multi-select--disabled |
filter-number-range | open, disabled, invalid | filter-number-range--open, filter-number-range--disabled, filter-number-range--invalid |
filter-search | disabled | filter-search--disabled |
date-filter | open, disabled, invalid | date-filter--open, date-filter--disabled, date-filter--invalid |
date-filter-preset | selected, disabled, active | date-filter-preset--selected, date-filter-preset--disabled, date-filter-preset--active |
date-filter-day | selected, disabled, active | date-filter-day--selected, date-filter-day--disabled, date-filter-day--active |
button-primary | disabled | button-primary--disabled |
button-secondary | disabled | button-secondary--disabled |
card-actions | open | card-actions--open |
menu-item | selected, disabled, active | menu-item--selected, menu-item--disabled, menu-item--active |
Every other part takes no state.
- The token is there only while the state is true.
- A state token takes the allowed CSS of its part. It adds no properties.
- Hover and keyboard focus are not states. Use
::part(menu-item):hoverand::part(menu-item):focus-visible. filtertakes the states of every filter type, so::part(filter--open)styles any open filter.- Menus, the date picker and dialogs exist only while open, so they take no
opentoken. - The two ends of a chosen date range take the same
selectedtoken as the days between them.