stnd.build

@stnd/launcher

Circle 2 — Application Superpower (Official Extension) · Stable · First-Party

Role: Global Cmd+K command palette, fuzzy action search, keyboard shortcut dispatcher, and custom modal views.

When to use: Register module commands via the launcher:action hook in index.module.js so users can trigger actions from anywhere.

Quick Start (TL;DR)

// modules/my-feature/index.module.js
export default {
  id: "my-feature",
  hooks: { "launcher:action": ["./actions/commands.js"] },
};

The Universal Command Palette engine for the Standard Framework.

@stnd/launcher provides a centralized interface for command execution, navigation, and view management. It adheres to the “Standard” design philosophy: clean, keyboard-centric, and extensible.

ELI5

Cmd+K on any Standard site — that’s this. A registry holds every command and “view” (a full Svelte panel, like Settings or the file navigator) any loaded module has registered; the palette searches across all of it. A module adds its own command by calling register() once; it shows up in the palette for everyone, no wiring needed on the app’s side.

It’s already on — @stnd/launcher is a Gold Standard module. To add your own command from inside a module:

import { register } from "@stnd/launcher";
register("::my-command", { title: "Do the thing", icon: "star" }, () => doTheThing());

Architecture

The Launcher follows a Reactive Core pattern:

Usage

Import and mount the <Launcher /> component in your layout:

<script>
  import Launcher from "@stnd/launcher/Launcher.svelte";
</script>

<!--
  load: Optional allow-list of commands/views to enable.
  If omitted, all registered commands are loaded.
-->
<Launcher />

Props

Prop Type Default Description
load string | string[] | function null Accepted for backward compatibility; it has no effect.
userStore readable null Svelte store containing the current user.
searchNotes function null Async function to search app content.
WelcomeView Component null Custom component for the empty state.
FooterView Component null Custom component for the optional launcher footer.
footer Snippet null Svelte 5 snippet for custom footer content.
showFooter boolean | "always" false Enable built-in footer (navigation hints & info).

Core Concepts

Registry

The registry holds all available Commands and Views.

Sizing

The launcher window adapts to its content.

Views can request size changes dynamically:

// In your view component
let { setSize } = $props();

// Expand window
setSize({ width: "wide", height: "tall" });

API (launcher.ts)

import {
  initLauncher,
  register,
  launcherView,
  launcherToggle,
  setSize,
} from "@stnd/launcher";

initLauncher(options)

Initialize the engine with app-specific logic.

register(trigger, meta, handler)

Register a new command or view.

launcherView(view, props)

Switch the active view.

Keyboard: Esc

The launcher registers Esc with the keyboard module:

Data Attributes

The UI listens for clicks on elements with specific data attributes: