# KptDrawer (kpt-drawer) A sliding panel (drawer / off-canvas) driven by the `open` signal. Independent of the app shell (fixed position + a backdrop, a transform animation). Import: `import { KptDrawer } from '@konce-pt/angular';` ## Inputs / model - `open`: model (two-way) - `position`: 'left' | 'right' | 'top' | 'bottom' (KptDrawerPosition) - `header`: string; `dismissible`: boolean (x and Esc); `closeOnBackdrop`: boolean - Content through the `` projection. ## Example Menu ... ## The closed state / a11y The panel is always in the DOM (no `@if`), hidden with `transform` **and** `visibility: hidden` - never `display: none`, so that the slide-in and slide-out animations survive. `visibility` takes the closed panel out of the tab order and out of the accessibility tree without `inert`, and it does so on the very first frame, without waiting for JavaScript. Both closed-state declarations live in the **base** rule, not in `[data-position]` - Angular only sets the position attribute during the update pass, so a panel gated on that attribute would flash on screen and then animate away. `prefers-reduced-motion: reduce` drops the transitions. ## Focus and keyboard Opening moves focus into the panel (`cdkFocusInitial`, else its first focusable element, else the panel itself) and traps it there - `Tab` / `Shift+Tab` wrap inside, as `aria-modal="true"` promises. Closing returns focus to the element that had it before. `Escape` closes the panel - only when `dismissible`, like the `x` button. The panel is named by its `header` through `aria-labelledby`. The shared helper is `shared/modal-focus.ts` (on the CDK focus trap; the React port has a twin hook). ## Tokens The panel `--kpt-color-surface-raised`, `--kpt-elevation-4`; the backdrop `--kpt-color-overlay-scrim`. ## Name and scrolling Without `header` give the panel `ariaLabel` - a `role="dialog"` without a name is announced as a bare "dialog". An open drawer locks page scrolling underneath.