Slapdash Platform
GitHub
  • Ahoy, world!
  • Command Bar 101
    • How it Works
    • Core Terminology
    • Commands
    • Local Commands
    • Cloud Commands
    • Build Your First Command
    • Publish Command
    • Hooks
  • Command Tutorials
    • Toggle Dark Mode
    • Emoji Paster
    • Copy Special Character
    • Send Slack Message
  • Reference
    • Command Response
    • Action
    • View
    • List View
    • Masonry View
    • Form View
    • Tokens
    • Icon
    • Config
Powered by GitBook
On this page
  1. Command Tutorials

Emoji Paster

Search & paste emojis

PreviousToggle Dark ModeNextCopy Special Character

Last updated 3 years ago

This command illustrates how to return an interactive . In this case, we visualize emojis and their names. As you type, the command matches the emoji name. When you hit Enter, the command pastes the selected emoji in the active app.

In this example, you'll also notice that you can use an emoji as a custom icon for an .

/**
 * A command that shows a selection of emojis and pastes
 * the selected emoji on pressing Enter.
 */
const response = {
  view: {
    type: "list",
    options: [
      {
        title: "Heart",
        action: {
          type: "paste",
          value: "❤️",
        },
        icon: "❤️",
      },
      {
        title: "Star",
        action: {
          type: "paste",
          value: "⭐️",
        },
        icon: "⭐️",
      },
      {
        title: "Lightning",
        action: {
          type: "paste",
          value: "️⚡️",
        },
        icon: "⚡️",
      },
    ],
  },
};

console.log(JSON.stringify(response));

See on Github
List view
Option