Drawer
Show details or a form in a side panel without leaving the current page.
Live TypeScript example
Try the component here, then use the source below in your application.
- JavaScript
- 3.2 KiB
- Component CSS
- 1.2 KiB
- Shared theme CSS
- 3.8 KiBonce per application
How sizes are measured
The JavaScript figure includes this component’s required helpers. CSS includes its styling dependencies. Each entry is bundled separately for ES2022, minified, then compressed with gzip level 9. Your bundler may share helpers across components. Images, fonts, examples and application code are excluded.
Before compression: JavaScript 8.2 KiB; component CSS 3.8 KiB. These figures describe browser assets, not the complete package download.
View all component measurements →Interact with the Drawer example. The code below shows its actual inputs and callbacks.
import '@blukavantui/web/theme.css'
import {createDrawer} from '@blukavantui/web/drawer';
import '@blukavantui/web/drawer.css';
export function mount(host: HTMLElement) {
const open = document.createElement("button");
open.textContent = "Open drawer";
open.className = "blu-common-button blu-common-button--primary";
const content = document.createElement("div");
const label = document.createElement("label");
label.textContent = "Account name";
const input = document.createElement("input");
input.value = "Northstar Studio";
label.append(input);
content.append(label);
host.append(open);
const panel = createDrawer(host, { Title: "Edit account", Content: content, ConfirmLabel: "Save changes" }, {
Confirm: () => {
host.dataset.account = input.value;
panel.update({ IsOpen: false });
},
});
open.onclick = () => panel.update({ IsOpen: true });
return { destroy() { panel.destroy(); open.remove(); } };
}
const instance = mount(document.getElementById('example')!)
// When this page or framework component is removed:
// instance.destroy()
Install the library and add the host element
npm install https://blukavantui.blutekmedia.com/downloads/blukavantui-web-0.6.2.tgz<div id="example"></div>This example uses the downloadable @blukavantui/web package. Your application handles persistence and authentication through its typed callbacks. The starter ZIP includes this same example.
createDrawer
Pass options as the second argument and callbacks in the third argument. Keep the returned instance to update options or dispose it when its view is removed.
import { createDrawer } from '@blukavantui/web/drawer';
import '@blukavantui/web/drawer.css';Load @blukavantui/web/theme.css once in your app shell.createDrawer(host: HTMLElement, options: T.DrawerOptions, events?: T.DrawerEvents)Reference for @blukavantui/web 0.6.2. Required and optional follow the shipped TypeScript declarations; optional does not imply a particular default. Pass typed arrays and objects directly where shown.
Options
16| Name | Type / requirement | Usage |
|---|---|---|
IsOpen | booleanOptional | Controlled visibility. Assign OnOpenChanged.IsOpen back to this input. |
Title | stringOptional | Visible heading and accessible dialog name. |
Description | stringOptional | Optional supporting text beneath the heading. |
Size | stringOptional | Small, Medium or Large. |
CloseOnEscape | booleanOptional | Allows Escape to request closing. |
CloseOnBackdrop | booleanOptional | Allows a click on the backdrop to request closing. |
IsBusy | booleanOptional | Shows a working state and disables Confirm. Close and Cancel remain available; Escape and backdrop follow their settings. Closing does not cancel background work. |
ShowFooter | booleanOptional | Displays footer content and the default actions. |
ShowDefaultActions | booleanOptional | Displays built-in Cancel and Confirm buttons. |
ConfirmLabel | stringOptional | Built-in confirm caption. |
CancelLabel | stringOptional | Built-in cancel caption. |
Placement | stringOptional | Drawer edge: Left, Right or Bottom. |
InstanceKey | stringOptional | Optional business key emitted with Confirm. |
ExtendedClass | stringOptional | Additional CSS classes on the component root. |
Content | SlotOptional | Content slot: pass a DOM node or a text string. Strings are rendered as text. |
Footer | SlotOptional | Footer slot: pass your own DOM node or text. |
Callbacks
3| Name | Type / requirement | Usage |
|---|---|---|
OpenChanged | (isOpen: boolean, reason: string) => unknownOptional | |
Confirm | (key: string) => unknownOptional | |
Error | (message: string) => unknownOptional |
Instance methods & properties
3| Name | Signature / type | Usage |
|---|---|---|
element | HTMLElement | Root owned by this instance. Dispose before removing its host. |
update | (patch: Partial<T.DrawerOptions>) => void | Apply a partial options update to this instance. |
destroy | () => void | Dispose the instance and its listeners when the view is removed. |
Related data types
Expand a type for its fields and allowed values.
Slot
type Slot = Node | string;Use these inputs, events, actions and structures in Service Studio. Names and data bindings are specific to the native Blocks.
Included in the planned free BluKavantUI Community edition. The official OutSystems Forge release is coming soon. View Community scope →
Open OutSystems showcase ↗- Web runtime
- Supported
- TypeScript
- Supported
- OutSystems
- Supported
Statuses describe the component’s rendered code and interactions. Supply accessible content and follow the component guidance when integrating it.
Accessibility guidance →Purpose and use
Show details or a form in a side panel without leaving the current page.
Keyboard design guidance
Tab stays inside the drawer. Escape closes when allowed. Form fields retain their values while the drawer is open.
See the support status above for review coverage and any limitations.
In your application
Provide useful labels, preserve visible focus, and test the component with your actual content. Use text alongside status colors and check contrast in each state.
Events0No events yet.
Interact with an example to see its events.