SidebarToggle
Responsive mobile drawer toggle island for sidebar-shell consumers.
All components · Theme builder · Implementation source
Live preview
Open live sidebar-toggle preview
Install
Shell
netscript ui:add sidebar-toggleUsage and examples
The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.
TypeScript
import { useState } from 'preact/hooks';
import SidebarToggle from '@app/islands/ui/SidebarToggle.tsx';
export function Example() {
const [value, setValue] = useState('standard');
const [open, setOpen] = useState(false);
const [notice, report] = useState('');
return (<><div><div><SidebarToggle /><aside data-sidebar>Orders navigation</aside><div data-sidebar-backdrop /></div></div><p role="status">{notice}</p></>);
}Props
Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.
| Owner | Prop | Type | Optional | Description |
|---|---|---|---|---|
SidebarToggleProps | class | string | Yes | |
SidebarToggleProps | sidebarSelector | string | Yes | |
SidebarToggleProps | backdropSelector | string | Yes | |
SidebarToggleProps | openLabel | string | Yes | |
SidebarToggleProps | closeLabel | string | Yes | |
SidebarToggleProps | openIcon | Renderable | Yes | |
SidebarToggleProps | closeIcon | Renderable | Yes |
TypeScript
SidebarToggleProps extends Omit<JSX.HTMLAttributes<HTMLButtonElement>, "class" | "children">Keyboard
| Key | Action |
|---|---|
Enter | Activate |
Space | Activate button; links use native Enter |
Tokens
Semantic contract roles: surface/card, text/fg.
CSS custom properties referenced directly: Composed primitives supply their own tokens.
Contract and compatibility
Accessibility pattern: WAI-ARIA guidance
- Native DOM attributes pass through where the implementation accepts them.
Design contract values marked planned are not implementation props. The props above describe what ships today.