Overview
SlashActionMenuList provides the / command experience you see in modern editors: when a user types / at the start of a line, a menu appears near the caret with available block types. Unlike ActionMenuList, this component is self-managed – it handles keyboard listeners, filtering, floating positioning, etc.

Features
- ✅ Automatic trigger when typing
/ - ✅ Filters block types as user types (
/hea…) - ✅ Keyboard navigation (↑ ↓ Enter Esc)
- ✅ Inline positioning via Floating UI
inline()middleware - ✅ Compound components (
Root,Group,Item,Empty) - ✅ Programmatic API to open from code (e.g., from FloatingBlockActions)
Basic Usage
Programmatic Opening
Need to open the slash menu from code (e.g., when clicking the ”+” button inFloatingBlockActions)? Use the lightweight hook:
API Reference
Components
SlashActionMenuList.Root
Portal/overlay container. Use getRootProps() for positioning.
children, className?, style?
SlashActionMenuList.Group
Wraps the list of items.
SlashActionMenuList.Item
Menu item with title + optional description.
action, selected?, icon?, spreads button props (type="button").
SlashActionMenuList.Empty
Empty state message (default “No results”).
Hooks
useSlashActionMenu({ trigger = '/' })
Full hook with all logic (keyboard listeners, filtering, Floating UI).
| Property | Description |
|---|---|
isOpen | Whether the menu is mounted |
actions | Filtered list of block actions |
selectedAction | Currently highlighted action |
empty | True when actions.length === 0 |
searchText | Current filter text (without trigger) |
getItemProps | Returns props for <SlashActionMenuList.Item> (keyboard/mouse handlers) |
getRootProps | Returns props for <SlashActionMenuList.Root> (floating ref, styles) |
open(reference?) | Open programmatically with optional reference |
close() | Close menu |
useSlashActionMenuActions()
Lightweight hook with open/close/isOpen for programmatic control.
open(reference) expects a virtual element (HTMLElement or ) – typically derived from the current selection range.
Behavior
- Typing
/at the start of a block opens the menu - Typing
/heafilters actions Arrow Up/Downnavigate itemsEnterconfirms selection (replaces current block)Escapecloses the menu- If no results for 3 seconds, menu auto-closes
Examples
Custom Action Set
Custom Trigger
Empty State Customization
Styling
CSS Variables
Uses the same base variables asActionMenuList, but namespaced with yoopta-ui-slash-action-menu.
Tailwind Example
Accessibility
- Uses
listboxsemantics - Items respond to keyboard focus
- Provide descriptive titles/descriptions for clarity
Best Practices
Insert default block before opening programmatically
Insert default block before opening programmatically
Freeze FloatingBlockActions while menu open
Freeze FloatingBlockActions while menu open
Provide helpful descriptions
Provide helpful descriptions