appShellControls
Why JS.
import { appShellControls } from "@sdxc/ui/app";Usage
Wires the shell around the checkbox it is mixed onto until the checkbox leaves the page.
⌘B (Ctrl+B elsewhere) flips the checkbox while the sidebar is docked and opens or closes the
sheet below sheetBelow; it stays the editor's bold inside a text area or rich editor.
Signature
appShellControls(options: AppShellControlsOptions): MixinDescriptor<HTMLInputElement>Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options | AppShellControlsOptions | Yes |
Examples
<input type="checkbox" data-app-shell-collapse mix={[appShellControls({ cookieName, sidebarId })]} />Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/app too.
APP_SHELL_SHORTCUT
The shortcut that collapses and expands the sidebar, or opens the sheet on a phone.
const APP_SHELL_SHORTCUT = "mod+b"appShellQueries
The media queries on either side of sheetBelow, docked from it and a sheet under it, which
the shell's styles, its toggle and these controls all read so they switch at the same width.
appShellQueries(sheetBelow: AppShellSheetBelow): {
docked: string;
sheet: string;
}| Parameter | Type | Required | Description |
|---|---|---|---|
sheetBelow | "48rem" | "64rem" | Yes | The width under which the sidebar is a sheet. |
appShellQueries("64rem").docked // "(min-width: 64rem)"AppShellControlsOptions
Options for appShellControls.
| Member | Type | Required | Description |
|---|---|---|---|
cookieName | string | Yes | The cookie the collapsed state is written to, as "true" or "false". |
sidebarId | string | Yes | The sidebar element's id, which is also the sheet's popover. |
sheetBelow | "48rem" | "64rem" | No |
AppShellSheetBelow
The width under which an app shell's sidebar is a sheet behind the menu button.
type AppShellSheetBelow = "48rem" | "64rem"