Command

A component that renders an unhighlighted code block, useful for one-liners or API routes.

In this guide, you'll learn how to use the Command component.

Was this example helpful?

Usage#

Code
import { Command } from "@medusajs/ui"
Code
<Command>
  <code>yarn add @medusajs/ui</code>
</Command>

API Reference#

This component is based on the div element and supports all of its props


Usage Outside Medusa Admin#

If you're using the Command component in a project other than the Medusa Admin, make sure to include the TooltipProvider somewhere up in your component tree, as the Command.Copy component uses a Tooltip:

Code
<TooltipProvider>
  <Command>
    <code>yarn add @medusajs/ui</code>
    <Command.Copy
      content="yarn add @medusajs/ui"
      className="ml-auto"
    />
  </Command>
</TooltipProvider>
Was this guide helpful?
Ask Bloom
For assistance in your development, use Claude Code Plugins or Docs MCP server in Cursor, VSCode, etc...FAQ
What is Medusa?
How can I create a module?
How can I create a data model?
How do I create a workflow?
How can I extend a data model in the Product Module?
Recipes
How do I build a marketplace with Medusa?
How do I build digital products with Medusa?
How do I build subscription-based purchases with Medusa?
What other recipes are available in the Medusa documentation?
Chat is cleared on refresh
Line break
⇧↵