GitHub

Side Dialog

A slide-in drawer / side sheet. Full-height panel fixed to a side edge, with its own backdrop, focus trap, Esc-to-close, and focus restore — the modal mechanics of a dialog with edge-anchored layout.

Stable wc import '@esa/ecology/esa-side-dialog'; Angular usage

Preview

Drawer body content goes here. It scrolls if it overflows, with the header and footer pinned.

Use it for filters, detail panes, and create/edit forms that don't warrant a full page.

<button id="open-sd">Open drawer</button>
<esa-side-dialog id="sd" heading="Filters" position="right">
  <p>Drawer body content…</p>
  <button slot="footer">Apply</button>
</esa-side-dialog>
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@esa/ecology/esa-side-dialog';

@Component({
  selector: 'app-side-dialog-demo',
  standalone: true,
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  template: `
    <button id="open-sd">Open drawer</button>
    <esa-side-dialog id="sd" heading="Filters" position="right">
      <p>Drawer body content…</p>
      <button slot="footer">Apply</button>
    </esa-side-dialog>
  `,
})
export class SideDialogDemo {}

Positions & sizes

Slides from left or right; width via size (sm 320 · md 400 · lg 520).

<esa-side-dialog position="left" size="sm" heading="Left, sm">…</esa-side-dialog>
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import '@esa/ecology/esa-side-dialog';

@Component({
  selector: 'app-side-dialog-demo',
  standalone: true,
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  template: `
    <esa-side-dialog position="left" size="sm" heading="Left, sm">…</esa-side-dialog>
  `,
})
export class SideDialogDemo {}

API

PropTypeDefaultDescription
open boolean false
heading string '' Title shown in the header.
position 'left' | 'right' 'right' Edge the drawer slides in from.
size 'sm' | 'md' | 'lg' 'md' Panel width — 320 / 400 / 520px.
show-close-button boolean true Render the header close (✕) button. Property: `showCloseButton`. On by default. Write `="false"` to turn it off — unusually for a boolean attribute, this one reads the value.
Binding these events from Angular

Every one of these is a CustomEvent, so the payload is on $event.detail — $event.target.value reads empty, with no error. The names are lowercase and Angular passes them to addEventListener verbatim, so camel-casing one means it never fires.

  • (close)="onClose($event.detail)"

Methods

PropTypeDefaultDescription
show() method — Open the drawer.
close() method — Close it (restores focus, emits `close`).

Events

EventTypeDefaultDescription
close CustomEvent — Fired when the drawer closes (Esc, backdrop, or close button).

Accessibility

  • role="dialog" + aria-modal; labelled by the heading.
  • Focus is trapped within the panel; Tab/Shift+Tab cycle, Esc closes, and focus is restored to the trigger on close.
  • The backdrop click and the ✕ button both close.

Theming surface

Every public token this component reads, extracted from its source at build time, split by blast radius: the hooks that belong to this component, then the shared and system tokens it consumes alongside everything else. The Resolves to column walks each token's real lineage — component → semantic → primitive → raw value — so you can see exactly where re-pointing it lands. A spoke re-skins by overriding these in its theme-<slug>.css; component internals are never edited. No hook for what you need? File it with /request-lego.

Type roles it names

This component does not set a size, weight, face or tracking of its own — it names a composite, and the composite carries all five. A composite is a class rather than a token, so none of it appears in the tables below; re-theme text by re-pointing the token family, not by editing the component.

RoleRe-pointReach
.typography-body-md
  • --typography-body-md-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-body-md-font-size clamp(0.75rem, 0.66rem + 0.44vw, 0.9375rem) via --font-size-200
  • --typography-body-md-font-weight 350 via --typography-font-weight-regular → --font-weight-350
  • --typography-body-md-letter-spacing 0.01em via --letter-spacing-default
  • --typography-body-md-line-height 1.6 via --line-height-normal
