npm.io
4.2.14 • Published 4d ago

@medusajs/ui

Licence
MIT
Version
4.2.14
Deps
20
Size
2.0 MB
Vulns
0
Weekly
0
Stars
36.6K

Medusa logo

@medusajs/ui

Documentation | Website

Building blocks for digital commerce

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

Medusa UI: the React component library of Medusa's design system, used to build the Medusa Admin dashboard. Use it to build admin widgets and UI routes that match the dashboard, or in any React app styled with Tailwind CSS and @medusajs/ui-preset.

At a glance

Package @medusajs/ui
Type Design system
Import from @medusajs/ui

Features

  • Components such as Button, Container, Heading, Input, Select, Table, FocusModal, Drawer, DatePicker, and Toaster.
  • A DataTable block for filterable, sortable, paginated tables.
  • Hooks: usePrompt and useToggleState.
  • Utilities: clx for merging class names, and toast for showing toasts.

Installation

Admin extensions in a Medusa application or plugin can import @medusajs/ui without extra setup. In a standalone React project, install it with the Tailwind CSS preset:

npm install @medusajs/ui
npm install @medusajs/ui-preset --save-dev

Then follow the standalone installation guide to configure Tailwind CSS.

Usage

import { Button } from "@medusajs/ui"

const App = () => <Button variant="primary">Hello World</Button>

Resources