CSS: tray
.instui-tray — An edge-pinned panel that slides in from any side; a native [popover] or <dialog>.
Start/end placements resolve against inset-inline (logical, direction-aware); the slide-in transform mirrors automatically under an ancestor [dir="rtl"], so no extra markup is needed for right-to-left layouts.
Source: tray.css
Accessibility
The tray is a dialog or popover surface, so name it with aria-label or aria-labelledby, and its close control carries an aria-label (the .instui-close-button in the example uses aria-label="Close").
Usage
css
@import "@pantoken/components/components.css";
@import "@pantoken/components/tray.css";Examples
html
<div class="instui-tray -placement-end -size-sm">
<span class="instui-heading -level-h3">Filters</span>
<p class="-size-sm">A tray slides in from the start edge and fills the viewport height.</p>
</div>
<button class="instui-button -toggle">toggle tray</button>Structure
text
.instui-tray
close-button (component, 0..1)
‹content›flowchart TD
n0[".instui-tray"]:::cssdoc-root
n1(["close-button"]):::cssdoc-component
n2[/"‹content›"/]:::cssdoc-slot
n0 -.->|0..1| n1
n0 --> n2
click n1 "/api/css/close-button.md"
classDef cssdoc-root stroke-width:1px;
classDef cssdoc-part stroke-width:1px;
classDef cssdoc-slot stroke-width:1px;
classDef cssdoc-component stroke-width:1px;
Modifiers
| Modifier | Description |
|---|---|
.-placement-bottom | Pin to the bottom edge. |
.-placement-end | Pin to the end (inline-end) edge. |
.-placement-start | (default) Pin to the start (inline-start) edge. |
.-placement-top | Pin to the top edge. |
.-size-large | Large. Long-form alias of -size-lg. |
.-size-lg | Large. |
.-size-md | (default) Medium. |
.-size-medium | (default) Medium. Long-form alias of -size-md. |
.-size-regular | Deprecated — use .-size-md. |
.-size-sm | Small. |
.-size-small | Small. Long-form alias of -size-sm. |
.-size-x-large | Extra large. Long-form alias of -size-xl. |
.-size-x-small | Extra small. Long-form alias of -size-xs. |
.-size-xl | Extra large. |
.-size-xs | Extra small. |
Conditions
| Type | Query | Description |
|---|---|---|
| supports | (transition-behavior: allow-discrete) | — |
Tokens consumed
| Token | Type | Value |
|---|---|---|
--instui-component-tray-background-color | <color> | LightDarklight-dark(#ffffff, #1C222B) |
--instui-component-tray-border-color | <color> | LightDarklight-dark(#E8EAEC, #334450) |
--instui-component-tray-border-width | <length> | 0.0625rem |
--instui-component-tray-padding | <length> | 1.5rem |
--instui-component-tray-width-lg | <length> | 48em |
--instui-component-tray-width-md | <length> | 30em |
--instui-component-tray-width-sm | <length> | 20em |
--instui-component-tray-width-xl | <length> | 62em |
--instui-component-tray-width-xs | <length> | 16em |
--instui-component-tray-z-index | <integer> | 9999 |
--instui-elevation-topmost | none | <shadow># | — |
--tray-slide-x | — | -100% |
--tray-slide-y | — | 0% |
Browser support
- Opens with the native
[popover]API and@starting-style; the slide-in sits behind an@supports (transition-behavior: allow-discrete)guard, so browsers without it still open the tray, just without the slide.