SlashCommand
An entry of the slash menu: a title, optional subtitle, icon and aliases to filter on, a group and order for sorting, an optional
when to limit where it is offered, and the action to run. Extensions contribute theirs with slashCommands.
Definition
import type { SlashCommand } from '@aionbuilders/nabu/ui';interface SlashCommand {
aliases?: string[];
group?: 'text' | 'lists' | 'blocks' | 'media' | 'structure' | string & {};
icon?: string;
order?: number;
run: (engine: Nabu) => void;
subtitle?: string;
title: string;
when?: (engine: Nabu, block: any) => boolean;
}Properties
| Property | Type | Description |
|---|---|---|
aliasesoptional | string[] | n/a |
groupoptional | 'text' | 'lists' | 'blocks' | 'media' | 'structure' | string & {} | Where the entry is listed. Known
groups, in display order: |
iconoptional | string | A short text glyph (no emoji in the library's own entries). A theme or an integrator overrides an
entry's icon by providing its own entry ( |
orderoptional | number | Position inside the group (ascending, default 0); ties keep the declaration order. The menu's order never depends on the load order of the extensions. |
run | (engine: Nabu) => void | n/a |
subtitleoptional | string | n/a |
title | string | n/a |
whenoptional | (engine: Nabu, block: any) => boolean | Where the entry applies; |
Source: src/lib/ui/slash-menu.svelte.js:9