SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

On this page

MenuItemCard

An item on a menu as one card.

View code
tsx
<MenuItemCard
	dialog="item-al-pastor"
	name="Al pastor trio"
	description="Spit-roasted pork, charred pineapple, cilantro and onion."
	price="From $11.50"
	badges={<Badge color="success" variant="secondary">Vegetarian</Badge>}
	media={<img src={dish.picture} alt="" />}
	mediaBackground="oklch(0.9 0.07 75)"
/>

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { MenuItemCard } from "@sdxc/ui/commerce";

Renders the card. It fills its grid cell, so a row of cards lines up whatever each description's length.

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
dialogstringYesThe id of the dialog the card opens.
namestringYes
descriptionstringNo
priceRemixNodeYesThe price as the reader sees it, such as "$11.50" or "From $11.50".
badgesRemixNodeNoWords or badges after the price, such as "Popular" or a dietary tag.
mediaRemixNodeNoThe picture, such as the dish; the card shows no picture when unset.
mediaBackgroundstringNoThe colour behind the picture.
unavailablebooleanNoHides the + when the item cannot be added now; the card still opens its details.
@sdxc/ui

Can’t find it? Contact us