Toolbar scripts
A toolbar script is one TSX file (TypeScript with JSX): a metadata header that says what the toolbar is
and where it runs, and a React-style component that renders the toolbar. The API
follows Raycast's React conventions: the toolbar
is a tree of parts (<Toolbar.Button title icon onAction />, <Toolbar.Menu>…), a
command either runs onAction or performs a prebuilt <Action.…>, icons are
Icon.Search-style constants, and anything creative goes in a <Toolbar.Widget>,
which renders whatever you like. The host draws the parts in Banner 2, Bundleware's
one design, and updates them in place whenever your component re-renders.
Open the Dashboard from the extension popup to read the source of the bundled
toolbars in its Editor, edit them, or write your own. There are no imports and no build step: the
extension strips the types and compiles the JSX itself, and components render with
Preact, a small React-compatible library built into the
runtime. Types are optional: plain JavaScript, with or without JSX, is valid TSX
too, and compiles as it always did. The one difference is rare: TypeScript reads
a < b > (c) as a call with a type argument, so write that comparison as
(a < b) > c. The extension does not type-check scripts as it runs them; check them
with tsc, as below. Toolbars contributed to this repository are scripts too; see the
specification.