Skip to main content
A module adds full screens, command palette entries and Settings sections to the studio, and its components read studio data through hooks.

Add a page with definePageComponent

A page is a full screen. It has a path and a React component.
The page appears at /workspaces/<workspace>/report. $name in the path is a parameter, such as report/$stage. A page that a nav item or a command points at also needs a definePage in the manifest with the same id, so that the sidebar can show its label and icon.

Add a command with defineCommand

A command is an entry in the command palette (⌘K). It can have a group and a keyboard shortcut.
The ctx passed to run can navigate, open a record, start creating a record, a document or a task, and close the palette. A when function hides a command that does not apply. Commands that come from search results, such as “records that match what was typed”, are registered as a command provider instead.

Add a Settings section with defineSettingsSection

A module can add a section to Settings with defineSettingsSection: a name, a label, an icon, a group and a component. It is for configuration that belongs to the module.

Hooks

Components read the studio’s data through hooks exported from @devias/studio, such as useWorkspace, useSchema, useRecords, useRecord and useNavigateTo. The hooks keep the studio’s cache and live updates working.