MenuItemCard
An item on a menu as one card.
View code
<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.
npm add @sdxc/ui remiximport "@sdxc/ui/theme.css";Usage
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.
| Prop | Type | Required | Description |
|---|---|---|---|
dialog | string | Yes | The id of the dialog the card opens. |
name | string | Yes | |
description | string | No | |
price | RemixNode | Yes | The price as the reader sees it, such as "$11.50" or "From $11.50". |
badges | RemixNode | No | Words or badges after the price, such as "Popular" or a dietary tag. |
media | RemixNode | No | The picture, such as the dish; the card shows no picture when unset. |
mediaBackground | string | No | The colour behind the picture. |
unavailable | boolean | No | Hides the + when the item cannot be added now; the card still opens its details. |