Skip to content

SlashCommandItem

type SlashCommandItem = {
apply?: (ctx) => void;
attrs?: Record<string, unknown>;
blockType?: string;
hint: string;
icon: string;
id: string;
keywords: string[];
label: string;
};

Defined in: react/src/extensions/slash-command.tsx:15

PropertyTypeDescriptionDefined in
apply?(ctx) => void-react/src/extensions/slash-command.tsx:30
attrs?Record<string, unknown>-react/src/extensions/slash-command.tsx:29
blockType?stringHow to apply the chosen item to the current block. The default action for a built-in item runs setBlockType with blockType and attrs. Pass a custom apply to override (e.g. insert nodes, run any transaction). The default behaviour also strips the trigger / preceding the caret.react/src/extensions/slash-command.tsx:28
hintstring-react/src/extensions/slash-command.tsx:18
iconstring-react/src/extensions/slash-command.tsx:19
idstring-react/src/extensions/slash-command.tsx:16
keywordsstring[]-react/src/extensions/slash-command.tsx:20
labelstring-react/src/extensions/slash-command.tsx:17