OverviewInstallationMigrating to 1.0Themes and layersKanok designCustomizingIconsForms and validationFrameworksUsing with AIButtonText inputText areaNumber inputSearchSelectDropdownComboboxMulti-selectCheckboxRadio buttonToggleDate pickerTime pickerSliderFile uploaderModalSide panelTearsheetNotificationToastTooltipDefinition tooltipPopoverToggletipMenuData tableStructured listPaginationContained listTree viewTabsBreadcrumbLinkPagination navContent switcherAccordionProgress indicatorUI shellTagTileCardProduct cardCode snippetCopy buttonUser avatarTruncated textListLoadingInline loadingProgress barSkeletonBadge indicatorStatus indicatorGridHeadingLayerAction setPage headerBig numberEdit in placeIntroductionText inputText areaNumber inputSearchSelectDropdownComboboxMulti-selectCheckboxRadio buttonToggleDate pickerTime pickerSliderFile uploaderTabsPagination navContent switcherTooltipDefinition tooltipPopoverMenuAccordionProgress indicatorUI shellModalSide panelTearsheetNotificationToastData tableStructured listPaginationTree viewCode snippetCopy buttonTruncated textLoadingTagCardProduct cardEdit in place
Side panel
A side panel slides in from the edge of the screen, under the 48px UI shell header, to show details or a short form while the page stays in view. It is Carbon for IBM Products' SidePanel. For a task that needs the whole screen, use a Tearsheet; for a short decision, a Modal.
The panel is position: fixed. The live examples below sit in a box that holds it, with --ui-side-panel-top: 0px because the box has no header above it.
Edit incident
Reported by the finance team on 8 October 2026.
CancelSave
HTMLReactReact + Tailwind<divstyle="transform: translateZ(0); position: relative; height: 420px; overflow: hidden; border: 1px solid var(--ui-hairline); --ui-side-panel-top: 0px">
<divstyle="padding: 16px"><ui-buttonid="side-panel-open">Edit incident</ui-button></div>
<ui-side-panelid="side-panel-edit"heading="Incident INC-2041"size="sm"selector-initial-focus="#side-panel-edit-title">
<spanslot="subtitle">Reported by the finance team on 8 October 2026.</span>
<divstyle="display: grid; gap: 16px; padding-block: 16px">
<ui-text-inputid="side-panel-edit-title"label="Title"value="Invoice export fails"></ui-text-input>
<ui-selectlabel="Priority"value="high">
<optionvalue="low">Low</option>
<optionvalue="high">High</option>
</ui-select>
<ui-text-arealabel="Notes"></ui-text-area>
</div>
<ui-buttonslot="actions"kind="secondary">Cancel</ui-button>
<ui-buttonslot="actions">Save</ui-button>
</ui-side-panel>
</div>
<scripttype="module">
const panel = document.getElementById('side-panel-edit');
document.getElementById('side-panel-open').addEventListener('click', () => (panel.open =true));
for (const button of panel.querySelectorAll('[slot="actions"]')) button.addEventListener('click', () => (panel.open =false));
</script>const [open, setOpen] =useState(false);
<UiButtononClick={() =>setOpen(true)}>Edit incident</UiButton>
<UiSidePanelopen={open} heading="Incident INC-2041"size="sm"selectorInitialFocus="#incident-title"onUiClose={() =>setOpen(false)}>
<spanslot="subtitle">Reported by the finance team on 8 October 2026.</span>
<UiTextInputid="incident-title"label="Title"value="Invoice export fails" />
<UiSelectlabel="Priority"value="high">…</UiSelect>
<UiTextArealabel="Notes" />
<UiButtonslot="actions"kind="secondary"onClick={() =>setOpen(false)}>Cancel</UiButton>
<UiButtonslot="actions"onClick={() =>setOpen(false)}>Save</UiButton>
</UiSidePanel>const [open, setOpen] =useState(false);
<ButtononClick={() =>setOpen(true)}>Edit incident</Button>
<SidePanelopen={open}
onRequestClose={() =>setOpen(false)}
heading="Incident INC-2041"subtitle="Reported by the finance team on 8 October 2026."size="sm"selectorInitialFocus="#incident-title"actions={[
{ label:'Cancel', kind:'secondary', onClick: () =>setOpen(false) },
{ label:'Save', onClick: () =>setOpen(false) },
]}
>
<TextInputid="incident-title"label="Title"defaultValue="Invoice export fails" />
<Selectlabel="Priority"defaultValue="high">…</Select>
<TextArealabel="Notes" />
</SidePanel>
Installation
npmshadcn · Web componentshadcn · React + TailwindManualnpminstall@purpurabog/uinpxshadcn@4add@kanok-ui/side-panelnpxshadcn@4add@kanok-ui/tw-side-panel# Web component# 1. Install the dependenciesnpminstalllit@^3.3.0# 2. Copy each file's "content" from# https://cdn.jsdelivr.net/npm/@purpurabog/ui@2.3.0/registry/side-panel.json# to its target:# components/ui/primitives/side-panel/side-panel.styles.ts# components/ui/primitives/side-panel/side-panel.ts# 3. Do the same for the items it needs (registry/<name>.json):# core-action-set, core-modal, core-motion, core-overlay, core-position, icon-button, layer, shared-action-set, shared-element, shared-events, shared-field, shared-localize, shared-quiet-focus, tokens# React + Tailwind# 1. Install the dependenciesnpminstall@purpurabog/ui@^2.3.0# 2. Copy each file's "content" from# https://cdn.jsdelivr.net/npm/@purpurabog/ui@2.3.0/registry/tw-side-panel.json# to its target:# components/ui/react-tw/side-panel.tsx# 3. Do the same for the items it needs (registry/<name>.json):# core-action-set, core-motion, core-position, tw-action-set, tw-i18n, tw-icon-button, tw-layer, tw-refs, tw-theme, tw-utils
npm gives you every component from the package. shadcn copies the source into your app instead: a copy pinned to this version that you can change. The shadcn commands need the @kanok-ui registry in your components.json once, see Installation.
Set open to show it and back to false to hide it; it slides 320px in from its edge while fading in, and out the same way (150ms each, as Carbon), with no movement when the reader asks for reduced motion. heading is also the panel's accessible name. On open, focus goes to selector-initial-focus (a selector inside the panel), else to the first control. On close it goes back to what had it.
×, Esc and a click on the overlay ask to close first (see Ask before closing); ui-close fires after the panel has slid out. React + Tailwind is controlled: onRequestClose(reason) reports them, and you set open to false.
Sizes
size: xs 16rem, sm 20rem, md 30rem (the default), lg 40rem, xl 65rem, 2xl 80rem. From medium screens up a panel is never wider than 75% of the screen, and never wider than its container.
include-overlay dims the page behind the panel and stops it scrolling. A click on the overlay asks to close (overlay), unless prevent-close-on-click-outside is set.
slide-in makes room for the panel instead of covering the page: the element that selector-page-content points to gets a margin as wide as the panel. A slide-in panel doesn't take focus, keep Tab inside or close on Esc, so the page stays usable beside it.
Contract list: 24 contracts waiting for a signature.
Show summary
8 sale, 12 lease, 4 service contracts.
HTMLReactReact + Tailwind<divstyle="transform: translateZ(0); position: relative; height: 300px; overflow: hidden; border: 1px solid var(--ui-hairline); --ui-side-panel-top: 0px">
<divid="side-panel-page"style="display: grid; gap: 16px; padding: 16px">
<pstyle="margin: 0">Contract list: 24 contracts waiting for a signature.</p>
<div><ui-buttonid="side-panel-push-open"kind="tertiary">Show summary</ui-button></div>
</div>
<ui-side-panelid="side-panel-push"heading="Summary"slide-inselector-page-content="#side-panel-page"size="xs">
<p>8 sale, 12 lease, 4 service contracts.</p>
</ui-side-panel>
</div>
<scripttype="module">
const panel = document.getElementById('side-panel-push');
document.getElementById('side-panel-push-open').addEventListener('click', () => (panel.open =!panel.open));
</script><mainid="contracts">…</main>
<UiSidePanelopen={open} heading="Summary"slideInselectorPageContent="#contracts"size="xs"onUiClose={() =>setOpen(false)}>
<p>8 sale, 12 lease, 4 service contracts.</p>
</UiSidePanel><mainid="contracts">…</main>
<SidePanelopen={open} onRequestClose={() =>setOpen(false)} heading="Summary"slideInselectorPageContent="#contracts"size="xs">
<p>8 sale, 12 lease, 4 service contracts.</p>
</SidePanel>
Action buttons
Up to four <ui-button slot="actions"> sit at the foot of the panel, laid out as Carbon's ActionSet for the panel's size: side by side, or one per row in an xs or sm panel and in an md panel with more than two. They are 64px tall; condensed-actions makes them 48px. React + Tailwind takes them as data in actions.
Three actionsCondensed
Purchase request PR-2026-0318, 128,500 baht, from the IT department.
slot="action-toolbar" puts small buttons under the header: the first one with its label, the rest as icon buttons. React + Tailwind takes them in actionToolbar.
Open contract
Office lease, 3rd floorCopy link
24 months from 1 November 2026, 45,000 baht a month.
With a label-text, a subtitle or a toolbar, and enough content to scroll, the label and subtitle fade as the content scrolls and the heading shrinks into a compact bar (Carbon's default). animate-title="false" keeps the header still; reduced motion turns it off too. Scroll the panel below.
Open audit
Answer every question before you submit.
Save draftSubmit
HTMLReactReact + Tailwind<divstyle="transform: translateZ(0); position: relative; height: 420px; overflow: hidden; border: 1px solid var(--ui-hairline); --ui-side-panel-top: 0px">
<divstyle="padding: 16px"><ui-buttonid="side-panel-title-open"kind="tertiary">Open audit</ui-button></div>
<ui-side-panelid="side-panel-title"heading="Annual audit 2026"label-text="Internal audit"size="md">
<spanslot="subtitle">Answer every question before you submit.</span>
<divstyle="display: grid; gap: 16px; padding-block: 16px">
<ui-text-inputlabel="Auditor"></ui-text-input>
<ui-text-inputlabel="Department"></ui-text-input>
<ui-text-arealabel="Findings"></ui-text-area>
<ui-text-arealabel="Risks"></ui-text-area>
<ui-text-arealabel="Recommendations"></ui-text-area>
</div>
<ui-buttonslot="actions"kind="secondary">Save draft</ui-button>
<ui-buttonslot="actions">Submit</ui-button>
</ui-side-panel>
</div>
<scripttype="module">
const panel = document.getElementById('side-panel-title');
document.getElementById('side-panel-title-open').addEventListener('click', () => (panel.open =true));
for (const button of panel.querySelectorAll('[slot="actions"]')) button.addEventListener('click', () => (panel.open =false));
</script><UiSidePanelopen={open} heading="Annual audit 2026"labelText="Internal audit"onUiClose={() =>setOpen(false)}>
<spanslot="subtitle">Answer every question before you submit.</span>
…
</UiSidePanel><SidePanelopen={open} onRequestClose={() =>setOpen(false)} heading="Annual audit 2026"labelText="Internal audit"subtitle="Answer every question before you submit."actions={…}>
…
</SidePanel>
Steps
A panel can hold a short flow. current-step above 0 shows a back button at the top; pressing it fires ui-navigate-back (React + Tailwind: onNavigationBack), and you change the step and the content. The content scrolls back to the top when the step changes.
The back button is named "Back" in the page language; navigation-back-icon-description changes it.
Content above and below the title
slot="above-title" goes above the label and heading, slot="below-title" under the subtitle: a status tag, a search field. React + Tailwind has neither: put the content at the start of the panel's children.
Open request
Laptops for the IT department
Approved
128,500 baht, approved by Chaiya R. on 9 October 2026.
HTMLReactReact + Tailwind<divstyle="transform: translateZ(0); position: relative; height: 320px; overflow: hidden; border: 1px solid var(--ui-hairline); --ui-side-panel-top: 0px">
<divstyle="padding: 16px"><ui-buttonid="side-panel-slots-open"kind="tertiary">Open request</ui-button></div>
<ui-side-panelid="side-panel-slots"heading="PR-2026-0318"size="sm">
<spanslot="subtitle">Laptops for the IT department</span>
<divslot="below-title"style="padding-block-end: 16px"><ui-tagtype="green">Approved</ui-tag></div>
<p>128,500 baht, approved by Chaiya R. on 9 October 2026.</p>
</ui-side-panel>
</div>
<scripttype="module">
const panel = document.getElementById('side-panel-slots');
document.getElementById('side-panel-slots-open').addEventListener('click', () => (panel.open =true));
</script><UiSidePanelopen={open} heading="PR-2026-0318"size="sm"onUiClose={() =>setOpen(false)}>
<spanslot="subtitle">Laptops for the IT department</span>
<divslot="below-title"><UiTagtype="green">Approved</UiTag></div>
<p>128,500 baht, approved by Chaiya R. on 9 October 2026.</p>
</UiSidePanel><SidePanelopen={open} onRequestClose={() =>setOpen(false)} heading="PR-2026-0318"subtitle="Laptops for the IT department"size="sm">
<Tagtype="green">Approved</Tag>
<p>128,500 baht, approved by Chaiya R. on 9 October 2026.</p>
</SidePanel>
Ask before closing
×, Esc and a click on the overlay fire ui-request-close, cancelable, with the reason: close-button, escape or overlay. Call preventDefault() to keep the panel open. requestClose(reason) asks the same way from your own button; setting open to false closes without asking. The panel below only closes with its Done button.
Open checklist
Asked to close by:
Tick every item, then press Done.
Done
HTMLReactReact + Tailwind<divstyle="transform: translateZ(0); position: relative; height: 300px; overflow: hidden; border: 1px solid var(--ui-hairline); --ui-side-panel-top: 0px">
<divstyle="padding: 16px">
<ui-buttonid="side-panel-guard-open"kind="tertiary">Open checklist</ui-button>
<p>Asked to close by: <outputid="side-panel-guard-out"></output></p>
</div>
<ui-side-panelid="side-panel-guard"heading="Signing checklist"size="sm"include-overlay>
<p>Tick every item, then press Done.</p>
<ui-buttonslot="actions"id="side-panel-guard-done">Done</ui-button>
</ui-side-panel>
</div>
<scripttype="module">
const panel = document.getElementById('side-panel-guard');
document.getElementById('side-panel-guard-open').addEventListener('click', () => (panel.open =true));
document.getElementById('side-panel-guard-done').addEventListener('click', () => (panel.open =false));
panel.addEventListener('ui-request-close', (event) => {
event.preventDefault();
document.getElementById('side-panel-guard-out').value = event.detail.reason;
});
</script><UiSidePanelopen={open} heading="Signing checklist"includeOverlayonUiRequestClose={(e) => { e.preventDefault(); setReason(e.detail.reason); }} onUiClose={() =>setOpen(false)}>
<p>Tick every item, then press Done.</p>
<UiButtonslot="actions"onClick={() =>setOpen(false)}>Done</UiButton>
</UiSidePanel>// onRequestClose only reports: the panel stays open until you set open to false
<SidePanelopen={open} onRequestClose={setReason} heading="Signing checklist"includeOverlayactions={[{ label:'Done', onClick: () =>setOpen(false) }]}>
<p>Tick every item, then press Done.</p>
</SidePanel>
ui-request-close and ui-close bubble, so a notification inside fires them on the panel too: check that event.target is the panel. React's UiSidePanel does that for you: onUiRequestClose and onUiClose get only the panel's own events.
hide-close-button removes ×; then give the panel another way to close.
Keyboard
Key
Does
Tab / Shift+Tab
Moves through the panel's controls and wraps around inside it (not with slide-in)
Esc
Asks to close (escape; not with slide-in); focus goes back to what opened it
Accessibility
The panel is a complementary landmark named by its heading.
× is named "Close" and the back button "Back", in the page language, with a tooltip; close-icon-description and navigation-back-icon-description change them.
A slide-over panel keeps Tab inside, but the page behind it is not inert: screen reader users can still reach it with their reading keys. Use a Modal when the page must be out of reach.
Small buttons under the header (the first one with its label)
actions
The action buttons
CSS parts
Part
Description
panel
The panel
overlay
The overlay of include-overlay
header
The header
heading
The heading
body
The content's box
actions
The row of action buttons
CSS custom properties
Custom property
Default
Description
--ui-side-panel-top
Where the panel starts (default 3rem, under the UI shell header)
--ui-side-panel-radius
Corner radius of the edge facing the page (default 0; Kanok: 12px)
--ui-actions-gap
/ --ui-actions-padding - Gap between the action buttons and padding round them (default none: full-bleed buttons that touch; Kanok: 8px / 16px 20px)
--ui-actions-button-flex
flex of each action button (default: Carbon's widths by count; Kanok: their own width)
--ui-actions-button-align
/ --ui-actions-button-padding-top - Where a button's label sits (default: at the top, 16px in)
--ui-actions-stacked-direction
/ --ui-actions-stacked-wrap / --ui-actions-stacked-width - Where Carbon stacks the actions (narrow): flex-direction, flex-wrap and each button's width (default column-reverse, nowrap, 100%; Kanok: one row that wraps)