Drawer
Inline or modal detail according to an explicit mode; do not mix the two focus models.
Use the web element directly without the semantic runtime.
A registered presentation adapter can bind this component to host-owned meaning and state.
The standard recipe resolver does not select this component automatically.
Import and live example#
One inline end-side report detail drawer that keeps surrounding context visible.
Interactive preview requires JavaScript.
View the complete example source
import {registerAeliqoElements} from "@varendo/web";
import {
AeliqoAlertElement,
AeliqoDialogElement,
AeliqoDrawerElement,
AeliqoEmptyStateElement,
AeliqoPopoverElement,
AeliqoProgressElement,
AeliqoSkeletonElement,
AeliqoToastElement,
AeliqoTooltipElement,
} from "@varendo/web/feedback";
registerAeliqoElements();
const host = document.querySelector<HTMLElement>("#aeliqo-example") ?? (() => {
const created = document.createElement("div");
created.id = "aeliqo-example";
(document.body ?? document.documentElement).append(created);
return created;
})();
function createCatalogRoot(container: HTMLElement): HTMLElement {
const root = document.createElement("div");
root.dataset.catalogSourceRoot = "true";
root.style.display = "grid";
root.style.gap = "12px";
container.append(root);
return root;
}
function createCatalogElement<T extends HTMLElement>(tagName: string, container: HTMLElement): T {
const element = document.createElement(tagName) as T;
element.setAttribute("data-aeliqo-theme", "light");
container.append(element);
return element;
}
function appendSlottedText(root: HTMLElement, slot: string, textContent: string): void {
const content = document.createElement("span");
content.slot = slot;
content.textContent = textContent;
root.append(content);
}
const root = createCatalogRoot(host);
(((root) => {
const element = createCatalogElement<AeliqoDrawerElement>("aeliqo-drawer", root);
element.heading = "Report details";
element.mode = "inline";
element.side = "end";
element.open = true;
element.textContent = "Inline detail content keeps the surrounding task visible.";
}))(root);
Purpose#
Shows secondary detail at a chosen edge, inline in the layout or as a modal overlay. The mode sets focus and dismissal behavior; closing emits a request, not an action.
When to use it#
- Detail or actions should sit beside the page they relate to.
- Inline mode keeps the surrounding content visible and usable.
- Modal mode applies only when a separate focus boundary is needed.
When to use a different component#
Properties and defaults#
Inline mode participates in layout; modal mode is chosen by the host when a separate focus boundary is needed.
| Property | Use and ownership | Declared type | Initial value |
|---|---|---|---|
open | Controls whether the overlay or expandable surface is currently open. | boolean | false |
heading | Provides the visible overlay or feedback heading and its accessible label. | string | 'Details' |
mode | Supplies mode to the component as application-owned input. | AeliqoDrawerMode | 'inline' |
side | Chooses the edge from which the drawer opens. | AeliqoDrawerSide | 'end' |
Events#
| Event | Payload | Emitted | Application responsibility |
|---|---|---|---|
aeliqo-drawer-close | The close reason supplied by the drawer. | After Escape or a close control. | Set open to false and restore focus to the opener. |
Events cross the component boundary as user proposals. Validate their detail and current authority before applying a business effect.
Listen for aeliqo-drawer-close
const element = document.querySelector('aeliqo-drawer');<p>element?.addEventListener('aeliqo-drawer-close', (event) => {
const proposal = (event as CustomEvent<unknown>).detail;
// Validate the proposal, update host state, then assign controlled properties.
applyProposal(proposal);
});States and failure handling#
Relevant states:
- ready
Expected result: The detail surface adapts to inline or overlay mode and emits a close request.
Keyboard, focus, and accessibility#
Keyboard behavior:
- Tab
- Escape where modal
- focus returns to trigger
Exposed semantics:
- aria-label
- aria-labelledby
- button
- dialog
- header
Responsive behavior#
Inline mode uses its host column; give it the full row when that column is too narrow. Choose modal mode only when a separate focus boundary is needed.
Style hooks#
- Shadow parts:
close,content,header,inline,modal - Varendo design tokens referenced:
--aeliqo-color-border,--aeliqo-color-surface,--aeliqo-control-min-target,--aeliqo-space-12,--aeliqo-space-16
Related components#
Generated TypeScript declaration#
View generated declaration
export declare class AeliqoDrawerElement extends AeliqoFoundationElement {
static readonly properties: {
open: {
type: BooleanConstructor;
reflect: boolean;
};
heading: {
type: StringConstructor;
};
mode: {
type: StringConstructor;
};
side: {
type: StringConstructor;
};
};
static readonly styles: import("lit").CSSResult[];
open: boolean;
heading: string;
mode: AeliqoDrawerMode;
side: AeliqoDrawerSide;
private readonly overlayFocus;
protected willUpdate(changed: Map<string, unknown>): void;
protected updated(changed: Map<string, unknown>): void;
private syncModalDialog;
private showModalDialog;
private closeModalDialog;
private focusInlineTarget;
private keydown;
private close;
protected render(): import("lit").TemplateResult<1>;
}Version#
This page documents the Varendo 0.6 component contract.
