Slash Commands

Slash commands are an AI UX pattern where typing "/" in the composer opens a menu of quick actions, templates, or model switches. They give power users keyboard-first access to capabilities without leaving the input field or navigating menus, and are common in chat, coding, and productivity tools.

Share

When to use

Perfect for IDEs, productivity tools, and developer environments where power users need quick keyboard-first access to AI models, templates, and actions.

When not to use

  • Consumer surfaces where most users never learn command syntax and would never discover the feature.
  • Products with very few actions, where a visible button is faster to find than a hidden command.
  • Mobile-first composers where a slash menu competes with the on-screen keyboard for space.

Anti-patterns

  • No visible hint that "/" does anything, leaving the feature undiscoverable.
  • Commands with cryptic names and no description or preview of what they do.
  • Slash menu and a separate "+" menu offering overlapping actions with no shared mental model.
  • Breaking normal typing when a message legitimately starts with a "/" character.

How products use it

ProductImplementation
SlackSlash commands trigger integrations and actions like /remind or /poll from the message box.
NotionTyping "/" opens a block-type and AI-action menu inline in the document.
DiscordSlash commands expose bot and app actions with argument autocomplete.
MidjourneySlash commands like /imagine and /blend are the primary way to invoke generation.

Use this pattern in your project

Copy this prompt to generate a production-ready implementation in Cursor, Claude Code, Lovable, or any AI coding agent.

Generate a production-ready implementation of the "Slash Commands" AI interface design pattern.

Pattern Definition:
Interactive Demo
Restart demo
/edit
/explain
/test

Frequently asked questions

What are slash commands in AI chat interfaces?

Slash commands let users type "/" in a chat or composer input to open a menu of quick actions, templates, or model switches, then select one with the keyboard instead of hunting through a settings menu.

Are slash commands only useful for power users?

Mostly yes. Slash commands reward users who already know the vocabulary of available actions, so they work best as an accelerator layered on top of discoverable buttons, not as the only way to reach a feature.

How is a slash command different from an @ mention?

Slash commands invoke actions or templates; @ mentions reference context like files, people, or agents. Some products use both in the same composer, so distinct trigger characters and menu styling help users tell them apart.

Get new patterns by email

Weekly AI interface UX notes and resources on Substack, no spam, unsubscribe anytime.

Subscribe on Substack