Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

SideBarToggle

SideBarToggle requests that a sidebar invert its current open or closed state.

Usage

import { SideBarToggle } from "@artisansdk/workbench"

workbench.emit(new SideBarToggle({ target: "primary" }))

Payload

type Options = {
    target: "primary" | "secondary"
}

If target is omitted, the event defaults to the primary sidebar.

Behavior

The React Sidebar component listens for this event and toggles the matching sidebar when it is received.