+28 more components esa-app-shell, esa-breadcrumbs, esa-card, esa-checkbox, esa-checkbox-group, esa-collapsible, esa-combobox, esa-command-palette, esa-confirm-dialog, esa-container, esa-danger-zone, esa-dialog, esa-dropdown-menu, esa-empty-state, esa-entity-search, esa-form-field, esa-header-nav, esa-input-tag, esa-nav-dropdown, esa-page-header, esa-popover, esa-progress-bar, esa-radio-group, esa-select, esa-snackbar-item, esa-switch-toggle, esa-tab-layout, esa-textarea
.typography-label-md
  • --typography-label-md-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-label-md-font-size clamp(0.75rem, 0.66rem + 0.44vw, 0.9375rem) via --font-size-200
  • --typography-label-md-font-weight 500 via --typography-font-weight-medium → --font-weight-500
  • --typography-label-md-letter-spacing 0.01em via --letter-spacing-default
  • --typography-label-md-line-height 1.6 via --line-height-normal
+33 more components esa-app-bar, esa-breadcrumbs, esa-button-group, esa-button-toggle, esa-card, esa-checkbox-group, esa-color-picker, esa-combobox, esa-command-palette, esa-confirm-dialog, esa-danger-zone, esa-date-picker, esa-dialog, esa-empty-state, esa-entity-search, esa-file-upload, esa-filter-container, esa-form-field, esa-header-nav, esa-input-tag, esa-link-column, esa-page-header, esa-pillbox, esa-popover, esa-progress-bar, esa-radio-group, esa-range-slider, esa-select, esa-sidebar-nav, esa-stat, esa-text-field, esa-textarea, esa-tooltip
.typography-title
  • --typography-title-font-family 'DM Sans', sans-serif via --typography-font-family-sans → --font-family-dm-sans
  • --typography-title-font-size clamp(1rem, 0.88rem + 0.6vw, 1.25rem) via --font-size-400
  • --typography-title-font-weight 500 via --typography-font-weight-medium → --font-weight-500
  • --typography-title-letter-spacing 0.01em via --letter-spacing-default
  • --typography-title-line-height 1.6 via --line-height-normal
+4 more components esa-avatar, esa-confirm-dialog, esa-dialog, esa-empty-state

Wired to this component

No other component reads these — re-point them and esa-side-dialog is the only thing that moves.

Token Tier Resolves to
--side-dialog-backdrop-filter component none
--side-dialog-inset component 16px
--side-dialog-width component 400px
--side-dialog-width-lg component 520px
--side-dialog-width-sm component 320px

Shared tokens it reads

Owned by a family or by the semantic layer. Still overridable — but scope the override (esa-foo { --form-border-color: … }) unless you mean to move everything that reads it. Reach says what else that is.

Token Reach Resolves to
--animation-enter semantic every component 150ms via --duration-150
--animation-exit semantic every component 150ms via --duration-150
--animation-overlay-enter semantic every component 250ms via --duration-250
--animation-overlay-exit semantic every component 200ms via --duration-200
--border-width-default semantic every component 1px via --border-width-100
--color-background-elevation-raised semantic every component #fcfcfc via --color-gray-1
--color-background-elevation-sunken semantic every component #f0f0f0 via --color-gray-3
--color-background-overlay-backdrop semantic every component rgba(0, 0, 0, 0.5) via --color-black-a-7
--color-border-default semantic every component one role per property, so a theme can move the ring's weight and its colour independently. Tier 3's --focus-ring-width now reads this instead of holding a bare 2px, which is the same shape --focus-ring-color has always had (a thin tier-3 alias over a tier-2 role) — width was simply never given the tier-2 half. * * This role was rejected once, and the rejection is worth recording because its PREMISE was wrong rather than its reasoning. The argument against an `emphasis` width was that every 2px border in the kit is micro-geometry — spinner rings, the kbd keycap lip, a chevron. The focus ring was not in that enumeration and does not fit it: 33 components render it, more than read any other tier-3 token, and it is not micro-geometry but an accessibility affordance whose weight is a legitimate brand axis (a spoke that needs a heavier ring for contrast has to be able to reach it). It is also not a `border` in any component — every consumer paints it with `outline` or `box-shadow` — which is precisely why a survey of BORDERS missed it. The name still says `border` because tier 2 already calls the ring's colour --color-border-default-focus
--color-content-default semantic every component #202020 via --color-gray-12
--color-content-default-secondary semantic every component #646464 via --color-gray-11
--elevation-5 semantic every component 0 via --shadow-offset-x
--radius-md semantic every component 0.5rem via --radius-200
--radius-sm semantic every component 0.25rem via --radius-100
--spacing-300 primitive every component 0.75rem
--spacing-400 primitive every component 1rem
--spacing-500 primitive every component 1.5rem