Skip to main content
2.0.57
Light Dark System
Compact Comfortable

Tray

<zn-tray> ZnTray
Since 2.0 experimental

Lays a toolbar’s filter controls out inline, and on narrow screens folds them behind one summary button that opens them in a bottom sheet.

<zn-panel caption="Tickets" flush>
  <zn-tray slot="actions" label="Report options" summary="1–31 Oct 2026 · Department" count="1">
    <zn-data-table-search placeholder="Search department..."></zn-data-table-search>
    <zn-date-range from="2026-10-01" to="2026-10-31"></zn-date-range>
  </zn-tray>
</zn-panel>

Wrap a toolbar’s filter controls (search, date range, filter, group by) in zn-tray. On wide screens the tray steps out of the way and the controls lay out exactly as they would without it. At or below the breakpoint (640px of viewport width by default) the controls fold behind a single button showing summary, and open in a bottom sheet, stacked full width.

While collapsed the tray reflects a collapsed attribute and emits zn-collapse (and zn-expand on the way back), so a host can render controls that suit a touch sheet better, as Report Table does with chips for its date presets and group by.

Examples

Summary and Count

summary is what the controls are set to, shown on the button. count is how many filters are applied, shown as a badge. Without a summary the button shows label, which is also the sheet’s heading.

<zn-tray label="Filters" count="2" breakpoint="100000">
  <zn-data-table-search placeholder="Search..."></zn-data-table-search>
  <zn-date-range from="2026-10-01" to="2026-10-31"></zn-date-range>
</zn-tray>

Breakpoint

Set breakpoint to the viewport width, in px, at or below which the controls fold. A very large value keeps the tray collapsed on every screen.

<zn-tray summary="Last month · Department" breakpoint="100000" done-label="Show 3 rows">
  <zn-data-table-search placeholder="Search department..."></zn-data-table-search>
  <zn-date-range from="2026-10-01" to="2026-10-31"></zn-date-range>
</zn-tray>

Header Actions

Put a reset button, or anything else that acts on the whole sheet, in the header-actions slot beside the heading.

Reset
<zn-tray summary="Last month" breakpoint="100000">
  <zn-button slot="header-actions" color="transparent" size="small">Reset</zn-button>
  <zn-data-table-search placeholder="Search..."></zn-data-table-search>
</zn-tray>

Done Label

done-label sets the text of the button that closes the sheet. Report Table uses it to show how many rows the filters leave, e.g. “Show 3 rows”.

Slots

Name Description
(default) The filter controls: search, date range, filter, group-by and the like.
header-actions Beside the sheet’s heading, such as a reset button.

Properties

Name Description Reflects Type Default
label The sheet’s heading, and the trigger’s text when there is no summary. string 'Filters'
summary What the controls are set to, shown on the trigger, e.g. “1–31 Oct 2026 · Department”. string ''
count How many filters are applied, shown as a badge on the trigger. number 0
doneLabel
done-label
The text of the button that closes the sheet. string 'Done'
breakpoint The viewport width, in px, at or below which the controls fold into the sheet. number 640
collapsed Set while the viewport is at or below the breakpoint. Read only. boolean false
open Whether the sheet is open. Only takes effect while collapsed. boolean false
updateComplete A read-only promise that resolves when the component has finished updating.

Events

Name React Event Description Event Detail
zn-show Emitted when the sheet opens. -
zn-close Emitted when the sheet closes. -
zn-collapse Emitted when the controls fold into the sheet. -
zn-expand Emitted when the controls return inline. -

Methods

Name Description Arguments
show() Opens the sheet, when collapsed. -
hide() Closes the sheet. -

Parts

Name Description
trigger The summary button shown while collapsed.
sheet The bottom sheet.
header The sheet’s header.
body The sheet’s body, holding the controls.
footer The sheet’s footer.

Dependencies

This component automatically imports the following dependencies.

  • <zn-button>