Side panel over the page for details, filters and longer forms, on the native modal <dialog> (focus stays inside and returns to the opener). Full height; header and footer stay put while the body scrolls. Escape, the close button and a click on the backdrop close it unless dismissible is false. For short confirmations use kern-dialog.
Examples
Device details
A modal side panel for details and longer forms. Open it with show(), close it with close(returnValue); Escape, × and a backdrop click close it with cancel. kernClose reports the returnValue. Footer buttons: cancel first, confirm last.
side="start" slides the panel in from the left (in left-to-right layouts), width sets its width in px. With dismissible="false" neither Escape, × nor the backdrop close it — the footer buttons must.
When the panel opens, the focus goes to the first Kern field with autofocus (body or footer, also nested), once that field is ready; without one it lands on the close button. kernOpen fires after opening, for an app that picks the field itself. On close the focus returns to the opener.
closeLabelattribute close-label · default Close · de Schliessen
string | undefined
Accessible label of the close button.
dismissibledefault true
boolean
Close button, Escape and backdrop click close the panel.
heading
string | undefined
openmutablereflectsdefault false
boolean
sidereflectsdefault 'end'
"end" | "start"
Edge the panel slides in from (end = right in left-to-right layouts).
widthdefault 420
number
Panel width in px (at most the viewport minus 32px).
Events
kernClose
CustomEvent<{ returnValue: string; }>
After the panel closed; detail.returnValue as given to close() (cancel for Escape/backdrop/close button).
kernOpen
CustomEvent<void>
After the panel opened (show() or open). The focus moves to the first Kern field with autofocus once it is ready, otherwise it stays on the first focusable element (the close button); without autofocus the app can set it here.
Methods
close()
close(returnValue?: string) => Promise<void>
Closes the panel; returnValue is passed to kernClose.
show()
show() => Promise<void>
Opens the panel modally.
Slots
(default)
Body
footer
Buttons, right-aligned: cancel first, confirm last