@commmerce/review 1.20.4 → 1.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":"1.20.4","components":[{"tag":"cm-button","slug":"button","name":"Button","react":"Button","group":"Actions","summary":"Triggers an action or moves the merchant to the next step.","lead":"Buttons make the main action on a screen obvious. Black is the primary action; everything else is secondary: white with a grey outline, like a field.","docs_url":"https://commmerce.com/commmerceui/#components--button","properties":[{"attribute":"variant","property":"variant","type":"'primary' | 'secondary' | 'tertiary'","default":"'secondary'","description":"`primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline);\n`tertiary` (since 1.19) = no fill and no outline until hovered, for icon buttons in a header bar or a column heading."},{"attribute":"size","property":"size","type":"'large' | 'medium' | 'slim'","default":"'medium'","description":"`large` 40px (save bars, page actions), `medium` 36px (default), `slim` 32px (toolbars, table rows). Text is 14px (13px on slim).\nOn touch screens (`pointer: coarse`) every size is drawn at least 40px tall (icon-only: 40 x 40) and its hit area reaches\n44px. Owner standard since 1.6 (1.5 drew 44px on touch screens; sizes before 1.5 were 46, 32 and 24px)."},{"attribute":"type","property":"type","type":"'button' | 'submit' | 'reset'","default":"'button'","description":"Form behaviour when inside a `<form>`: `submit` submits it, `reset` resets it."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks clicks and dims the button. Prefer explaining why nearby."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner and blocks clicks while an action runs."},{"attribute":"href","property":"href","type":"string | undefined","description":"Renders a link styled as a button."},{"attribute":"target","property":"target","type":"string | undefined","description":"Link target when `href` is set. `_blank` adds `rel=\"noopener noreferrer\"`."},{"attribute":"icon-only","property":"iconOnly","type":"boolean","default":"false","description":"Square button that shows only its icon (from `icon` or the `icon` slot). Give it a `label`."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Name of a"},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of an `icon-only` button (\"Notifications\", \"Refresh\"). Required with `icon-only`; ignored otherwise, so the visible text stays the name."},{"attribute":"count","property":"count","type":"number","default":"0","description":"Small counter on the button, e.g. unread notifications. Hidden at 0; over 99 shows \"99+\". Screen readers hear the exact number (\"Notifications, 3 unread\")."},{"attribute":"tone","property":"tone","type":"'critical' | 'success' | undefined","description":"Colours the button by meaning: `critical` (red: delete, \"Not interested\") or `success` (green: \"Sale closed\").\nSecondary: tone text, icon and outline on a white fill. Primary: filled in the tone. Leave unset for the\nstandard black and white. Colour is never the only signal: the label must say what happens. Since 1.2."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Label. Visually hidden when `icon-only` (it still names the button if `label` is empty)."},{"name":"icon","description":"Optional leading icon. Overrides the `icon` attribute."}],"events":[{"name":"click","description":"Native click; suppressed while disabled or loading."}],"parts":[],"examples":[{"title":"Primary and secondary","description":"The save bar pattern: secondary on the left, primary on the right. One primary button per group.","html":"<div class=\"row\">\n <cm-button size=\"large\">Cancel</cm-button>\n <cm-button variant=\"primary\" size=\"large\">Save</cm-button>\n</div>"},{"title":"Sizes","description":"`large` (40px) for save bars, empty states and page actions, `medium` (36px, the default) for card and form actions, `slim` (32px) for toolbars, filter rows, dense rows and table cells. Text is 14px (13px on slim) and icons 16px at every size. On touch screens every size is drawn at least 40px tall, with a hit area that reaches 44px (owner standard, 1.6; 1.5 drew 44px). Since 1.5 (the sizes were 46, 32 and 24px).","html":"<div class=\"row\">\n <cm-button variant=\"primary\" size=\"large\">Large</cm-button>\n <cm-button variant=\"primary\" size=\"medium\">Medium</cm-button>\n <cm-button variant=\"primary\" size=\"slim\">Slim</cm-button>\n</div>"},{"title":"With icon","description":"Put an icon in the `icon` slot when it makes the action faster to recognise. Keep the label.","html":"<div class=\"row\">\n <cm-button><cm-icon slot=\"icon\" name=\"plus\" size=\"16\"></cm-icon>Add product</cm-button>\n <cm-button><cm-icon slot=\"icon\" name=\"upload\" size=\"16\"></cm-icon>Import</cm-button>\n <cm-button><cm-icon slot=\"icon\" name=\"external\" size=\"16\"></cm-icon>View store</cm-button>\n</div>"},{"title":"Icon only","description":"For well-known actions where space is tight: the header bar (notifications, refresh, search) and table rows. `icon-only` makes a square of the size's height (40, 36 or 32px; 40 × 40 on touch screens, with a 44px hit area). `label` is required: it is the name screen readers announce. Set `icon` to an icon name, or put a `cm-icon` in the `icon` slot.","html":"<div class=\"row\">\n <cm-button icon-only icon=\"refresh\" label=\"Refresh\"></cm-button>\n <cm-button icon-only icon=\"search\" label=\"Search\"></cm-button>\n <cm-button icon-only icon=\"edit\" label=\"Edit product\" size=\"slim\"></cm-button>\n <cm-button icon-only icon=\"bell\" label=\"Notifications\" size=\"large\"></cm-button>\n</div>"},{"title":"Tertiary","description":"`variant=\"tertiary\"` (since 1.19) has no fill and no outline until hovered. Use it for icon buttons in the header bar (refresh, notifications) and in a board column heading, where a row of outlined boxes looks heavy, above all on phones. Not for the main action of a page or a form.","html":"<div class=\"row\">\n <cm-button variant=\"tertiary\" icon-only icon=\"refresh\" label=\"Refresh this page\"></cm-button>\n <cm-button variant=\"tertiary\" icon-only icon=\"bell\" label=\"Notifications\" count=\"3\"></cm-button>\n <cm-button variant=\"tertiary\" icon-only icon=\"plus\" label=\"Add lead\" size=\"slim\"></cm-button>\n</div>"},{"title":"Count","description":"`count` adds a small counter, e.g. unread notifications. It is hidden at 0 and shows \"99+\" above 99. Screen readers hear the exact number as part of the name: \"Notifications, 3 unread\". When the count is not \"unread\" (tasks due, items waiting), change the wording with `strings` (keys `labelWithCount` for icon-only, `count` for text buttons) or `setStrings()`.","html":"<div class=\"row\">\n <cm-button icon-only icon=\"bell\" label=\"Notifications\" count=\"3\" size=\"large\"></cm-button>\n <cm-button icon-only icon=\"mail\" label=\"Mail\" count=\"120\" size=\"large\"></cm-button>\n <cm-button icon=\"inbox\" count=\"7\">Inbox</cm-button>\n <cm-button icon=\"tasks\" count=\"2\" strings='{\"count\":\"{count} due today\"}'>Tasks</cm-button>\n</div>"},{"title":"Tones","description":"`tone=\"critical\"` or `tone=\"success\"` colours a button by the outcome it records, so a row of choices scans quickly. Secondary buttons take the tone in their text, icon and outline; primary buttons are filled in it. Leave `tone` off for everything else: most buttons are black and white. Hover, focus, disabled and loading work as on the other buttons. Since 1.2.","html":"<div class=\"stack\">\n <div class=\"row\">\n <cm-button size=\"slim\" icon=\"phone\">Spoke to them</cm-button>\n <cm-button size=\"slim\" icon=\"repeat\">No answer, reschedule</cm-button>\n <cm-button size=\"slim\" tone=\"critical\" icon=\"x-circle\">Not interested</cm-button>\n <cm-button size=\"slim\" tone=\"success\" icon=\"check-circle\">Sale closed</cm-button>\n </div>\n <div class=\"row\">\n <cm-button>Cancel</cm-button>\n <cm-button variant=\"primary\" tone=\"critical\" icon=\"trash\">Delete customer</cm-button>\n </div>\n <div class=\"row\">\n <cm-button variant=\"primary\" tone=\"success\" icon=\"check\">Mark as won</cm-button>\n </div>\n</div>"},{"title":"A row of outcome choices","description":"When closing a task asks \"what happened?\" and there are 3 to 5 answers that each finish the task at once, show them as a row of slim secondary buttons, the most common first, and tone only the answers that are clearly good (`success`) or clearly bad (`critical`); neutral ones such as \"Reschedule\" stay untoned. Use an option group instead when the choice is a setting the merchant picks and then confirms with a separate Save, and an action menu when there are more than 5 answers or they are rarely used. Colour is never the only signal: the label says the outcome (\"Not interested\", not \"No\"), an icon may support it, and the row still reads correctly in greyscale.","html":"<div class=\"row\" role=\"group\" aria-label=\"Call outcome\">\n <cm-button size=\"slim\">Spoke to them</cm-button>\n <cm-button size=\"slim\">No answer, reschedule</cm-button>\n <cm-button size=\"slim\" tone=\"critical\">Not interested</cm-button>\n <cm-button size=\"slim\" tone=\"success\">Sale closed</cm-button>\n</div>"},{"title":"Loading","description":"Shows a spinner and blocks repeat clicks while a request runs. Screen readers hear that the button is busy.","html":"<cm-button variant=\"primary\" loading>Saving</cm-button>"},{"title":"Disabled","description":"Use sparingly. If an action is unavailable, say why nearby, or let the merchant press it and explain what is missing.","html":"<div class=\"row\">\n <cm-button disabled>Duplicate</cm-button>\n <cm-button variant=\"primary\" disabled>Publish</cm-button>\n</div>"},{"title":"Link","description":"With `href` the button renders a real link, so it opens in a new tab, can be bookmarked and is announced as a link.","html":"<cm-button href=\"#/components\" >Browse components</cm-button>"},{"title":"Inside a form","description":"`type=\"submit\"` and `type=\"reset\"` work with a native form, exactly like `<button>`.","html":"<form class=\"stack\" onsubmit=\"event.preventDefault(); this.querySelector('output').textContent = 'Submitted: ' + new FormData(this).get('code')\">\n <cm-text-field name=\"code\" label=\"Discount code\" value=\"DIWALI25\"></cm-text-field>\n <div class=\"row\">\n <cm-button type=\"reset\">Reset</cm-button>\n <cm-button type=\"submit\" variant=\"primary\">Create discount</cm-button>\n </div>\n <output></output>\n</form>"}],"do":["Write labels as a verb plus a noun: \"Save\", \"Add product\", \"Send preview\".","Use one primary button per section or save bar.","Put the primary button on the right of a group, secondary on its left, `space-8` apart."],"dont":["Don't use two primary buttons side by side.","Don't use `tone` for decoration or emphasis, and don't let the colour carry meaning the label doesn't: \"Not interested\", not a red \"No\".","Don't use a button to navigate when a text link would do inside a sentence.","Don't write \"Click here\", \"OK\" or \"Submit\": say what happens."],"content":["Title case for button labels, short and specific.","Keep the same verb across the flow: if the button says \"Archive\", the confirmation says \"Archive\", not \"Remove\"."],"accessibility":["Renders a native `<button>` (or `<a>` with `href`) inside the shadow root, so it is focusable and announced correctly.","Focus ring: 2px `border-strong` outline with 2px offset.","While `loading`, the inner button has `aria-busy=\"true\"` and ignores clicks.","An icon-only button must have a name: set `label` (it becomes the button's `aria-label`). Buttons made before 1.1 with a labelled `cm-icon` in the `icon` slot still work. Without either, the button warns in the console.","On touch screens (`pointer: coarse`) every button is drawn at least 40px tall (icon-only 40 × 40) whatever its `size`, and an invisible margin makes the hit area 44px (WCAG 2.5.5). States: hover, pressed, focus ring, disabled and loading.","Tones meet WCAG AA in light and dark themes: label 4.5:1 or more on the button's fill (secondary: text-critical / text-success on bg-surface, and on the soft hover fills; primary: action-primary-text on text-critical / text-success), outline 3:1 or more on bg-surface and bg-page. The pairs are checked on every token build. Colour is not announced, so the label must carry the meaning.","The visible count is hidden from screen readers; the exact number is read instead, in the name of an icon-only button (\"Notifications, 3 unread\") or after the text of a text button (\"Inbox 7 unread\"). The count is not announced when it changes: if a new notification needs announcing, use a Toast."],"related":["banner","card","icon"]},{"tag":"cm-button-group","slug":"button-group","name":"Button group","react":"ButtonGroup","group":"Actions","summary":"A row of buttons that wraps, or keeps one line and moves the buttons that don't fit into a More menu.","lead":"Buttons 8px apart, in reading order. By default the row wraps onto more lines. With `overflow=\"menu\"` it stays on one line: the buttons that don't fit move into a trailing **More** menu, measured from the group's own width (so it works in cards and side panels as well as on phones), and come back when there is room. Choosing a menu item clicks the original button, so your click handlers keep working. Since 1.7.","docs_url":"https://commmerce.com/commmerceui/#components--button-group","properties":[{"attribute":"overflow","property":"overflow","type":"'wrap' | 'menu'","default":"'wrap'","description":"`wrap` (default): buttons wrap onto more lines. `menu`: one line; the buttons that don't fit move into a More menu at the end."},{"attribute":"more-label","property":"moreLabel","type":"string","description":"Text of the More trigger, and its accessible name with `more-icon`. Default: the built-in string `more` (\"More\")."},{"attribute":"more-icon","property":"moreIcon","type":"string | null | undefined","description":"Makes the More trigger a square icon button named by `more-label`. The value is the icon: empty (just the attribute)\nis `more` (⋮). Use it when even \"More\" is too wide, e.g. in table rows."},{"attribute":"size","property":"size","type":"'large' | 'medium' | 'slim' | undefined","description":"Size of the More trigger: `large` 40, `medium` 36, `slim` 32 (40 on touch screens). Default: the first button's `size`. Give every button the same size."},{"attribute":"align","property":"align","type":"'start' | 'end'","default":"'start'","description":"`start` (default) lines the buttons up at the start edge; `end` at the end edge (dialog and card footers)."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of the group, e.g. \"Call outcome\"."},{"attribute":"_items","property":"_items","type":"MenuItem[]","default":"[]"},{"attribute":"_size","property":"_size","type":"'large' | 'medium' | 'slim'","default":"'medium'"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"overflowing","type":"HTMLElement[]","description":"The buttons currently moved into the More menu, in reading order."}],"methods":[{"name":"relayout","description":"Measures again and moves buttons into or out of the More menu. Runs by itself on resize and on changes to the buttons."}],"slots":[{"name":"(default)","description":"`cm-button`s, in reading order. Put `data-priority=\"high\"` on a button to keep it visible longest and `data-priority=\"low\"` to move it into the menu first; a `variant=\"primary\"` button stays visible if it fits at all."}],"events":[{"name":"cm-overflow-change","description":"When the set of buttons in the More menu changes. `detail: { hidden: HTMLElement[] }`."}],"parts":[],"examples":[{"title":"Task outcomes on a desktop","description":"The CRM's \"what happened?\" buttons on a task. With room, every outcome is a button in one line. `data-priority=\"high\"` keeps \"Spoke to them\" visible longest; the primary button stays visible if it fits at all.","html":"<cm-button-group overflow=\"menu\" label=\"Call outcome\">\n <cm-button icon=\"phone\" data-priority=\"high\">Spoke to them</cm-button>\n <cm-button>No answer, reschedule</cm-button>\n <cm-button tone=\"critical\">Not interested</cm-button>\n <cm-button variant=\"primary\">Done</cm-button>\n <cm-button tone=\"success\">Renewed</cm-button>\n <cm-button>Will renew: call back</cm-button>\n</cm-button-group>"},{"title":"The same outcomes on a 390px phone","description":"The same markup in a 390px box: \"Spoke to them\" and \"Done\" stay, the other four move into More, in their reading order. \"Not interested\" is red in the menu (`tone=\"critical\"`), and a disabled or loading button is a disabled item. Choosing an item clicks the hidden button, and focus goes back to More.","html":"<div style=\"max-width:390px;min-height:240px\">\n<cm-button-group overflow=\"menu\" label=\"Call outcome\">\n <cm-button icon=\"phone\" data-priority=\"high\">Spoke to them</cm-button>\n <cm-button>No answer, reschedule</cm-button>\n <cm-button tone=\"critical\">Not interested</cm-button>\n <cm-button variant=\"primary\">Done</cm-button>\n <cm-button tone=\"success\">Renewed</cm-button>\n <cm-button>Will renew: call back</cm-button>\n</cm-button-group>\n</div>"},{"title":"Icon-only More","description":"`more-icon` makes the trigger a square ⋮ button, named by `more-label` (\"More\" by default). Use it where even the word \"More\" is too wide, such as table rows and narrow cards. Slim buttons get a slim (32px) trigger.","html":"<div style=\"max-width:300px;min-height:200px\">\n<cm-button-group overflow=\"menu\" more-icon more-label=\"More actions\">\n <cm-button size=\"slim\" icon=\"edit\">Edit</cm-button>\n <cm-button size=\"slim\" icon=\"copy\">Duplicate</cm-button>\n <cm-button size=\"slim\" icon=\"download\">Download</cm-button>\n <cm-button size=\"slim\" tone=\"critical\" icon=\"trash\">Delete</cm-button>\n</cm-button-group>\n</div>"},{"title":"Wrap (default)","description":"Without `overflow`, the buttons wrap onto more lines, 8px apart. `align=\"end\"` lines them up at the end edge, for card and dialog footers.","html":"<div style=\"max-width:390px\">\n<cm-button-group align=\"end\">\n <cm-button>Cancel</cm-button>\n <cm-button>Save as draft</cm-button>\n <cm-button variant=\"primary\">Send quote</cm-button>\n</cm-button-group>\n</div>"},{"title":"Click handlers keep working","description":"Listen on the buttons as usual. When a button is in the More menu, choosing its item fires the button's own `click` (and follows its `href`, or submits its form with `type=\"submit\"`).","html":"<div class=\"stack\" style=\"max-width:300px;min-height:200px\">\n<cm-button-group overflow=\"menu\" label=\"Call outcome\">\n <cm-button onclick=\"this.closest('.stack').querySelector('output').textContent = 'Recorded: ' + this.textContent\">Spoke to them</cm-button>\n <cm-button onclick=\"this.closest('.stack').querySelector('output').textContent = 'Recorded: ' + this.textContent\">No answer</cm-button>\n <cm-button onclick=\"this.closest('.stack').querySelector('output').textContent = 'Recorded: ' + this.textContent\">Not interested</cm-button>\n</cm-button-group>\n<output>Choose an outcome</output>\n</div>"}],"do":["Use `overflow=\"menu\"` for rows of outcomes or actions that must stay on one line, such as a task's outcomes on a phone.","Put the most used choice first and give it `data-priority=\"high\"`; mark rarely used ones `data-priority=\"low\"`.","Give the group a `label` that names the choice (\"Call outcome\") when the buttons are answers to a question.","Give every button the same `size`."],"dont":["Don't put the single main action of a page in a group with `overflow=\"menu\"` if it could end up in the menu: give it room, or use `variant=\"primary\"` so it stays visible.","Don't put menus, fields or links that aren't `cm-button`s in a group with `overflow=\"menu\"`: they never move into More.","Don't hide buttons with CSS: use `hidden`, which the group respects."],"content":["Write each label so it still makes sense as a menu item: \"Not interested\", not \"No\".","Keep labels short: shorter labels mean more of them stay visible."],"accessibility":["The row is a `role=\"group\"`, named by `label`.","Buttons that move into More get `hidden`: they leave the layout, the tab order and the accessibility tree, and come back when there is room. Tab goes through the visible buttons, then More.","More is a WAI-ARIA menu button (Action menu): `aria-haspopup=\"menu\"`, `aria-expanded`, ↓/↑, Home/End and first letters move, Enter/Space choose, Esc closes and returns focus to More. With `more-icon` it is named by `more-label`.","Each menu item mirrors its button: the same text (an icon-only button's `label`), icon and disabled state; `tone=\"critical\"` makes it a destructive item. Choosing it clicks the original button; focus returns to More, or to the last visible button if More went away.","The More trigger is the size of the buttons; on touch screens it is drawn 40px with a 44px hit area, like the buttons."],"responsive":["With `overflow=\"menu\"`, the group measures its own width whenever it, a button or the More trigger changes size: the buttons that don't fit move into More, the least important first, and come back when there is room. At 390px the CRM outcomes below show two buttons and More; at 320px, one button and More.","The More trigger is the size of the buttons (36px, slim 32, large 40; 40px drawn with a 44px hit area on touch screens) and sits at the end of the row: on the right, on the left in right-to-left pages. Its menu lines up with its end edge and is at most 320px wide (the window less 32px on phones).","With the default `overflow=\"wrap\"`, buttons wrap onto more lines 8px apart. Use it when every choice must stay visible."],"related":["button","action-menu","action-bar"]},{"tag":"cm-text-field","slug":"text-field","name":"Text field","react":"TextField","group":"Forms","summary":"Lets merchants enter or edit text, numbers, dates and times.","lead":"The base of every form. A 13px medium label above, a 40px box (44px on touch screens; owner standard, 1.6), and room underneath for 12px help text or an error. The outline darkens on hover and gets a 2px ring on focus.","docs_url":"https://commmerce.com/commmerceui/#components--text-field","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the field has an aria-label."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Lowercase bracketed note after the label, e.g. \"points earned per rupee spent\"."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Current value. Updated on every keystroke."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Example input, shown in text-tertiary. Never a substitute for the label."},{"attribute":"type","property":"type","type":"'text' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'","default":"'text'","description":"Native input type. Ignored when `multiline`. `time` and `datetime-local` (since 1.2) give the browser's time and\ndate-and-time pickers; their value is local time without a time zone, `hh:mm` and `yyyy-mm-ddThh:mm`."},{"attribute":"multiline","property":"multiline","type":"boolean","default":"false","description":"Renders a resizable textarea."},{"attribute":"rows","property":"rows","type":"number","default":"4","description":"Visible rows when `multiline`."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Shows a red asterisk and blocks form submission while empty."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"readonly","property":"readonly","type":"boolean","default":"false","description":"Shows the value on the filled background; the value is still submitted."},{"attribute":"autocomplete","property":"autocomplete","type":"string | undefined","description":"Native autocomplete hint, e.g. `email`, `postal-code`."},{"attribute":"inputmode","property":"inputMode","type":"string","default":"''","description":"Which on-screen keyboard phones open: `email`, `url`, `tel`, `numeric`, `decimal`, `search` or `text`, passed to the\ninner input. Use it with `type=\"text\"` when your own check replaces the browser's (for example an email rule that\nmatches your server), so the box still opens the right keyboard. Since 1.15."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px."},{"attribute":"min","property":"min","type":"string | undefined","description":"Lowest allowed value for `number`, `date`, `time` and `datetime-local`, in the value's format (`2026-11-16T15:30`\nfor `datetime-local`). The browser's picker doesn't offer earlier dates; an earlier value makes the field invalid."},{"attribute":"max","property":"max","type":"string | undefined","description":"Highest allowed value for `number`, `date`, `time` and `datetime-local`, in the value's format."},{"attribute":"step","property":"step","type":"string | undefined","description":"Allowed steps from `min`, as on a native input: a number for `number`, days for `date`, seconds for `time` and\n`datetime-local` (`900` = 15 minutes; under 60 shows seconds). `any` allows every value."},{"attribute":"pattern","property":"pattern","type":"string | undefined","description":"A regular expression the whole value must match, as on a native input (`[0-9]{6}` for a 6-digit PIN). An empty\nvalue is left to `required`. Say what's expected in `pattern-message`. Since 1.14."},{"attribute":"pattern-message","property":"patternMessage","type":"string","default":"''","description":"The message when the value doesn't match `pattern`, e.g. \"Enter the 6-digit PIN.\". Since 1.14."},{"attribute":"minlength","property":"minLength","type":"number | undefined","description":"Fewest characters allowed (an empty value is left to `required`). Since 1.14."},{"attribute":"maxlength","property":"maxLength","type":"number | undefined","description":"Most characters allowed: typing stops there, and a longer value set by code is invalid. Since 1.14."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"change","description":"When the value is committed."},{"name":"input","description":"On every keystroke (bubbles, composed)."}],"parts":[],"examples":[{"title":"Default","html":"<cm-text-field label=\"Store name\" placeholder=\"Anika's Boutique\"></cm-text-field>"},{"title":"With hint","description":"A bracketed, lowercase note after the label explains a unit or rule without adding a line.","html":"<cm-text-field label=\"Ordered\" hint=\"points earned per rupee (rs. 1) spent\" type=\"number\" value=\"1\"></cm-text-field>"},{"title":"Help text","html":"<cm-text-field label=\"Phone\" type=\"tel\" autocomplete=\"tel\" help-text=\"Phone otp is only for Indian numbers\"></cm-text-field>"},{"title":"Error","description":"Say what is wrong and how to fix it. The border turns critical and the message is announced.","html":"<cm-text-field label=\"SKU\" value=\"TS-0042\" error=\"This SKU is already used by another product\"></cm-text-field>"},{"title":"Multiline","html":"<cm-text-field label=\"Description\" multiline rows=\"4\" help-text=\"Plain text, up to 500 characters\"></cm-text-field>"},{"title":"Date and time (browser picker)","description":"`type=\"datetime-local\"` and `type=\"time\"` (since 1.2) use the browser's own picker. The value is local time with no time zone: `2026-11-20T16:00` and `16:00`. `min`, `max` and `step` (seconds: `900` is 15 minutes) work as on a native input, and a value outside them is invalid with a message in the page language. The box shows the date and time in the browser's language, not the page's, so an `en-IN` page may show a 24-hour clock in an English (UK) browser. For a picker that follows the page language and matches the date picker, use Date picker with `time`. For \"no past times\", set `min` from JavaScript: `field.min = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString().slice(0, 16)`.","html":"<div class=\"stack\">\n <cm-text-field label=\"Follow up on\" type=\"datetime-local\" name=\"follow_up\" min=\"2026-11-16T09:00\" step=\"900\"></cm-text-field>\n <cm-text-field label=\"Call at\" type=\"time\" name=\"call_at\" min=\"09:00\" max=\"18:00\" help-text=\"Between 9 am and 6 pm\"></cm-text-field>\n</div>"},{"title":"Required","description":"Marked with a red asterisk. The form will not submit while it is empty: a failed save shows \"Please fill in this field.\" under it and moves focus to it (since 1.14). Tabbing past it shows nothing.","html":"<cm-text-field label=\"Product title\" required></cm-text-field>"},{"title":"Pattern","description":"`pattern` (since 1.14) is a regular expression the whole value must match, as on a native input. Say what is expected in `pattern-message`; without it the field says \"Enter a value in the requested format.\". Type something else and leave the field to see it. An empty value is left to `required`.","html":"<cm-text-field label=\"PIN code\" pattern=\"[0-9]{6}\" pattern-message=\"Enter the 6-digit PIN code.\" help-text=\"6 digits, like 560001\"></cm-text-field>"},{"title":"Length","description":"`minlength` and `maxlength` (since 1.14). Too short shows \"Enter at least 8 characters.\" when the merchant leaves the field. Typing stops at `maxlength`; a longer value set by code is invalid and says \"Enter 20 characters or fewer.\". Works with `multiline` too.","html":"<div class=\"stack\">\n <cm-text-field label=\"Password\" type=\"password\" minlength=\"8\" autocomplete=\"new-password\"></cm-text-field>\n <cm-text-field label=\"SKU\" maxlength=\"20\"></cm-text-field>\n</div>"},{"title":"Format checks","description":"`type=\"email\"`, `\"url\"` and `\"number\"` check what is typed (since 1.13.1): \"Enter an email address like name@example.com.\", \"Enter a web address like https://example.com.\", \"Enter a number.\". The message shows when the merchant leaves the field (since 1.14).","html":"<cm-text-field label=\"Email\" type=\"email\" autocomplete=\"email\"></cm-text-field>"},{"title":"Read-only","description":"For values the merchant can see and copy but not change here.","html":"<cm-text-field label=\"Order ID\" value=\"#1042\" readonly></cm-text-field>"},{"title":"Small","description":"`size=\"small\"` makes the box 32px (default: 40px since 1.6, owner standard; was 36px), the height of slim buttons, for toolbars, filter rows and filter panels. Labels are 13px at both sizes. On touch screens both sizes are 44px. The value text is 14px, and 16px on touch screens so phones don't zoom in.","html":"<div class=\"row\">\n <cm-text-field size=\"small\" label=\"Min price\" type=\"number\" placeholder=\"0\"></cm-text-field>\n <cm-text-field size=\"small\" label=\"Max price\" type=\"number\" placeholder=\"5000\"></cm-text-field>\n</div>"}],"do":["Always show a visible label.","Use `hint` for units and rules, `help-text` for one sentence of guidance.","Space fields `space-16` apart in a form, `space-24` between groups of fields.","Set `type` and `autocomplete` so phones show the right keyboard and browsers can fill it in.","`type=\"email\"` uses the browser's email rule: it accepts `a@b` and refuses some international addresses such as `x@пример.рф`. If your server's rule differs, use `type=\"text\"` with `inputmode=\"email\"` (the email keyboard on phones) and show your own check with `error` (since 1.15)."],"dont":["Don't use the placeholder as the label: it disappears as soon as the merchant types.","Don't show an error before the merchant has finished with the field. The field's own messages wait until they leave it or save (since 1.14).","Don't disable a field to show a value: use `readonly`.","Don't rely on these checks alone: anyone can get round checks in the browser, so check every value again on your server."],"content":["Labels are nouns: \"Name\", \"Subject\", \"Redeemed\".","Errors say what to do: \"Enter a price above 0\", not \"Invalid input\".","Help text is one sentence; no full stop needed."],"accessibility":["The label is a real `<label>` tied to the input.","Errors and help text are linked with `aria-describedby`; errors use `role=\"alert\"` and set `aria-invalid`.","Form-associated: the value is submitted with the form, `required` blocks submission, and `form.reset()` restores the initial value.","Validation (since 1.14): the field's own message shows under it when the merchant leaves a changed field with a format, range or length problem, and on every invalid field when a save fails, with focus moved to the first. It uses the same `role=\"alert\"`, `aria-invalid` and `aria-describedby` as `error`; the app's `error` always wins. See Validation.","With `min`, `max` or `step`, a value outside them blocks submission (`validity.rangeUnderflow`, `rangeOverflow`, `stepMismatch`) with a message in the page language that names the limit; a half-typed time or date-and-time is `badInput` (\"Enter a complete time.\").","`date`, `time` and `datetime-local` are native inputs: each part (day, month, hour, minute, am/pm) is edited with the number keys and Up/Down, and the browser names the parts for screen readers. How the box and picker look is up to the browser: Chromium's picker shows a calendar and time columns, while Safari and Firefox edit the time in the box. Not tested with screen readers yet.","Input borders are `border-input` (3.4:1), meeting the 3:1 contrast required for form controls."],"related":["checkbox","button"]},{"tag":"cm-checkbox","slug":"checkbox","name":"Checkbox","react":"Checkbox","group":"Forms","summary":"Turns a setting on or off, or picks several items from a list.","lead":"A 16px box (18px on touch screens; owner standard, 1.6) with a 14px label and optional 12px help text, for settings and multi-select lists. Without a label it is 24px tall with the box centred, so it lines up in rows. Hover tints the box; focus draws a 2px ring.","docs_url":"https://commmerce.com/commmerceui/#components--checkbox","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label. Capitalised automatically in the original design; write it in sentence case."},{"attribute":"description","property":"description","type":"string","default":"''","description":"Help text under the label, linked for screen readers."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"'on'","description":"Submitted value when checked."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Whether the box is ticked. Reflects to the attribute."},{"attribute":"indeterminate","property":"indeterminate","type":"boolean","default":"false","description":"Mixed state, for a \"select all\" box when only some rows are selected."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Form will not submit until ticked."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Rich label content, used instead of `label`."}],"events":[{"name":"change","description":"When toggled by the user."}],"parts":[],"examples":[{"title":"Default","html":"<cm-checkbox label=\"Track quantity\" checked></cm-checkbox>"},{"title":"With description","html":"<cm-checkbox label=\"Charge tax on this product\" description=\"Uses the GST rate in your tax settings\"></cm-checkbox>"},{"title":"Group","description":"Rows are `space-12` apart. Wrap related options in a fieldset with a legend.","html":"<fieldset class=\"stack\" style=\"border:0;margin:0;padding:0;gap:var(--cm-space-12)\">\n <legend style=\"font-size:14px;font-weight:500;margin-bottom:var(--cm-space-8)\">Notify customers by</legend>\n <cm-checkbox name=\"notify\" value=\"email\" label=\"Email\" checked></cm-checkbox>\n <cm-checkbox name=\"notify\" value=\"sms\" label=\"SMS\" description=\"Phone otp is only for Indian numbers\"></cm-checkbox>\n <cm-checkbox name=\"notify\" value=\"whatsapp\" label=\"WhatsApp\"></cm-checkbox>\n</fieldset>"},{"title":"Indeterminate","description":"For a \"select all\" box when only some rows are selected.","html":"<cm-checkbox label=\"Select all products\" indeterminate></cm-checkbox>"},{"title":"Disabled","html":"<cm-checkbox label=\"Allow cash on delivery\" description=\"Set up a payment provider first\" disabled></cm-checkbox>"}],"do":["Write labels so that ticked means \"yes\": \"Track quantity\", not \"Don't track quantity\".","Use a checkbox for settings that save with the form; use a toggle for settings that apply straight away."],"dont":["Don't use checkboxes for choices that exclude each other: use radio buttons.","Don't write long labels: move detail into `description`."],"content":["Sentence case labels, no full stop.","Descriptions explain the consequence, in one line."],"accessibility":["A native checkbox inside a `<label>`; the whole row is clickable.","The description is linked with `aria-describedby`.","Space toggles it; focus shows a 2px ring around the box.","Form-associated: submits `value` when checked."],"related":["text-field","card"]},{"tag":"cm-radio-group","slug":"radio","name":"Radio button","react":"RadioGroup","group":"Forms","summary":"Picks exactly one option from a short list.","lead":"A group of 16px round buttons with 14px labels and optional help text. The group holds the value, the keyboard behaviour and the form submission.","docs_url":"https://commmerce.com/commmerceui/#components--radio","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Question above the options. Required for accessibility unless the group has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the label in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; announced and linked to the group."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the selected option; empty when nothing is selected."},{"attribute":"orientation","property":"orientation","type":"'vertical' | 'horizontal'","default":"'vertical'","description":"`vertical` stacks options `space-20` apart; `horizontal` puts them in a row `space-30` apart."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks every option. Also set by a disabled `<fieldset>`."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"focus","description":"Focuses the selected option, or the first one."}],"slots":[{"name":"(default)","description":"The `<cm-radio>` options."},{"name":"label","description":"Rich label content, used instead of `label`."}],"events":[{"name":"input","description":"Same moment as `change`, for frameworks that listen to `input`."},{"name":"change","description":"When the merchant picks a different option."}],"parts":[{"tag":"cm-radio","react":"Radio","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label. Write it in sentence case."},{"attribute":"description","property":"description","type":"string","default":"''","description":"Help text under the label, linked for screen readers."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The group's value when this option is selected."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Selected. Set by the group; set it in markup to choose the initial option."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"This option can't be chosen. Arrow keys skip it."},{"attribute":"group-disabled","property":"groupDisabled","type":"boolean"},{"attribute":"_tabbable","property":"_tabbable"}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Rich label content, used instead of `label`."}],"events":[]}],"examples":[{"title":"Default","html":"<cm-radio-group name=\"inventory\" label=\"Inventory\" help-text=\"Inventory tracking condition\">\n <cm-radio value=\"track\" label=\"Track quantity\" checked></cm-radio>\n <cm-radio value=\"untracked\" label=\"Don't track quantity\"></cm-radio>\n</cm-radio-group>"},{"title":"Horizontal","description":"For two or three short options, such as a status. Options sit `space-24` apart.","html":"<cm-radio-group name=\"status\" label=\"Status of the product\" orientation=\"horizontal\">\n <cm-radio value=\"active\" label=\"Active\"></cm-radio>\n <cm-radio value=\"inactive\" label=\"Inactive\" checked></cm-radio>\n</cm-radio-group>"},{"title":"With descriptions","html":"<cm-radio-group name=\"checkout\" label=\"Customer accounts\">\n <cm-radio value=\"optional\" label=\"Accounts are optional\" description=\"Customers can check out as a guest\" checked></cm-radio>\n <cm-radio value=\"required\" label=\"Accounts are required\" description=\"User has to create an account to checkout\"></cm-radio>\n</cm-radio-group>"},{"title":"Required with error","description":"The form will not submit until an option is chosen.","html":"<cm-radio-group name=\"ship\" label=\"Shipping method\" required error=\"Choose a shipping method\">\n <cm-radio value=\"standard\" label=\"Standard\"></cm-radio>\n <cm-radio value=\"express\" label=\"Express\"></cm-radio>\n</cm-radio-group>"},{"title":"Disabled option","html":"<cm-radio-group name=\"pay\" label=\"Payment\">\n <cm-radio value=\"prepaid\" label=\"Prepaid\" checked></cm-radio>\n <cm-radio value=\"cod\" label=\"Cash on delivery\" description=\"Set up a payment provider first\" disabled></cm-radio>\n</cm-radio-group>"}],"do":["Use radios when the options exclude each other and the merchant should see them all at once.","Pre-select the safest or most common option when there is one.","Keep to about five options; use a select for longer lists."],"dont":["Don't use a single radio on its own: use a checkbox.","Don't use radios for settings that apply straight away: use a toggle.","Don't put `<cm-radio>` outside a `<cm-radio-group>`: the group owns the value."],"content":["The group label asks the question: \"Status of the product\".","Option labels are short and parallel: \"Active\", \"Inactive\".","Descriptions explain the consequence in one line."],"accessibility":["The group is a `radiogroup` named by its label; each option is a `radio` with `aria-checked`.","One tab stop: Tab reaches the selected option (or the first one), arrow keys move and select, skipping disabled options and wrapping at the ends, and Space selects.","Form-associated: submits the selected `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice.","Errors use `role=\"alert\"` and are linked with `aria-describedby`."],"related":["checkbox","option-group","select"]},{"tag":"cm-toggle","slug":"toggle","name":"Toggle","react":"Toggle","group":"Forms","summary":"Turns a setting on or off straight away.","lead":"A 36×20 switch for settings that take effect immediately, such as showing a product on the store. Lists often show it without a visible label.","docs_url":"https://commmerce.com/commmerceui/#components--toggle","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label after the switch. Without one, give the element an `aria-label`."},{"attribute":"description","property":"description","type":"string","default":"''","description":"Help text under the label, linked for screen readers."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"'on'","description":"Submitted value when on."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Whether the switch is on. Reflects to the attribute."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Rich label content, used instead of `label`."}],"events":[{"name":"change","description":"When switched by the user."}],"parts":[],"examples":[{"title":"In a list row","description":"With no visible label, name it with `aria-label`.","html":"<div class=\"row\">\n <cm-toggle aria-label=\"Show Cotton kurta on store\" checked></cm-toggle>\n <cm-toggle aria-label=\"Show Linen shirt on store\"></cm-toggle>\n</div>"},{"title":"With label","html":"<cm-toggle label=\"Show on store\" checked></cm-toggle>"},{"title":"With description","html":"<cm-toggle label=\"Accept orders\" description=\"Turn off to pause checkout for maintenance\"></cm-toggle>"},{"title":"Disabled","html":"<cm-toggle label=\"Cash on delivery\" description=\"Set up a payment provider first\" disabled></cm-toggle>"}],"do":["Use a toggle when the change applies at once, with no Save button.","Write the label as the thing that is on: \"Show on store\".","Confirm the change, for example with a toast, when it affects customers."],"dont":["Don't use a toggle inside a form that needs saving: use a checkbox.","Don't change the label when the state changes; the switch shows the state.","Don't leave it unnamed: set `label` or `aria-label`."],"content":["Labels are short noun or verb phrases in sentence case.","Don't add \"On\" or \"Off\" text next to the switch."],"accessibility":["A native checkbox with `role=\"switch\"`, so screen readers say \"switch, on/off\". Space toggles it.","The track colours (`toggle-on`, `toggle-off`) are only 1.9:1 and 1.5:1 against white, so the track and thumb get a 1px `border-input` outline (3.4:1) to meet the 3:1 needed for controls. The thumb position also shows the state.","Form-associated: submits `value` when on, and `form.reset()` restores the initial state.","Respects reduced motion."],"related":["checkbox","radio"]},{"tag":"cm-select","slug":"select","name":"Select","react":"Select","group":"Forms","summary":"Picks one option from a list that opens below the field.","lead":"A 40px field (32px with `size=\"small\"`; 40px since 1.6, owner standard) with a chevron that opens a list of options. The chosen option is shown in black in the list and as the field's value.","docs_url":"https://commmerce.com/commmerceui/#components--select","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the chosen option; empty when nothing is chosen."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Shown while nothing is chosen, e.g. \"Select customer\"."},{"attribute":"options","property":"options","type":"Array<string | SelectOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, group }`. Used instead of `<option>` children when set."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the list is showing."},{"attribute":"show-group","property":"showGroup","type":"boolean","default":"false","description":"Shows the chosen option's group before its label in the box (\"Lead: Company\"), for grouped lists where labels\nrepeat across groups. The list itself always shows the bare label under its group heading. Since 1.3."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. `medium` (1.8.1): 36px, the height of a standard\nbutton, for a select in a row of buttons such as page header actions. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens all are 44px. Since 1.5."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner in place of the chevron while you load the options (the box is `aria-busy`); the list doesn't\nopen until it is cleared. For options fetched as the merchant types, use `cm-combobox`. Since 1.6."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_slotted","property":"_slotted","type":"SelectOption[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"SelectOption[]","description":"The options in use, normalised, in the order shown (options of a group together)."}],"methods":[],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements, optionally inside `<optgroup label=\"…\">`. `disabled` (also on an optgroup) and `selected` are honoured."}],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the merchant picks a different option."}],"parts":[],"examples":[{"title":"Default","description":"Write options as `<option>` children, as you would for a native select.","html":"<cm-select name=\"customer\" label=\"Customer\" placeholder=\"Select customer\">\n <option value=\"robinson-rao\">Robinson Mid Rao - robiroa09102@gmail.com</option>\n <option value=\"robinson\">Robinson - robinson9900@gmail.com</option>\n <option value=\"manjunath\">Manjunath - manju8393@gmail.com</option>\n</cm-select>"},{"title":"Next to a button","description":"The field fills the row and a large primary button of the same height (40px) sits on the right.","html":"<div class=\"row\" style=\"align-items:flex-end;flex-wrap:nowrap;gap:8px\">\n <cm-select name=\"customer\" label=\"Customer\" placeholder=\"Select customer\" style=\"flex:1\">\n <option value=\"robinson\">Robinson - robinson9900@gmail.com</option>\n <option value=\"manjunath\">Manjunath - manju8393@gmail.com</option>\n </cm-select>\n <cm-button variant=\"primary\">Add new customer</cm-button>\n</div>"},{"title":"Small, in a filter row","description":"Since 1.5. `size=\"small\"` makes the box 32px, the height of slim buttons and small search, so a toolbar or filter row lines up. Name fields without a visible label with `aria-label`.","html":"<div style=\"display:flex;flex-wrap:wrap;gap:8px;align-items:center\">\n <cm-search size=\"small\" label=\"Search orders\" placeholder=\"Search orders\" style=\"flex:1 1 200px;min-width:0\"></cm-search>\n <cm-select size=\"small\" aria-label=\"Status\" placeholder=\"Status\">\n <option value=\"open\">Open</option>\n <option value=\"done\">Done</option>\n </cm-select>\n <cm-select size=\"small\" aria-label=\"Owner\" placeholder=\"Owner\">\n <option value=\"me\">Me</option>\n <option value=\"anyone\">Anyone</option>\n </cm-select>\n <cm-button size=\"slim\">Clear filters</cm-button>\n</div>"},{"title":"Preselected","html":"<cm-select name=\"status\" label=\"Status\">\n <option value=\"active\">Active</option>\n <option value=\"inactive\" selected>Inactive</option>\n <option value=\"draft\">Draft</option>\n</cm-select>"},{"title":"Help text and disabled option","html":"<cm-select name=\"courier\" label=\"Courier\" placeholder=\"Choose a courier\" help-text=\"Used for new orders only\">\n <option value=\"delhivery\">Delhivery</option>\n <option value=\"bluedart\">Blue Dart</option>\n <option value=\"ekart\" disabled>Ekart (not available in your area)</option>\n</cm-select>"},{"title":"Error","html":"<cm-select name=\"state\" label=\"State\" placeholder=\"Select state\" required error=\"Choose the state for GST\">\n <option value=\"ka\">Karnataka</option>\n <option value=\"mh\">Maharashtra</option>\n <option value=\"tn\">Tamil Nadu</option>\n</cm-select>"},{"title":"Disabled","html":"<cm-select label=\"Currency\" disabled><option value=\"inr\" selected>Indian rupee (INR)</option></cm-select>"},{"title":"Option groups","description":"Since 1.3. Put options under headings with `<optgroup label=\"…\">`, or give each option in `options` a `group` (`{ value, label, group }`): options of a group are shown together, in the order the groups first appear. Headings can't be chosen and the arrow keys skip them. When labels repeat across groups, `show-group` shows the chosen option as \"Lead: Email\" in the box.","html":"<div style=\"min-height:340px\"><cm-select name=\"field\" label=\"Take the value from a CRM field\" placeholder=\"Choose a field\" show-group>\n <option value=\"owner\">Record owner</option>\n <optgroup label=\"Lead\">\n <option value=\"lead.company\">Company</option>\n <option value=\"lead.email\">Email</option>\n </optgroup>\n <optgroup label=\"Contact\">\n <option value=\"contact.name\">Full name</option>\n <option value=\"contact.email\">Email</option>\n </optgroup>\n <optgroup label=\"Deal\">\n <option value=\"deal.amount\">Amount</option>\n </optgroup>\n</cm-select></div>"}],"do":["Use a select for five or more options, or when space is tight; use radios for fewer.","Write a placeholder that says what to pick: \"Select customer\".","Order options in a way the merchant expects: alphabetical, by frequency, or by size.","When no option is marked `selected`, `value` is `''`. For a required single choice, either pre-select the sensible default or keep the confirming button (Apply, Save) disabled until `value` is set, so pressing it never silently does nothing."],"dont":["Don't use a select for actions: use an action menu.","Don't use it for yes/no: use a checkbox or toggle.","Don't put very long lists in it (hundreds of items): use a Combobox, which filters as the merchant types."],"content":["The label is a noun: \"Customer\", \"Status\".","Options are short and start with the word that tells them apart, so typeahead works."],"accessibility":["**Why a custom list, not a native `<select>`:** the open list is a styled panel with a black fill on the chosen option, and native select popups can't be styled that way (and look different on every OS). So it follows the WAI-ARIA \"select-only combobox\" pattern, with native-select keyboard support.","Option groups are `group`s inside the listbox, each named by its heading (`aria-labelledby`), so screen readers say which group an option is in; the headings are not options.","Keyboard: Down, Up, Enter or Space opens; arrows move (skipping disabled options and group headings); Home and End jump; Page Up/Down move by ten; typing letters jumps to a match (repeat a letter to cycle); Enter or Space chooses; Escape closes without choosing; Tab chooses the highlighted option and moves on.","The field is a `combobox` labelled by the visible label, with `aria-expanded` and `aria-activedescendant`; options are `option`s with `aria-selected`.","Form-associated: submits `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice. `<option selected>` sets the initial value.","Contrast: the border is `border-input` (3:1 or more, as form controls need) and the placeholder is `text-tertiary` (4.5:1 or more)."],"responsive":["Options in the open list are 36px rows of 14px text with 12px side padding (32px with `size=\"small\"`; since 1.6, the same rows as Action menu and Combobox); on touch screens the box and the rows are 44px tall and the value is 16px."],"related":["radio","option-group","text-field"]},{"tag":"cm-search","slug":"search","name":"Search","react":"Search","group":"Forms","summary":"Filters a list or table by what the merchant types.","lead":"A box with a search icon, placed at the top of lists, in the same white box and grey outline as the other fields. It can carry a filter button that opens a filter panel. Sizes: `small` 32px for toolbars, filter rows and table headers, `default` 40px (since 1.6, owner standard; was 36px), `large` 40px; all 44px on touch screens.","docs_url":"https://commmerce.com/commmerceui/#components--search","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name, read by screen readers but not shown. Say what is searched: \"Search orders\". Default: the built-in string `label` (\"Search\")."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Current query. Updated on every keystroke."},{"attribute":"placeholder","property":"placeholder","type":"string","description":"Example query, shown in text-tertiary. Default: the built-in string `placeholder` (\"Search\")."},{"attribute":"filter","property":"filter","type":"boolean","default":"false","description":"Shows the filter button at the end of the box."},{"attribute":"filter-label","property":"filterLabel","type":"string","description":"Accessible name of the filter button. Default: the built-in string `filter` (\"Filter\")."},{"attribute":"filter-count","property":"filterCount","type":"number","default":"0","description":"Number of filters applied; shown on the filter button when above 0."},{"attribute":"size","property":"size","type":"'default' | 'small' | 'large'","default":"'default'","description":"`default` 40px (since 1.6, owner standard; was 36px); `small` 32px (toolbars, filter rows and table headers, since 1.5);\n`large` 40px (page-level search; the same as the default since 1.6, kept for compatibility). On touch screens every size is 44px."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"input","description":"On every keystroke, and when cleared."},{"name":"change","description":"When the value is committed (Enter or blur after typing, or clear)."},{"name":"cm-search","description":"When the merchant presses Enter. `detail.value` is the query."},{"name":"cm-filter","description":"When the filter button is pressed. Open a filter panel in response."}],"parts":[],"examples":[{"title":"Default","html":"<cm-search label=\"Search products\" placeholder=\"Search something\"></cm-search>"},{"title":"With filter","description":"Listen for `cm-filter` and open your filter panel. `filter-count` shows how many filters are applied.","html":"<cm-search label=\"Search orders\" placeholder=\"Search by order ID or customer\" filter filter-count=\"2\"></cm-search>"},{"title":"Small","description":"Since 1.5. 32px, for toolbars and filter rows next to small selects and slim buttons.","html":"<div style=\"display:flex;flex-wrap:wrap;gap:8px;align-items:center\">\n <cm-search size=\"small\" label=\"Search tasks\" placeholder=\"Search tasks\" style=\"flex:1 1 200px;min-width:0\"></cm-search>\n <cm-select size=\"small\" aria-label=\"Owner\" placeholder=\"Owner\"><option value=\"me\">Me</option><option value=\"anyone\">Anyone</option></cm-select>\n <cm-button size=\"slim\">Clear</cm-button>\n</div>"},{"title":"Large","description":"40px, for a search that leads the page.","html":"<cm-search size=\"large\" label=\"Search customers\" placeholder=\"Search something\" filter></cm-search>"},{"title":"In a table header","description":"A small (32px) box with a slim (32px) button next to it, so their edges line up.","html":"<div class=\"row\" style=\"flex-wrap:nowrap;gap:8px\">\n <cm-search label=\"Search orders\" placeholder=\"Search something\" style=\"flex:1\"></cm-search>\n <cm-button>Bulk orders</cm-button>\n</div>"}],"do":["Say what is searched in `label`, and give an example in `placeholder`.","Filter as the merchant types for short lists; wait for Enter (`cm-search`) when results come from the server.","Show an empty state when nothing matches, with a way to clear the search."],"dont":["Don't use the placeholder as the only label: set `label` (it is read out, not shown).","Don't put more than one search box above a list."],"content":["Placeholders give an example or the fields searched: \"Search by order ID or customer\".","No full stop."],"accessibility":["A native `type=\"search\"` input named by `label`. Enter fires `cm-search`; Escape clears.","The clear button (shown once there is a query) and the filter button are real buttons with names; the filter count is part of the filter button's name.","The edge is `border-input` (3:1 or more, as form controls need) and the placeholder is `text-tertiary` (4.5:1 or more). The clear and filter buttons are 24px (32px on touch screens).","Form-associated: submits the query under `name`."],"related":["text-field","select","tag"]},{"tag":"cm-global-search","slug":"global-search","name":"Global search","react":"GlobalSearch","group":"Navigation","summary":"One box that searches everything and lists matches grouped by kind, each a link to its page.","lead":"A search box like Search with a panel of results under it, grouped by kind (\"Leads\", \"Deals\", \"Tickets\"): each group has a heading with its total, up to a few results with a title and a grey second line, and an optional \"See all\" link. Your app does the searching: listen for `cm-search` (it carries the query), fetch, and set `results`, with `loading` while the request runs. Choosing a result follows its link; `cm-combobox` is the one to use when the merchant picks a value for a form.","docs_url":"https://commmerce.com/commmerceui/#components--global-search","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name of the box, read by screen readers but not shown. Default: the built-in string `label` (\"Search\")."},{"attribute":"placeholder","property":"placeholder","type":"string","description":"Example query in the empty box: \"Search leads, deals, contacts\". Default: the built-in string `placeholder` (\"Search\")."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The query. Updated as the merchant types."},{"attribute":"results","property":"results","type":"GlobalSearchGroup[]","default":"[]","description":"Results for the current query, grouped by kind. Set it when your search returns. Groups with no items are skipped."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows \"Loading\" with a spinner in place of the results while you fetch them."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the results panel is showing. It shows only while there is a query."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown when a query has no results. Default: the built-in string `noResults` (\"No results\")."},{"attribute":"loading-text","property":"loadingText","type":"string","description":"Shown and announced while `loading`. Default: the built-in string `loading` (\"Loading\", shared with other components)."},{"attribute":"see-all-label","property":"seeAllLabel","type":"string","description":"Text of each group's \"See all\" row. Default: the built-in string `seeAll` (\"See all\")."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"A key that moves focus to the box from anywhere on the page, e.g. `/`. Off by default: turn it on only for\none search per page. It is ignored while the merchant is typing in a field or holding Ctrl, Alt or Cmd."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"cm-search","description":"As the merchant types (and when the box is cleared), with `detail: { query }`. Fetch results and set `results`."},{"name":"cm-select","description":"When a result or a \"See all\" row is chosen, with `detail: { href, item, group }` (`item` is undefined for \"See all\"). Cancelable: `preventDefault()` stops the link, to route in your app."}],"parts":[],"examples":[{"title":"Grouped results","description":"Opens with results for \"ravi\"; type in the box to search again (this demo shows the same results for any query). Arrow keys move through every result across groups, Enter opens one, Escape closes.","html":"<div style=\"min-height:420px;max-width:560px\">\n <cm-global-search label=\"Search the CRM\" placeholder=\"Search leads, deals, tickets\" value=\"ravi\" open\n results='[{\"label\": \"Leads\", \"total\": 12, \"href\": \"#leads\", \"items\": [{\"title\": \"Ravi Stores\", \"description\": \"Lead · Mumbai · +91 98200 12345\", \"href\": \"#lead-ravi-stores\", \"icon\": \"user\"}, {\"title\": \"Ravi Traders\", \"description\": \"Lead · Pune\", \"href\": \"#lead-ravi-traders\", \"icon\": \"user\"}]}, {\"label\": \"Deals\", \"total\": 3, \"href\": \"#deals\", \"items\": [{\"title\": \"Ravi Stores annual plan\", \"description\": \"Deal · ₹ 48,000 · Negotiation\", \"href\": \"#deal-1042\", \"icon\": \"wallet\"}]}, {\"label\": \"Tickets\", \"items\": [{\"title\": \"Ravi Stores cannot print invoices\", \"description\": \"Ticket #5531 · Open\", \"href\": \"#ticket-5531\", \"icon\": \"help\"}]}]'></cm-global-search>\n</div>"},{"title":"With a shortcut key","description":"`shortcut=\"/\"` lets the merchant press / anywhere on the page to jump to the box (not while typing in a field). It is off by default: turn it on for one search per page, usually the one in the header.","html":"<div style=\"max-width:560px\"><cm-global-search label=\"Search the CRM\" placeholder=\"Search everything\" shortcut=\"/\"></cm-global-search></div>"},{"title":"In the header bar","description":"Put it in the Header bar's `search` slot. Wider than 900px the box sits inline after the store switcher; this preview is narrower, so the bar shows a search button that opens the search full screen.","html":"<cm-header-bar store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder-mark.svg\" alt=\"Store logo\" width=\"24\" height=\"24\">\n <cm-global-search slot=\"search\" label=\"Search the CRM\" placeholder=\"Search leads, deals, tickets\"></cm-global-search>\n</cm-header-bar>"}],"do":["Debounce `cm-search` requests (about 250 ms), cancel stale ones, and set `loading` while they run.","Show the best three to five results per kind and link the rest with the group's `href` (\"See all\").","Pass each group's full `total`, not only the number shown.","Make every result a real link (`href`); cancel `cm-select` with `preventDefault()` only to route inside a single-page app."],"dont":["Don't use it to pick a value in a form: use a Combobox.","Don't use it to filter the list on the current page: use Search.","Don't turn on `shortcut` for more than one search on a page."],"content":["The placeholder names what can be found: \"Search leads, deals, tickets\".","Group headings are the plural kind: \"Leads\", \"Deals\". The second line says what the result is and how to tell it apart: \"Lead · Mumbai\"."],"accessibility":["Follows the WAI-ARIA combobox pattern with a grouped listbox: the text box has `role=\"combobox\"`, `aria-expanded` and `aria-controls`; results are `option`s inside `group`s named by their heading and total (\"Leads, 12 results\"). Focus stays in the box and the highlighted result is shown with `aria-activedescendant`.","Keyboard: typing searches and opens the results; Down and Up move through every result across groups (wrapping); Enter opens the highlighted result; Escape closes the results, and a second Escape clears the box; Tab moves on and closes them.","The number of results, \"Loading\" and \"No results\" are announced through a polite live region.","The `shortcut` key is opt-in and exposed as `aria-keyshortcuts`; it never fires while the merchant types in a field or holds Ctrl, Alt or Cmd.","Why not `cm-search` with a popover: the combobox and its listbox have to share one shadow root for `aria-activedescendant` and `aria-controls` to work, so the box is built in."],"responsive":["Results open under the box at its full width and scroll once they are taller than 480px (or the window less 140px).","In the Header bar's `search` slot, at 900px or narrower the bar shows a search button instead, and the search opens full screen with the results filling the screen under it."],"related":["search","combobox","header-bar"]},{"tag":"cm-command-palette","slug":"command-palette","name":"Command palette","react":"CommandPalette","group":"Navigation","summary":"A search box in a dialog (Cmd/Ctrl+K) to jump to any record or run an action from the keyboard.","lead":"For people who work from the keyboard: press a shortcut, type a few letters, press Enter. The dialog lists records your app finds (\"Records\": leads, contacts), the actions it can run (\"New lead\") and places it can go (\"Go to Tasks\"), in groups, each row with an icon, a title, a grey second line and an optional key hint. Records come from your server, as in Global search: listen for `cm-search`, fetch, set `results`. Actions are registered once in `actions`, with `keywords`, and the palette filters them itself as the merchant types. While the box is empty it shows `recent` items, then every action. Choosing a row fires a cancelable `cm-select` and follows its link, or calls its `run` function.","docs_url":"https://commmerce.com/commmerceui/#components--command-palette","properties":[{"attribute":"label","property":"label","type":"string","default":"undefined","description":"Accessible name of the dialog and its text box, read by screen readers but not shown. Default: the built-in string `label` (\"Command palette\")."},{"attribute":"placeholder","property":"placeholder","type":"string","description":"Text in the empty box: \"Search leads, contacts or run a command\". Default: the built-in string `placeholder` (\"Search or run a command\")."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The query. Updated as the merchant types; emptied when the palette closes."},{"attribute":"results","property":"results","type":"CommandPaletteGroup[]","default":"[]","description":"Records found for the current query, grouped by kind, as in `cm-global-search`. Shown only while there is a query. Groups with no items are skipped."},{"attribute":"actions","property":"actions","type":"CommandPaletteGroup[]","default":"[]","description":"Actions and places, grouped (\"Actions\", \"Navigate\"). Always available: filtered by the palette as the merchant types."},{"attribute":"recent","property":"recent","type":"CommandPaletteItem[]","default":"[]","description":"Items the merchant chose recently, shown under \"Recent\" while the box is empty. Your app keeps the list (e.g. add the chosen item in `cm-select`)."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows \"Loading\" with a spinner in place of `results` while you fetch them. Matching actions still show."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"A shortcut that opens (and closes) the palette from anywhere on the page: `mod+k` is Cmd+K on a Mac and\nCtrl+K elsewhere. Off by default: turn it on for one palette per page. A shortcut without Ctrl, Cmd or Alt\n(like `/`) is ignored while the merchant is typing in a field. The page only gets the key while it has focus\n(not from the address bar; in an embedded app, only while focus is in the app's frame), and shortcuts the\nbrowser reserves (Ctrl+T, Ctrl+W, Ctrl+N) can't be used: keep a visible button that calls `show()` too."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown when nothing matches. Default: the built-in string `noResults` (\"No results\")."},{"attribute":"loading-text","property":"loadingText","type":"string","description":"Shown and announced while `loading`. Default: the built-in string `loading` (\"Loading\", shared with other components)."},{"attribute":"recent-label","property":"recentLabel","type":"string","description":"Heading of the `recent` items. Default: the built-in string `recent` (\"Recent\")."},{"attribute":"see-all-label","property":"seeAllLabel","type":"string","description":"Text of each results group's \"See all\" row. Default: the built-in string `seeAll` (\"See all\")."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"toggle","description":"Opens the palette if it is closed and closes it if it is open."},{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[],"events":[{"name":"cm-select","description":"When an item or a \"See all\" row is chosen, with `detail: { item, group, href }` (`item` is undefined for \"See all\"). The palette has already closed. Cancelable: `preventDefault()` stops the link and the item's `run`, to route in your app."},{"name":"cm-search","description":"As the merchant types (and when the box is cleared), with `detail: { query }`. Fetch records and set `results`."},{"name":"cm-open","description":"After the palette opens."},{"name":"cm-close","description":"Before it closes from Escape, the backdrop, the close button or the shortcut. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed and focus has gone back."}],"parts":[],"examples":[{"title":"CRM: leads, contacts and actions","description":"Press the button, or Ctrl+K (⌘K on a Mac) anywhere on this page, even while typing in a field. Type \"ravi\" for records (the demo answers after 400 ms), \"add\" or \"night\" to find actions by keyword, or \"zzz\" for no results. Choosing a record or a place shows a toast here instead of leaving the page; \"Switch to dark theme\" switches this preview.","html":"<div style=\"min-height:120px\">\n <cm-button data-opens=\"palette\" icon=\"search\">Search or run a command</cm-button>\n <cm-command-palette id=\"palette\" shortcut=\"mod+k\" data-demo-crm placeholder=\"Search leads and contacts, or run a command\"\n recent='[{\"title\": \"Ravi Stores\", \"description\": \"Lead · Mumbai\", \"href\": \"#lead-ravi-stores\", \"icon\": \"user\"}, {\"title\": \"Anika Sharma\", \"description\": \"Contact · Sharma Textiles\", \"href\": \"#contact-anika\", \"icon\": \"id-card\"}]'\n actions='[{\"label\": \"Actions\", \"items\": [{\"title\": \"New lead\", \"description\": \"Create a lead\", \"icon\": \"plus\", \"keywords\": [\"create\", \"add\"], \"shortcut\": \"mod+shift+l\", \"value\": \"new-lead\"}, {\"title\": \"Switch to dark theme\", \"icon\": \"moon\", \"keywords\": [\"appearance\", \"night\", \"mode\"], \"value\": \"theme-dark\"}]}, {\"label\": \"Navigate\", \"items\": [{\"title\": \"Go to Tasks\", \"icon\": \"tasks\", \"href\": \"#tasks\", \"shortcut\": \"g t\", \"keywords\": [\"todo\", \"to-do\"]}, {\"title\": \"Go to Leads\", \"icon\": \"users\", \"href\": \"#leads\"}, {\"title\": \"Go to Contacts\", \"icon\": \"id-card\", \"href\": \"#contacts\"}]}]'></cm-command-palette>\n</div>"}],"do":["Turn the shortcut on for one palette per app, in the admin shell, with `shortcut=\"mod+k\"`.","Register every action in `actions` with a few `keywords` merchants might type (\"create\", \"add\" for \"New lead\").","Keep `recent` up to date from `cm-select`, five to eight items.","Debounce `cm-search` (about 250 ms), cancel stale requests, set `loading` while they run, and show at most five records per kind with a \"See all\" link (`href` on the group).","Give actions that have their own shortcut a `shortcut` hint (`mod+shift+l`, or `g t` for keys pressed one after the other), and listen for that shortcut yourself."],"dont":["Don't make it the only way to reach something: everything in it must also be on a page or a menu.","Don't use it to search the list on the current page: use Search; for a search box in the header use Global search.","Don't pick a shortcut the browser keeps for itself (Ctrl+T, Ctrl+W, Ctrl+N, Ctrl+L): pages can't override those.","Don't put destructive actions in it without a confirmation step."],"content":["Actions start with a verb in sentence case: \"New lead\", \"Switch to dark theme\". Places start with \"Go to\": \"Go to Tasks\".","The second line says what a record is and how to tell it apart: \"Lead · Mumbai\".","Group headings are short plurals or kinds: \"Leads\", \"Contacts\", \"Actions\", \"Navigate\"."],"accessibility":["A native modal `<dialog>` named \"Command palette\" (`label`), opened with `showModal()` through the same overlay helper as Modal: the page behind is inert, Esc closes through a cancelable `cm-close`, page scrolling is locked and focus returns to the element that had it.","Inside, the search box is a `combobox` with `aria-expanded`, `aria-controls` and `aria-activedescendant` over a grouped `listbox`, as in Global search: each group is a `group` labelled by its heading; focus never leaves the box.","Result counts, \"Loading\" and \"No results\" are announced through a polite live region; nothing is announced for the empty box.","Key hints are drawn as `<kbd>` keycaps (12px), hidden from screen readers, and exposed on the row as `aria-keyshortcuts` (single shortcuts only, not sequences).","**Shortcut caveat:** `mod+k` is Cmd+K on macOS and iPadOS and Ctrl+K elsewhere. It works while the merchant types in a field because it holds a modifier. The page only gets the key while it has focus: not while focus is in the browser's address bar, and inside an embedded app only while focus is in the app's frame. Chrome, Edge, Firefox and Safari let pages take Ctrl+K / Cmd+K (their own \"search the web\" shortcut then doesn't run while the page has focus); shortcuts browsers reserve (Ctrl+T, Ctrl+W, Ctrl+N) can never be taken. Keep a visible way to open the palette (a button) as well."],"responsive":["A dialog 640px wide (never wider than the window less 32px), centred and 12% of the window height from the top; the list scrolls inside it.","At 640px wide or narrower it fills the screen with square corners, and shows a close button instead of the Esc keycap.","The search box is 40px tall (44px on touch screens, with 16px typed text so phones don't zoom). Rows are 36px with 14px text, 16px icons and 12px side padding, like other menus (1.6); 44px on touch screens."],"related":["global-search","modal","action-menu","header-bar"]},{"tag":"cm-combobox","slug":"combobox","name":"Combobox","react":"Combobox","group":"Forms","summary":"Suggests matching options as the merchant types; picks one, or several shown as tags.","lead":"A 40px text box (32px with `size=\"small\"`, for toolbars and filter rows; 40px since 1.6) that opens a list of matching options as the merchant types. Use it when the list is too long to scroll (customers, products, tags), when results come from the server, or when the merchant may add a value of their own. With `multiple`, chosen options show as removable 24px Tags (12px text, the same tags as everywhere) inside the box; while it isn't focused, the first three show and the rest become \"+N more\" (since 1.6).","docs_url":"https://commmerce.com/commmerceui/#components--combobox","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name. With `multiple`, each value is submitted as its own entry under this name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the chosen option (single mode). Empty when nothing is chosen."},{"attribute":"values","property":"values","type":"string[]","default":"[]","description":"Values of the chosen options (`multiple` mode), in the order they were added."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Shown in the empty text box, e.g. \"Search tags\"."},{"attribute":"options","property":"options","type":"Array<string | SelectOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, group }`. Used instead of `<option>` children when set."},{"attribute":"multiple","property":"multiple","type":"boolean","default":"false","description":"Lets the merchant choose several options, shown as removable 24px tags (`cm-tag`) that wrap onto more rows as the box\ngrows from its 40px minimum. Keyboard: Backspace in the empty box removes the last tag; ← (→ in right-to-left text)\nat the start of the box moves to the tags, ←/→ move between them, Backspace or Delete removes the focused tag, and\n→ past the last tag (or Esc) goes back to the text box. The tags are not Tab stops."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens both are 44px. Since 1.5."},{"attribute":"allow-custom","property":"allowCustom","type":"boolean","default":"false","description":"Lets the merchant add what they typed when it isn't an option (\"Add “summer”\"). Fires a cancelable `cm-create`."},{"attribute":"filter","property":"filter","type":"'contains' | 'starts-with' | 'none'","default":"'contains'","description":"How typing narrows the list: `contains` (default), `starts-with`, or `none` when you filter on the server from `cm-search`."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner in the list while you load options."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown in the list when nothing matches. Default: the built-in string `noResults` (\"No results\")."},{"attribute":"loading-text","property":"loadingText","type":"string","description":"Announced and shown while `loading`. Default: the built-in string `loading` (\"Loading\", shared with other components)."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until something is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the list is showing."},{"attribute":"show-group","property":"showGroup","type":"boolean","default":"false","description":"Shows the chosen option's group before its label in the box, or in its tag with `multiple` (\"Lead: Company\"),\nfor grouped lists where labels repeat across groups. The list itself shows the bare label under its heading. Since 1.3."},{"attribute":"max-tags","property":"maxTags","type":"number","default":"3","description":"`multiple`: how many tags show while the box isn't focused; the rest become one \"+N more\" tag. Every tag shows\nwhile the merchant is in the box. `0` shows them all. Default 3 (since 1.6, owner standard)."},{"attribute":"_query","property":"_query","type":"string","default":"''"},{"attribute":"_focusIn","property":"_focusIn","type":"boolean","default":"false","description":"True while focus is inside the element (all tags show)."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_slotted","property":"_slotted","type":"SelectOption[]","default":"[]"},{"attribute":"_typing","property":"_typing","type":"boolean","default":"false","description":"True while the text box holds the merchant's own query rather than the chosen option's label."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"SelectOption[]","description":"All options in use, normalised (before filtering), in the order shown (options of a group together)."},{"property":"filteredItems","type":"SelectOption[]","description":"The options shown for the current query."}],"methods":[{"name":"removeValue","description":"Removes a chosen value (`multiple`)."},{"name":"focus","description":"Focuses the text box (not the first tag)."}],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements, optionally inside `<optgroup label=\"…\">`. `disabled` (also on an optgroup) and `selected` are honoured."}],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the value changes (an option picked or removed, or a custom value added)."},{"name":"cm-create","description":"Before a custom value is added (`allow-custom`), with `detail: { value }`. Cancelable: call `preventDefault()` to refuse it."},{"name":"cm-search","description":"As the merchant types, with `detail: { query }`. Use it to load matches from the server."}],"parts":[],"examples":[{"title":"Default","description":"Write options as `<option>` children, as for Select. Typing narrows the list to options that contain the text.","html":"<cm-combobox name=\"customer\" label=\"Customer\" placeholder=\"Search customers\">\n <option value=\"c-101\">Robinson Mid Rao</option>\n <option value=\"c-102\">Manjunath K</option>\n <option value=\"c-103\">Anika Sharma</option>\n <option value=\"c-104\">Priya Raman</option>\n <option value=\"c-105\">Rahul Verma</option>\n</cm-combobox>"},{"title":"Product tags (multi-select)","description":"`multiple` shows each chosen tag as a removable Tag; Backspace in the empty box removes the last one, and ← moves to the tags (←/→ between them, Backspace or Delete removes one). `allow-custom` offers \"Add …\" for a tag that doesn't exist yet. The form submits each tag as its own `tags` entry.","html":"<cm-combobox name=\"tags\" label=\"Tags\" multiple allow-custom placeholder=\"Find or create tags\" help-text=\"Customers can filter your store by tag\">\n <option value=\"cotton\" selected>Cotton</option>\n <option value=\"summer\" selected>Summer</option>\n <option value=\"handmade\">Handmade</option>\n <option value=\"festive\">Festive</option>\n <option value=\"sale\">Sale</option>\n <option value=\"organic\">Organic</option>\n</cm-combobox>"},{"title":"Many choices (\"What they sell\")","description":"Since 1.6. With many options chosen, the box shows three tags and \"+4 more\" until the merchant clicks or tabs into it; then every tag shows, wrapping onto more rows. Set `max-tags` to show more (or `0` for all). The list scrolls after seven 36px rows.","html":"<div style=\"max-width:420px;min-height:360px\"><cm-combobox name=\"sells\" label=\"What they sell\" multiple placeholder=\"Search categories\" help-text=\"Choose every category the shop sells\">\n <option selected>Groceries</option><option selected>Dairy</option><option selected>Bakery</option><option selected>Snacks</option>\n <option selected>Beverages</option><option selected>Personal care</option><option selected>Household</option>\n <option>Frozen foods</option><option>Fruits and vegetables</option><option>Stationery</option><option>Electronics</option><option>Pet supplies</option>\n</cm-combobox></div>"},{"title":"Results from the server","description":"With `filter=\"none\"` the component doesn't filter. Listen for `cm-search` (its `detail.query` is the text), set `loading` while you fetch, then set `options` and clear `loading`. Debounce the request in your code. In this preview the list is already loaded.","html":"<cm-combobox name=\"product\" label=\"Product\" filter=\"none\" placeholder=\"Search products\" empty-text=\"No products match\">\n <option value=\"p-1\">Cotton kurta, indigo</option>\n <option value=\"p-2\">Cotton kurta, white</option>\n <option value=\"p-3\">Silk dupatta</option>\n</cm-combobox>"},{"title":"Loading","description":"While `loading`, the open list shows a spinner and \"Loading\" is announced.","html":"<cm-combobox label=\"Product\" filter=\"none\" loading placeholder=\"Search products\"></cm-combobox>"},{"title":"Error","html":"<cm-combobox name=\"courier\" label=\"Courier\" required error=\"Choose a courier for this order\" placeholder=\"Search couriers\">\n <option value=\"delhivery\">Delhivery</option>\n <option value=\"bluedart\">Blue Dart</option>\n <option value=\"ekart\" disabled>Ekart (not available in your area)</option>\n</cm-combobox>"},{"title":"Small","description":"Since 1.5. `size=\"small\"` makes the box 32px with a 13px label, to sit in a filter row with small selects and slim buttons.","html":"<cm-combobox size=\"small\" label=\"Customer\" placeholder=\"Search customers\">\n <option value=\"c-101\">Robinson Mid Rao</option>\n <option value=\"c-102\">Manjunath K</option>\n</cm-combobox>"},{"title":"Disabled","html":"<cm-combobox label=\"Tags\" multiple disabled><option value=\"cotton\" selected>Cotton</option></cm-combobox>"},{"title":"Option groups","description":"Since 1.3. `<optgroup label=\"…\">` children or a `group` on each option in `options`, as for Select. Typing keeps the heading of every group that still has a match (try \"em\"). `show-group` shows the chosen option as \"Contact: Email\" in the box (and in tags with `multiple`).","html":"<div style=\"min-height:340px\"><cm-combobox name=\"field\" label=\"Take the value from a CRM field\" placeholder=\"Search fields\" show-group>\n <optgroup label=\"Lead\">\n <option value=\"lead.company\">Company</option>\n <option value=\"lead.email\">Email</option>\n <option value=\"lead.phone\">Phone</option>\n </optgroup>\n <optgroup label=\"Contact\">\n <option value=\"contact.name\">Full name</option>\n <option value=\"contact.email\">Email</option>\n </optgroup>\n <optgroup label=\"Account\">\n <option value=\"account.name\">Account name</option>\n <option value=\"account.gstin\">GSTIN</option>\n </optgroup>\n</cm-combobox></div>"}],"do":["Use a combobox for long lists (more than about 15 options) and for anything loaded from the server; use Select for short fixed lists.","Use `multiple` for tags, collections and filters that accept several values.","Debounce `cm-search` requests (about 250 ms) and show `loading` while they run.","Use `allow-custom` only where a new value makes sense, such as tags; listen for `cm-create` to check or refuse it."],"dont":["Don't use it for fewer than about 7 options: a select or radio buttons show every choice at once.","Don't put actions in the list: use an action menu.","Don't clear what the merchant typed when results arrive."],"content":["The label is a noun: \"Customer\", \"Tags\".","The placeholder says what can be searched: \"Search by name or phone\".","`empty-text` names what wasn't found: \"No customers match\"."],"accessibility":["Follows the WAI-ARIA APG \"combobox with list autocomplete\" pattern: a native text input with `role=\"combobox\"`, `aria-autocomplete=\"list\"`, `aria-expanded` and `aria-controls` pointing at a `listbox`. Focus stays in the text box; the highlighted option is shown with `aria-activedescendant`.","Option groups are `group`s inside the listbox named by their heading (`aria-labelledby`); headings are not options, and the announced count is of options only.","Keyboard: typing filters and opens the list; Down and Up open it and move through options (skipping disabled ones and group headings, wrapping at the ends); Alt+Down opens it without highlighting; Enter chooses the highlighted option, or adds the typed value with `allow-custom`; Escape closes the list, and a second Escape clears the box; Backspace in an empty box removes the last tag (`multiple`); Tab moves on.","Tags (`multiple`, since 1.6): ← (→ in right-to-left text) at the start of the box moves focus to the last tag; ←/→ move between tags, Home/End to the first and last; Backspace removes the focused tag and moves to the one before, Delete to the one after; → past the last tag or Esc goes back to the text box. Tags are not Tab stops, so Tab leaves the field in one step.","The number of matches (\"3 results\", \"No results\", \"Loading\") is announced through a polite live region as the merchant types.","With `multiple` the listbox is `aria-multiselectable` and chosen options have `aria-selected=\"true\"` and a check mark, not only colour. Each tag's remove button is named \"Remove <tag>\" and focus returns to the text box after removing.","Form-associated: submits `value` under `name`, or with `multiple` one entry per value (`formData.getAll(name)`); `required` blocks submission; `form.reset()` restores the initial choice. `<option selected>` sets it."],"responsive":["Suggestions in the open list are 36px rows of 14px text with 12px side padding (32px with `size=\"small\"`; since 1.6); on touch screens the box and the rows are 44px tall and the typed text is 16px.","With `multiple`, 24px tags wrap onto new rows inside the box, so it grows 28px per row from its 40px minimum instead of getting wider; the chevron stays at the end. While the box isn't focused only `max-tags` (3) tags show, then \"+N more\"."],"related":["select","tag","search","text-field"]},{"tag":"cm-date-picker","slug":"date-picker","name":"Date picker","react":"DatePicker","group":"Forms","summary":"Lets merchants type a date or pick one from a calendar, optionally with a time.","lead":"A 40px text box (32px with `size=\"small\"`; 40px since 1.6) with a calendar button. Merchants can type the date in their own format (15/11/2026, 2026-11-15 or 15 Nov 2026) or open a month calendar to pick it. The value is always ISO `yyyy-mm-dd`, and month and weekday names follow the page language. Add `time` for a date and a time (since 1.2): a time box joins it and the value becomes local `yyyy-mm-ddThh:mm`.","docs_url":"https://commmerce.com/commmerceui/#components--date-picker","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The date as ISO `yyyy-mm-dd`; empty when no date is set. With `time`: the local date and time\n`yyyy-mm-ddThh:mm` (no time zone or offset), empty until both a date and a time are set."},{"attribute":"min","property":"min","type":"string","default":"''","description":"Earliest date that can be chosen, ISO `yyyy-mm-dd`. With `time` it may include a time, `yyyy-mm-ddThh:mm`,\nor be `now` (the current minute, checked again whenever the field is validated)."},{"attribute":"max","property":"max","type":"string","default":"''","description":"Latest date that can be chosen, ISO `yyyy-mm-dd`. With `time`, also `yyyy-mm-ddThh:mm` or `now`."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Shown in the empty box. Defaults to the locale's pattern, e.g. \"dd/mm/yyyy\"."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for month and weekday names and the typed date order, e.g. `en-IN`, `hi-IN`. Empty: the same\nlanguage as every other component (`configure({ locale })`, else the nearest `lang` attribute, else the browser's).\nBuilt-in text follows that language too; set it with `strings`, `setStrings()` or `configure()`."},{"attribute":"first-day-of-week","property":"firstDayOfWeek","type":"number | undefined","description":"First column of the calendar: 0 = Sunday, 1 = Monday … 6 = Saturday. Defaults to the locale's custom where the browser knows it, else Sunday."},{"attribute":"disabled-dates","property":"disabledDates","type":"string[]","default":"[]","description":"Dates that can't be chosen, as ISO strings. In HTML, a comma- or space-separated list."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until a date is set."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the calendar is showing."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px."},{"attribute":"time","property":"time","type":"boolean","default":"false","description":"Adds a time box next to the date box, so the field holds a date and a time. Times are typed (`3:30 pm`, `15:30`)\nand shown in the locale's clock (12-hour with am/pm for `en-IN`); Up and Down change the time by `step`."},{"attribute":"step","property":"step","type":"number","default":"1","description":"With `time`: minutes between allowed times, counted from midnight (15 allows :00, :15, :30, :45). Up and Down in the time box move by it. Default 1."},{"attribute":"hour-cycle","property":"hourCycle","type":"'' | 'h12' | 'h23'","default":"''","description":"With `time`: `h12` or `h23` to force a 12- or 24-hour clock. Empty: the locale's clock."},{"attribute":"_text","property":"_text","type":"string","default":"''"},{"attribute":"_dateError","property":"_dateError","type":"string","default":"''","description":"Shown after the user leaves a box holding text that isn't a date (or a time); an app's `error` wins."},{"attribute":"_timeError","property":"_timeError","type":"string","default":"''"},{"attribute":"_focus","property":"_focus","type":"Date","default":"new Date()"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"isDateDisabled","type":"(date: string) => boolean | undefined","description":"Function that returns true for dates that can't be chosen, e.g. `(iso) => new Date(iso).getDay() === 0` for Sundays. Property only."},{"property":"valueAsDate","type":"Date | null","description":"The value as a local Date (with `time`, at that time), or null."}],"methods":[{"name":"show","description":"Opens the calendar."},{"name":"close","description":"Closes the calendar."},{"name":"isUnavailable","description":"True when a date can't be chosen (outside min/max, in `disabledDates` or refused by `isDateDisabled`)."}],"slots":[],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the date changes: picked in the calendar, or typed and committed with Enter or by leaving the box."}],"parts":[],"examples":[{"title":"Default","description":"Typed dates are read in the order of the page language: day first for `en-IN`, month first for `en-US`. The placeholder shows the order.","html":"<cm-date-picker name=\"ship_by\" label=\"Ship by\" locale=\"en-IN\" help-text=\"The date the courier collects the parcel\"></cm-date-picker>"},{"title":"With a value, min and max","description":"`min` and `max` take ISO dates. Dates outside them can't be picked, and a typed date outside them makes the field invalid.","html":"<cm-date-picker name=\"publish\" label=\"Publish on\" value=\"2026-11-20\" min=\"2026-11-15\" max=\"2026-12-31\"></cm-date-picker>"},{"title":"Date and time","description":"`time` adds a time box: merchants type `4pm`, `16:00` or `4:15 pm`, or press Up and Down to move by `step` minutes. The time is shown in the locale's clock (12-hour with am/pm for `en-IN`). `min=\"now\"` refuses past days and earlier times today, checked again whenever the field is validated. The value is the merchant's local date and time with no time zone, e.g. `2026-11-20T16:00`: the browser's time zone is the merchant's, so convert it with `new Date(value)` before sending it to a server that stores UTC.","html":"<cm-date-picker name=\"follow_up\" label=\"Follow up on\" locale=\"en-IN\" time min=\"now\" step=\"15\" required help-text=\"In your time zone. Times are on the quarter hour.\"></cm-date-picker>"},{"title":"Date and time with limits","description":"With `time`, `min` and `max` take a date and time (`2026-11-20T10:00`) or a date: a date-only `max` allows the whole of that day. A time outside them, or off the `step`, makes the field invalid with a message that names the limit.","html":"<cm-date-picker name=\"demo_at\" label=\"Demo at\" locale=\"en-IN\" time min=\"2026-11-20T10:00\" max=\"2026-11-27T18:00\" step=\"30\" value=\"2026-11-20T09:30\"></cm-date-picker>"},{"title":"Unavailable dates","description":"`disabled-dates` lists dates that can't be picked (holidays, full slots). For a rule, such as no Sundays, set the `isDateDisabled` property to a function in JavaScript.","html":"<cm-date-picker name=\"pickup\" label=\"Pickup date\" value=\"2026-11-16\" disabled-dates=\"2026-11-17 2026-11-18\" help-text=\"Courier holidays are not available\"></cm-date-picker>"},{"title":"Another language","description":"`locale` sets the language of month and weekday names and the typed order; without it the picker uses the same language as every other component (`configure({ locale })`, else the nearest `lang` attribute). Translate its built-in text (button names, validation messages, the dd/mm/yyyy letters) with `strings` or `setStrings({ datePicker: {…} })`. `first-day-of-week` sets the first column (0 Sunday, 1 Monday).","html":"<cm-date-picker label=\"तारीख\" locale=\"hi-IN\" first-day-of-week=\"0\" value=\"2026-11-15\"></cm-date-picker>"},{"title":"Required","html":"<cm-date-picker name=\"dob\" label=\"Date of birth\" required max=\"2026-11-15\"></cm-date-picker>"},{"title":"Error","html":"<cm-date-picker name=\"expiry\" label=\"Offer ends\" value=\"2026-11-01\" error=\"Choose a date after the offer starts (5 Nov 2026)\"></cm-date-picker>"},{"title":"Small","description":"`size=\"small\"` makes the box 32px with a 13px label, the height of slim buttons, for toolbars, filter rows and filter panels. Both sizes are 44px on touch screens.","html":"<cm-date-picker size=\"small\" label=\"Placed after\"></cm-date-picker>"}],"do":["Let merchants type: it is quicker than the calendar for dates far away, such as a date of birth.","Set `min` and `max` when only some dates make sense, and say why in `help-text`.","Send and store the ISO `value`; format dates for display with `Intl.DateTimeFormat`.","For a start and end date, use Date range picker.","For a follow-up, a booking or a reminder, add `time` and `min=\"now\"`; set `step` (15 or 30) when only round times make sense."],"dont":["Don't add `time` when only the day matters (ship-by dates, dates of birth).","Don't use three separate day, month and year selects.","Don't hide unavailable dates; they stay in the calendar, crossed out and not choosable."],"content":["The label names the date: \"Ship by\", \"Offer ends\", not \"Date\".","Errors say which dates are allowed: \"Choose a date after 5 Nov 2026\"."],"accessibility":["Follows the WAI-ARIA APG \"date picker dialog\" pattern. The text box is a real `<input>` with a `<label>`; the calendar button is named \"Choose date for <label>\" (or \"Change date…, <date>\" once set) and has `aria-haspopup=\"dialog\"` and `aria-expanded`.","The calendar is a `dialog` with a `grid` labelled by the month heading. The month heading is a polite live region, so changing month is announced. Each day is named with the full date (\"Sunday 15 November 2026\"); the chosen day has `aria-selected`, today has `aria-current=\"date\"` and unavailable days `aria-disabled`.","Keyboard in the calendar: arrows move by day and week (in right-to-left languages the grid runs right to left and Left goes to the next day); Home and End go to the start and end of the week; Page Up/Down change month and Shift+Page Up/Down change year; Enter or Space picks the date and closes; Escape closes without picking. Focus returns to the calendar button either way. Tab moves between the month buttons and the grid and stays inside the calendar while it is open. Alt+Down in the text box opens it.","Form-associated: submits the ISO date under `name`; `required` blocks submission while empty; text that is not a date, a date outside `min`/`max` and an unavailable date make the field invalid (`validity.badInput`, `rangeUnderflow`, `rangeOverflow`, `customError`); `form.reset()` restores the initial date.","Dates are local calendar dates with no time zone, so a date never shifts by a day for merchants east or west of UTC.","With `time`: the time box is a text box named \"Time for <label>\", sharing the field's help text and error. Its placeholder shows the format (hh:mm am). Up and Down move the time by `step` minutes (from an empty box they start at `min` or the current time); Enter or leaving the box reads what was typed. Picking a day in the calendar moves focus to the time box while it is empty. A date without a time, or a time that can't be read, makes the field invalid (`validity.badInput`, \"Enter a time.\"); an earlier or later time `rangeUnderflow`/`rangeOverflow`; a time off the step `stepMismatch`. Times are local, like the date: the browser's time zone."],"responsive":["The calendar is never wider than the window less 32px; when the window is 640px wide or less, day cells are 36px tall instead of 40px.","With `time`, the date and time boxes sit side by side (date about two thirds) and the time box moves under the date box when the field is narrower than about 300px."],"related":["date-range-picker","text-field","select"]},{"tag":"cm-date-range-picker","slug":"date-range-picker","name":"Date range picker","react":"DateRangePicker","group":"Forms","summary":"Picks a start (from) and end (to) date, typed or from a calendar, with preset ranges for reports.","lead":"Two date boxes in one field, from and to, with a calendar button. In the calendar, the first date picked is the start and the second the end; preset ranges such as \"Last 7 days\" sit beside it. For reports (since 1.16) it works like an analytics date picker: a \"Custom\" preset, two months side by side and Apply/Cancel. Use it to filter orders and reports by date.","docs_url":"https://commmerce.com/commmerceui/#components--date-range-picker","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box, e.g. \"Order date\". Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name. The range is submitted as `<name>-start` and `<name>-end` unless `start-name` / `end-name` are set."},{"attribute":"start-name","property":"startName","type":"string","default":"''","description":"Form entry name for the start date (instead of `<name>-start`). `name` must still be set for the form to include the field."},{"attribute":"end-name","property":"endName","type":"string","default":"''","description":"Form entry name for the end date (instead of `<name>-end`)."},{"attribute":"start","property":"start","type":"string","default":"''","description":"Start of the range, ISO `yyyy-mm-dd`; empty when not set."},{"attribute":"end","property":"end","type":"string","default":"''","description":"End of the range, ISO `yyyy-mm-dd`; empty when not set."},{"attribute":"min","property":"min","type":"string","default":"''","description":"Earliest date that can be chosen, ISO `yyyy-mm-dd`."},{"attribute":"max","property":"max","type":"string","default":"''","description":"Latest date that can be chosen, ISO `yyyy-mm-dd`. For reports, usually today."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for month and weekday names and the typed date order. Empty: the same language as every other\ncomponent (`configure({ locale })`, else the nearest `lang` attribute, else the browser's)."},{"attribute":"first-day-of-week","property":"firstDayOfWeek","type":"number | undefined","description":"First column of the calendar: 0 = Sunday, 1 = Monday … 6 = Saturday. Defaults to the locale's custom where known, else Sunday."},{"attribute":"disabled-dates","property":"disabledDates","type":"string[]","default":"[]","description":"Dates that can't be chosen, as ISO strings. In HTML, a comma- or space-separated list."},{"attribute":"presets","property":"presets","type":"Array<DateRangePresetKey | DateRangePreset>","default":"[]","description":"Preset ranges shown beside the calendar: keys (`today`, `yesterday`, `last-7-days`, `last-30-days`, `last-90-days`,\n`this-month`, `last-month`) or `{ label, start, end }` objects. In HTML, a space-separated list of keys."},{"attribute":"preset","property":"preset","type":"string","default":"''","description":"Key of the preset the range came from (`last-7-days`), or empty for dates picked or typed. Set it to a key to\nchoose that range relative to today, e.g. a report that opens on \"Last 28 days\"; the picker keeps it up to date\nwhen people change the range. The key need not be in `presets`."},{"attribute":"months","property":"months","type":"number","default":"1","description":"Months shown side by side in the calendar: 1 (default) or 2. Phones (640px or narrower) always show one."},{"attribute":"confirm","property":"confirm","type":"boolean","default":"false","description":"Presets and dates picked in the calendar are a draft until Apply; Cancel, Escape or a click outside drop it.\nWithout it, choosing a preset or the end date changes the range at once."},{"attribute":"variant","property":"variant","type":"'' | 'report'","default":"''","description":"`report` (since 1.18): the layout for report and dashboard pages. The field is one button that shows the preset\nand the range (\"Last 28 days · 23 Oct – 19 Nov 2026\"); the popup has the presets on the left (\"Custom\" first, each\nwith its dates), start and end date boxes, months to scroll through, and Cancel and Apply. It always works as with\n`confirm`. Without `presets` it lists custom, today, yesterday, this week, last 7 days, last week, last 28 days,\nlast 30 days, this month, last month, last 90 days, quarter to date and this year."},{"attribute":"_dStartText","property":"_dStartText","type":"string","default":"''","description":"`variant=\"report\"`: the text in the popup's start and end boxes (the draft, or what is being typed)."},{"attribute":"_dEndText","property":"_dEndText","type":"string","default":"''"},{"attribute":"start-label","property":"startLabel","type":"string","description":"Accessible name of the start input. Default: the built-in string `start` (\"Start date\")."},{"attribute":"end-label","property":"endLabel","type":"string","description":"Accessible name of the end input. Default: the built-in string `end` (\"End date\")."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until both dates are set."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the calendar is showing."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px."},{"attribute":"_startText","property":"_startText","type":"string","default":"''"},{"attribute":"_endText","property":"_endText","type":"string","default":"''"},{"attribute":"_focus","property":"_focus","type":"Date","default":"new Date()"},{"attribute":"_draftStart","property":"_draftStart","type":"string","default":"''"},{"attribute":"_draftEnd","property":"_draftEnd","type":"string","default":"''"},{"attribute":"_hover","property":"_hover","type":"Date | null","default":"null"},{"attribute":"_view","property":"_view","type":"Date","description":"First month shown."},{"attribute":"_draftPreset","property":"_draftPreset","type":"string","default":"''","description":"With `confirm`: the preset key of the draft range."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"isDateDisabled","type":"(date: string) => boolean | undefined","description":"Function that returns true for dates that can't be chosen. Property only."}],"methods":[{"name":"show","description":"Opens the calendar."},{"name":"close","description":"Closes the calendar without changing the range."},{"name":"isUnavailable","description":"True when a date can't be chosen (outside min/max, in `disabledDates` or refused by `isDateDisabled`)."}],"slots":[],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the range changes: both dates picked, a preset chosen, or a typed date committed."}],"parts":[],"examples":[{"title":"Report date range","description":"`variant=\"report\"` (since 1.18) for report and dashboard pages: the field shows the preset and the dates; the popup has the presets on the left with their dates under each, typed start and end boxes, months to scroll through, and Cancel and Apply. Without `presets` it lists the report set (custom, today, yesterday, this week, last 7 days, last week, last 28 days, last 30 days, this month, last month, last 90 days, quarter to date, this year). `preset=\"last-28-days\"` opens on the last 28 days counted from today, and the picker keeps `preset` up to date, so save the preset rather than the dates. Set `max` to today when future days have no data.","html":"<cm-date-range-picker name=\"report\" label=\"Report period\" variant=\"report\" preset=\"last-28-days\"></cm-date-range-picker>"},{"title":"Two months with Apply","description":"For a period that isn't a report filter, `months=\"2\"` shows two months side by side and `confirm` makes presets and dates a draft until Apply. End the presets with `custom` for a \"Custom\" button.","html":"<cm-date-range-picker name=\"sale\" label=\"Sale period\" presets=\"this-week last-week this-month last-month custom\" months=\"2\" confirm></cm-date-range-picker>"},{"title":"Orders date filter","description":"Presets come from a list of keys: `today`, `yesterday`, `this-week`, `last-week`, `last-7-days`, `last-28-days`, `last-30-days`, `last-90-days`, `last-12-months`, `this-month`, `last-month`, `quarter-to-date`, `last-quarter`, `this-year` (1 January to today), `last-year`, and `custom`, a button that leaves the dates to the calendar. Weeks start on the picker's first day of the week. Set `max` to the current date when you render the page, so future days can't be chosen.","html":"<cm-date-range-picker name=\"placed\" label=\"Order date\" presets=\"today last-7-days last-30-days this-month\" start=\"2026-11-01\" end=\"2026-11-15\" help-text=\"Shows orders placed between these dates\"></cm-date-range-picker>"},{"title":"In a filter bar","description":"Next to a payment select, both in the small size (32px), so the boxes line up. The form submits `placed-start` and `placed-end`.","html":"<div class=\"row\" style=\"align-items:flex-end;gap:8px\">\n <cm-date-range-picker size=\"small\" name=\"placed\" label=\"Placed\" presets=\"today last-7-days last-30-days this-month\" style=\"flex:1;min-width:260px\"></cm-date-range-picker>\n <cm-select size=\"small\" label=\"Payment\" style=\"min-width:160px\"><option value=\"\">Any</option><option value=\"paid\">Paid</option><option value=\"pending\">Pending</option></cm-select>\n</div>"},{"title":"Custom form names","description":"For a server that expects other field names, set `start-name` and `end-name` (`name` must still be set).","html":"<cm-date-range-picker name=\"range\" start-name=\"from\" end-name=\"to\" label=\"Sale period\" min=\"2026-11-01\"></cm-date-range-picker>"},{"title":"Required","html":"<cm-date-range-picker name=\"report\" label=\"Report period\" required></cm-date-range-picker>"},{"title":"Error","html":"<cm-date-range-picker name=\"report\" label=\"Report period\" start=\"2026-10-01\" end=\"2026-11-15\" error=\"Choose 31 days or fewer\"></cm-date-range-picker>"}],"do":["Offer presets that match what merchants report on; \"Last 7 days\" and \"This month\" cover most order and sales filters.","For report and dashboard pages, use `variant=\"report\"`.","Save `preset` with a report when it is set, so \"Last 28 days\" still means the last 28 days next week.","Set `max` to today for reports, so empty future days can't be chosen.","Show the chosen range in the report heading too, so a printed or shared page says which dates it covers.","Set custom presets as objects in JavaScript: `picker.presets = [{ label: 'Diwali sale', start: '2026-11-01', end: '2026-11-08' }]`."],"dont":["Don't use two separate date pickers for a range: the range picker keeps the two dates in order and shows the range.","Don't offer more than about six presets in a filter row; a report period can list up to about twelve.","Don't use `confirm` in a small filter row where each change should show at once.","Don't allow very long ranges your reports can't load: check them and set `error`."],"content":["The label names what is filtered: \"Order date\", \"Report period\".","Preset labels are short and relative: \"Last 7 days\", \"This month\"."],"accessibility":["The field is a `group` named by the label, with two text inputs named \"Start date\" and \"End date\" (change with `start-label` and `end-label`). The calendar button is named \"Choose dates for <label>\", or with the current range once set.","The calendar is the same APG date picker grid as Date picker, with the same keys. Picking is two steps: a line under the grid says \"Choose the start date\", then \"Start date 4 Nov 2026. Choose the end date.\" (a polite live region). Dates in the range have `aria-selected`; the start and end days are named \"…, start date\" and \"…, end date\".","Preset ranges are buttons in a list named \"Preset ranges\"; the preset that matches the current range has `aria-pressed=\"true\"` (\"Custom\" when the dates match no preset). Tab moves between presets, month buttons and the grid, staying inside the open calendar; Escape closes without changing the range and returns focus to the calendar button.","With `variant=\"report\"` the field is one button named by the preset and the range (\"Last 28 days, Change dates for Report period, …\"). In the popup, the start and end boxes are labelled text boxes that change the draft (Enter or leaving the box); each listed month is a grid labelled by its month heading, under one weekday row that screen readers skip (each grid has its own hidden weekday headers); only one day is a Tab stop and arrow keys move across months, scrolling the list. The footer says the draft range and its length (\"23 Oct – 19 Nov 2026 · 28 days\").","With `months=\"2\"` the two months are two grids, each labelled by its month heading; only one day in either is a Tab stop, and arrow keys move across both (the months move when focus leaves them). With `confirm`, picking the end date keeps the calendar open; the footer shows the draft range and Cancel and Apply buttons (Apply is disabled until both dates are picked). Escape, Cancel or a click outside drop the draft.","Form-associated: submits `<name>-start` and `<name>-end` (or `start-name` / `end-name`) as ISO dates; `required` needs both; an end before the start, text that isn't a date and dates outside `min`/`max` make it invalid; `form.reset()` restores the initial range."],"responsive":["When the window is 640px wide or less, preset ranges move above the calendar as a row of pills, and day cells are 36px tall.","With `months=\"2\"`, phones (640px or narrower) show one month with both arrows.","With `variant=\"report\"`, phones show the presets as one row of pills that scrolls sideways, above the date boxes and months; the months list is at most 40% of the screen tall.","The calendar is never wider than the window less 32px."],"related":["date-picker","time-picker","filter-panel","data-table","select"]},{"tag":"cm-time-picker","slug":"time-picker","name":"Time picker","react":"TimePicker","group":"Forms","summary":"Lets merchants type a time or choose one from a list, on a 12-hour (am/pm) or 24-hour clock.","lead":"A 40px text box with a clock button and a list of times (since 1.16). Merchants type a time the way they say it (3:30 pm, 15:30, 1530, 9pm) or choose one from the list. The clock follows the page language: 12-hour with am/pm for `en-IN` and `en-US`, 24-hour for `en-GB` and most of Europe. Set `hour-cycle=\"h12\"` or `\"h23\"` to choose one. The value is always 24-hour `hh:mm`, whichever clock is shown.","docs_url":"https://commmerce.com/commmerceui/#components--time-picker","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box, e.g. \"Pickup time\". Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The time as 24-hour ISO `hh:mm` (`15:30`), whichever clock is shown; empty when not set."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Placeholder. Default: the format, e.g. \"hh:mm am\" or \"hh:mm\"."},{"attribute":"min","property":"min","type":"string","default":"''","description":"Earliest time that can be chosen, `hh:mm`. The list starts here."},{"attribute":"max","property":"max","type":"string","default":"''","description":"Latest time that can be chosen, `hh:mm`. The list ends here."},{"attribute":"step","property":"step","type":"number","default":"1","description":"Minutes between allowed times, counted from midnight (15 allows :00, :15, :30, :45). A typed time off the step is invalid. Default 1."},{"attribute":"interval","property":"interval","type":"number | undefined","description":"Minutes between the times in the list. Default: `step` when it is 5 or more, else 30. Any allowed time can still be typed."},{"attribute":"hour-cycle","property":"hourCycle","type":"'' | 'h12' | 'h23'","default":"''","description":"`h12` (am/pm) or `h23` (24-hour) to force a clock. Empty: the locale's clock (12-hour for `en-IN` and `en-US`, 24-hour for `en-GB` and most of Europe)."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for the clock and am/pm words. Empty: the same language as every other component."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until a time is set."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the list of times is showing."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box (filter rows); `medium`: 36px. Default 40px. On touch screens all are 44px."},{"attribute":"_text","property":"_text","type":"string","default":"''"},{"attribute":"_active","property":"_active","type":"number","default":"-1","description":"Index of the keyboard-active time in the list, or -1."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"valueAsNumber","type":"number | null","description":"The value as minutes since midnight, or null."}],"methods":[{"name":"show","description":"Shows the list of times, with the chosen time (or the one nearest to now) active and scrolled into view."},{"name":"close","description":"Hides the list without changing the time."}],"slots":[],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the time changes: a time chosen from the list, or typed text read on Enter or on leaving the box."}],"parts":[],"examples":[{"title":"12-hour clock (am/pm)","description":"`hour-cycle=\"h12\"` shows am/pm whatever the language. The value of this field is `15:30`.","html":"<cm-time-picker name=\"pickup\" label=\"Pickup time\" hour-cycle=\"h12\" value=\"15:30\" help-text=\"In your time zone\"></cm-time-picker>"},{"title":"24-hour clock","description":"`hour-cycle=\"h23\"` shows 00:00 to 23:59.","html":"<cm-time-picker name=\"cutoff\" label=\"Order cut-off\" hour-cycle=\"h23\" value=\"18:00\"></cm-time-picker>"},{"title":"Opening hours","description":"`min` and `max` limit the list and typed times; `step` sets the allowed minutes (15 allows :00, :15, :30, :45) and the list follows it. `interval` changes only the list (default: `step` when it is 5 or more, else every 30 minutes).","html":"<div class=\"row\" style=\"gap:8px;align-items:flex-end\">\n <cm-time-picker name=\"opens\" label=\"Opens\" min=\"06:00\" max=\"23:00\" step=\"15\" value=\"09:00\" style=\"flex:1;min-width:140px\"></cm-time-picker>\n <cm-time-picker name=\"closes\" label=\"Closes\" min=\"06:00\" max=\"23:00\" step=\"15\" value=\"21:00\" style=\"flex:1;min-width:140px\"></cm-time-picker>\n</div>"},{"title":"With a date","description":"For one moment (a follow-up, a delivery slot), use Date picker with `time`; it keeps the date and time in one value. Use the time picker when only the time matters, or for a daily time.","html":"<cm-date-picker name=\"follow_up\" label=\"Follow up on\" time step=\"15\"></cm-date-picker>"},{"title":"Required","html":"<cm-time-picker name=\"slot\" label=\"Delivery slot\" required></cm-time-picker>"},{"title":"Error","html":"<cm-time-picker name=\"slot\" label=\"Delivery slot\" value=\"23:30\" error=\"The last slot starts at 9 pm\"></cm-time-picker>"},{"title":"Small","description":"`size=\"small\"` is 32px for filter rows; `size=\"medium\"` 36px. All sizes are 44px on touch screens.","html":"<cm-time-picker size=\"small\" label=\"From\"></cm-time-picker>"}],"do":["Let the page language choose the clock unless your product has one rule; set `hour-cycle` for that.","Store and send the 24-hour `value`; show times to people with `Intl.DateTimeFormat`.","Set `step` when only some times make sense (slots every 15 or 30 minutes), and say so in `help-text`."],"dont":["Don't use two selects for hours and minutes.","Don't use a time picker for a date and time: use the date picker with `time`.","Don't use it for durations (2 hours 30 minutes): use a number field with a unit."],"content":["The label names the time: \"Pickup time\", \"Opens\", not \"Time\".","Say the time zone in `help-text` when people in other zones use the page."],"accessibility":["Follows the WAI-ARIA APG combobox pattern: the text box has `role=\"combobox\"`, `aria-expanded` and `aria-controls` pointing to a `listbox` named \"Times for <label>\"; the keyboard-active time is `aria-activedescendant` and the chosen time has `aria-selected`. Focus stays in the text box.","Keyboard: Down or Up opens the list at the chosen time (or the next time from now); Up and Down move by one time, Page Up and Page Down by six; Enter chooses; Escape closes without changing the time. Typing while the list is open makes the next listed time active. Enter or leaving the box reads what was typed.","The clock button is not a Tab stop (the text box opens the list) and is named \"Show times\".","Form-associated: submits `hh:mm` under `name`; `required` blocks submission while empty; text that is not a time, a time outside `min`/`max` and a time off the `step` make it invalid (`badInput`, `rangeUnderflow`, `rangeOverflow`, `stepMismatch`), with messages under the field as for every field (1.14); `form.reset()` restores the first value."],"responsive":["The list of times is at least as wide as the box and scrolls after about seven times.","On touch screens the box and each time in the list are 44px tall."],"related":["date-picker","date-range-picker","select"]},{"tag":"cm-file-upload","slug":"file-upload","name":"File upload","react":"FileUpload","group":"Forms","summary":"Lets the merchant choose or drop files, such as product images or documents.","lead":"A compact dashed drop zone under a heading (owner standard, 1.6): one 72px row with an upload icon, \"Drag files here or **Browse**\" and the accepted types and size in 12px grey. Its outline darkens on hover, turns solid while files are dragged over it, and gets a focus ring from the keyboard. Chosen images show as thumbnails with a remove button; with `multiple`, a dashed tile at the end adds more. Upload the files yourself and report progress with `setProgress(file, percent)` (a bar and a Cancel button on the tile) and failures with `setFileError(file, message)`.","docs_url":"https://commmerce.com/commmerceui/#components--file-upload","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Heading above the zone, e.g. \"Add product images\"."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Accepted types and size in 12px grey, e.g. \"PNG or JPG, up to 2 MB\". Shown in the empty zone's row (since 1.6),\nnext to the label once files are chosen, and under the label in the photo tile."},{"attribute":"prompt","property":"prompt","type":"string","description":"Text inside the zone; `{browse}` in it becomes the link-like \"Browse\". Default: the built-in string `prompt`\n(\"Drag files here or {browse}\"; \"Click here to upload\" before 1.6)."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"accept","property":"accept","type":"string","default":"''","description":"Allowed types, as for a native input: `image/*`, `.pdf,.csv`. Other files are refused."},{"attribute":"multiple","property":"multiple","type":"boolean","default":"false","description":"Allows more than one file. Chosen files are added to the list rather than replacing it."},{"attribute":"max-size","property":"maxSize","type":"number","default":"0","description":"Largest allowed file in bytes. Larger files are refused."},{"attribute":"max-files","property":"maxFiles","type":"number","default":"0","description":"Most files allowed when `multiple`; 0 for no limit."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit without a file."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message from your own validation; announced and linked to the input."},{"attribute":"variant","property":"variant","type":"'photo' | undefined","description":"`photo` (since 1.3): a single-photo tile for phones. It shows a camera icon and the `label` (or the prompt\n\"Take a photo\" without one); after a photo is taken it fills the tile, with Retake and Remove buttons under it.\nOne file only (`multiple` is ignored); `accept` defaults to `image/*`. Size the tile with CSS on the element;\nit is 4:3 (change it with `::part(photo)`, e.g. `aspect-ratio: 16 / 10` for a visiting card). Empty, the tile is\nat most 120px tall (since 1.6; 4:3 when it is narrower than 160px)."},{"attribute":"capture","property":"capture","type":"'environment' | 'user' | undefined","description":"Asks phones to open the camera instead of the file chooser, as `capture` on a native input (since 1.3):\n`environment` for the back camera (a shop front, a document), `user` for the front camera (a selfie).\nDesktop browsers ignore it and show the file chooser."},{"attribute":"_rejected","property":"_rejected","type":"string","default":"''"},{"attribute":"_progress","property":"_progress","default":"new Map<File, number>()"},{"attribute":"_fileErrors","property":"_fileErrors","default":"new Map<File, string>()"},{"attribute":"_over","property":"_over","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"files","type":"File[]","description":"The chosen files. Set it to `[]` to clear."}],"methods":[{"name":"addFiles","description":"Adds files as if the merchant had chosen them: filters by type, size and count, then fires events."},{"name":"setProgress","description":"Shows a chosen file uploading (since 1.6): a progress bar from 0 to 100 on its tile, with a Cancel button in place\nof Remove. `null` ends it (the upload finished, or failed: then call `setFileError`)."},{"name":"setFileError","description":"Marks one chosen file as failed (since 1.6): its tile turns red with `message` under it. `''` clears it."},{"name":"removeFile","description":"Removes one chosen file and fires `change`."}],"slots":[],"events":[{"name":"cm-reject","description":"When chosen files are refused for type or size. `detail.files` lists them."},{"name":"change","description":"When files are added or removed. Read `files`."},{"name":"cm-cancel","description":"When the merchant cancels a file's upload, with `detail: { file }`: stop the upload. The file is then removed; `preventDefault()` keeps it. Since 1.6."}],"parts":[],"examples":[{"title":"Product images","description":"The compact empty state (1.6). Choose or drop a file to see it pretend to upload.","html":"<cm-file-upload name=\"images\" label=\"Add product images\" hint=\"PNG or JPG, up to 300 KB each\" accept=\"image/*\" multiple max-size=\"307200\" data-demo-upload></cm-file-upload>"},{"title":"Uploading and failed files","description":"Since 1.6. After `change`, upload each new file and call `setProgress(file, percent)` as it goes and `setProgress(file, null)` when it is done: the tile shows a progress bar and its × becomes \"Cancel uploading …\", which fires `cm-cancel` (stop the request; the file is then removed). A failed file: `setFileError(file, message)` turns its tile red with the message under it. In this preview the files are made up.","html":"<cm-file-upload name=\"feedback\" label=\"Feedback attachments\" hint=\"PNG, JPG or PDF, up to 5 MB\" accept=\"image/*,.pdf\" multiple data-demo-files=\"screen.png:45,receipt.pdf:80,photo.png:error\"></cm-file-upload>"},{"title":"Single document","description":"Without `multiple`, a chosen file replaces the zone; remove it to choose another.","html":"<cm-file-upload name=\"gst\" label=\"GST certificate\" hint=\"PDF, up to 2 MB\" accept=\".pdf\" max-size=\"2097152\" prompt=\"Drag a PDF here or {browse}\"></cm-file-upload>"},{"title":"Without a heading","description":"Inside a popup, where the popup title already says what to upload. Give the zone a prompt that names the file; `{browse}` in it becomes the link-like \"Browse\".","html":"<cm-file-upload name=\"banner\" prompt=\"Drop the banner image here or {browse}\" hint=\"1200 x 400px\" accept=\"image/*\"></cm-file-upload>"},{"title":"Required with error","html":"<cm-file-upload name=\"kyc\" label=\"Address proof\" hint=\"PDF or photo, up to 5 MB\" required error=\"Upload an address proof to continue\"></cm-file-upload>"},{"title":"Photo from the camera","description":"Since 1.3. `variant=\"photo\"` is one tile for one photo, the usual pattern on phones; `capture=\"environment\"` opens the back camera directly (desktop browsers show the file chooser). Empty, the tile is 4:3 and at most 120px tall (since 1.6; it grew to 300px in wide columns). After a photo is taken it fills the width, with Retake and Remove under it. Images only unless you set `accept`.","html":"<div style=\"display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:16px;max-width:420px\">\n <cm-file-upload name=\"shop_photo\" variant=\"photo\" capture=\"environment\" label=\"Shop front photo\" required max-size=\"5242880\"></cm-file-upload>\n <cm-file-upload name=\"card_photo\" variant=\"photo\" capture=\"environment\" label=\"Visiting card\" hint=\"max. 5 MB\" max-size=\"5242880\"></cm-file-upload>\n</div>"},{"title":"Camera on a multi-file zone","description":"Since 1.3. `capture` works on the default zone too, for example for several shelf photos.","html":"<cm-file-upload name=\"shelf\" label=\"Shelf photos\" accept=\"image/*\" capture=\"environment\" multiple max-files=\"4\"></cm-file-upload>"}],"do":["State the allowed types and size in `hint`, and enforce them with `accept` and `max-size`.","Use `multiple` with `max-files` for galleries.","On phones, use `variant=\"photo\"` with `capture=\"environment\"` for a photo the merchant takes on the spot (shop front, visiting card, delivery proof). Give each tile a label that names the photo; the buttons are named after it (\"Retake Shop front photo\").","Change the photo tile's shape with `::part(photo)` (the empty tile and the photo both have it), e.g. `aspect-ratio: 16 / 10` for a card; it is 4:3 by default.","Upload in the background after `change`; report progress on the file's own tile with `setProgress(file, percent)` and a failure with `setFileError(file, message)`, and stop the request on `cm-cancel`."],"dont":["Don't hide the rules until after an upload fails.","Don't make the empty zone tall to draw attention: the 72px row is the standard (owner standard, 1.6).","Don't use it for a single image that can be picked from existing media: use a resource picker (planned)."],"content":["Heading says what to add: \"Add product images\".","Hints are lowercase rules: \"max. file size 300 KB\".","Refusals name the file and the rule: \"banner.png is larger than 300 KB\"."],"accessibility":["A native file input fills the zone, so it is reachable with Tab, opens with Enter or Space, and accepts dropped files. It is named by the heading and the prompt.","Photo tile (`variant=\"photo\"`): the input is named by the label alone (\"Shop front photo\", or \"Take a photo\" without a label) and described by the hint. The taken photo's `alt` is the label. Retake and Remove are buttons named \"Retake <label>\" and \"Remove <label>\"; Retake opens the same input again, and after Remove focus returns to the empty tile. A refused photo keeps the previous one and its message is linked to Retake.","Each thumbnail's remove button is named \"Remove <file name>\"; after removing, focus returns to the zone.","Uploading (1.6): each file's bar is a `progressbar` named \"Uploading <file name>\" with its percentage; its button is named \"Cancel uploading <file name>\". A failed file's message is announced (`role=\"alert\"`) and describes its Remove button.","Refused files and errors are announced (`role=\"alert\"`) and linked with `aria-describedby`; `cm-reject` lists the refused files.","Form-associated: submits the files under `name` (use `enctype=\"multipart/form-data\"`), `required` blocks submission, and `form.reset()` clears them.","The zone is the full width you give it; thumbnails are 112–140px; the drag handle and the star/download/edit hover actions from the product-image screen are left for a future media manager."],"responsive":["Empty, the zone is one 72px row at every width (since 1.6; it was a 160px box): the icon tile, the prompt and the hint; long hints wrap inside it.","Chosen files are shown as tiles: each row holds as many 112–140px tiles as fit, 16px apart.","The empty photo tile (`variant=\"photo\"`) is 4:3 and at most 120px tall, so 160 x 120px in a wide column.","When the window is 640px wide or less, the label is smaller."],"related":["text-field","button"]},{"tag":"cm-color-field","slug":"color-field","name":"Colour field","react":"ColorField","group":"Forms","summary":"Lets the merchant choose a colour that means something, such as the colour of each lead status.","lead":"A label, a row of round swatches and a hex box. The default palette is 12 colours taken from the Commmerce tokens; pass your own with `swatches`. `picker` adds the colour picker for any other colour, with the store's brand colours and the merchant's recent ones. The value is lowercase `#rrggbb` unless you allow opacity, RGB/HSL or gradients. Since 1.3; picker panel since 1.17.","docs_url":"https://commmerce.com/commmerceui/#components--color-field","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the swatches, e.g. \"Colour\". Without one, give the element an `aria-label`."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Lowercase bracketed note after the label, e.g. \"shown on the status tag\"."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the field in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message from your own validation; turns the hex box critical and is announced."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The colour as lowercase `#rrggbb`, or empty for none. `#ABC` and `ABCDEF` are accepted and normalised."},{"attribute":"swatches","property":"swatches","type":"Array<string | ColorSwatch> | undefined","description":"The palette, as `#rrggbb` strings or `{ value, name }`. Names are read out with the hex code and shown as a\ntooltip. Default: 12 colours from the Commmerce tokens (black, greys, red, oranges, yellow, greens, blues).\nIn HTML, pass JSON: `swatches='[\"#2e6faf\", {\"value\": \"#de0000\", \"name\": \"Lost\"}]'`."},{"attribute":"picker","property":"picker","type":"boolean | 'native'","default":"false","description":"Adds a button that opens a colour picker for colours outside the palette: the Commmerce picker panel (since\n1.17.0), or the browser's own with `picker=\"native\"`."},{"attribute":"alpha","property":"alpha","type":"boolean","default":"false","description":"Allows see-through colours: the picker shows opacity; the value may be `#rrggbbaa`, `rgba()` or `hsla()`."},{"attribute":"gradient","property":"gradient","type":"boolean","default":"false","description":"Allows linear and radial gradients from the picker; the value may then be a CSS gradient."},{"attribute":"formats","property":"formats","type":"string","default":"'hex'","description":"Formats the merchant may pick in the picker, space separated: `hex`, `rgb`, `hsl`. Default `hex` only, so the\nvalue stays `#rrggbb`. With more, the value is written in the format they chose."},{"attribute":"brand-colors","property":"brandColors","type":"Array<string | ColorSwatch> | undefined","description":"The store's brand colours, shown first in the picker. In HTML, pass JSON. Wins over `source`."},{"attribute":"recent-colors","property":"recentColors","type":"string[] | undefined","description":"Recent colours for the picker, newest first. Wins over `source`."},{"attribute":"recent-key","property":"recentKey","type":"string","default":"''","description":"Keeps recent colours in this browser under this key when there is no `source`."},{"attribute":"_open","property":"_open","type":"boolean","default":"false"},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Shows a red asterisk and blocks form submission until a colour is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"_draft","property":"_draft","type":"string | undefined","description":"Text in the hex box while it differs from `value`."},{"attribute":"_invalid","property":"_invalid","type":"boolean","default":"false","description":"The hex box holds text that isn't a colour (after it was committed)."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"source","type":"ColorSource | undefined","description":"Where the picker gets brand and recent colours: `app.colors` (App Bridge), `httpColorSource()` or your own."},{"property":"items","type":"ColorSwatch[]","description":"The swatches in use, normalised, with their names. Invalid colours are left out."}],"methods":[{"name":"show","description":"Opens or closes the picker panel."}],"slots":[],"events":[{"name":"type"},{"name":"input","description":"When the colour changes: a swatch, a complete hex code typed, or the picker moving."},{"name":"change","description":"When the colour is committed: a swatch picked, the hex box left or Enter pressed, the picker closed."},{"name":"cm-recent-change","description":"From the picker panel: `detail.colors`, the new recent list."}],"parts":[],"examples":[{"title":"Status colour","html":"<cm-color-field name=\"status_color\" label=\"Status colour\" value=\"#2e6faf\" help-text=\"Shown on the status tag in lists.\"></cm-color-field>"},{"title":"With the colour picker","description":"`picker` turns the preview square into a button that opens the colour picker: a saturation square, hue, the hex box, the eyedropper (Chrome and Edge), brand colours, recent colours and the palette. Without `formats`, `alpha` or `gradient` the value stays `#rrggbb`. Since 1.17; before, `picker` opened the browser's own picker, which `picker=\"native\"` still does.","html":"<cm-color-field name=\"highlight\" label=\"Highlight\" hint=\"optional\" value=\"#ffc107\" picker recent-key=\"docs-highlight\" brand-colors='[{\"value\":\"#0a7cff\",\"name\":\"Primary\"},{\"value\":\"#111827\",\"name\":\"Ink\"},{\"value\":\"#ff5a1f\",\"name\":\"Accent\"}]'></cm-color-field>"},{"title":"Opacity, formats and gradients","description":"`alpha` adds opacity (`#rrggbbaa`, `rgba()`, `hsla()`), `formats=\"hex rgb hsl\"` lets the merchant choose how the value is written, and `gradient` adds linear and radial gradients. The box then takes any of those. Check the value again on your server.","html":"<cm-color-field name=\"banner_bg\" label=\"Banner background\" picker alpha gradient formats=\"hex rgb hsl\" value=\"linear-gradient(90deg, #2e6faf 0%, #81bb47 100%)\"></cm-color-field>"},{"title":"Brand and recent colours from the admin","description":"In an embedded app, pass App Bridge's `app.colors` as `source`: the admin answers with the brand colours set in the store settings and remembers recents per staff member. Outside the admin, use `httpColorSource({ baseUrl })` with your server (see Colour picker). In JavaScript: `field.source = app.colors`.","html":"<cm-color-field name=\"label_color\" label=\"Label colour\" picker value=\"#2e6faf\"></cm-color-field>"},{"title":"Your own palette","description":"Strings or `{ value, name }`. Names are read out with the hex code and shown as a tooltip. In JavaScript: `field.swatches = [{ value: '#3c7c00', name: 'Won' }]`.","html":"<cm-color-field name=\"pipeline_color\" label=\"Stage colour\" swatches='[{\"value\":\"#3c7c00\",\"name\":\"Won\"},{\"value\":\"#de0000\",\"name\":\"Lost\"},{\"value\":\"#ad5500\",\"name\":\"On hold\"},{\"value\":\"#2e6faf\",\"name\":\"Open\"}]' value=\"#de0000\"></cm-color-field>"},{"title":"Required with error","html":"<cm-color-field name=\"tag_color\" label=\"Tag colour\" required error=\"Choose a colour that isn't used by another status\"></cm-color-field>"}],"do":["Use it where a colour helps merchants tell things apart at a glance (pick-list values, tags, calendar types), and always show the name next to the colour where it is used.","Keep the palette small: the default 12, or fewer of your own.","Pair a chosen colour with text by luminance where you use it (as the swatch check mark does), so labels on it stay readable."],"dont":["Don't use a picked colour to theme your app's own interface: embedded apps use Commmerce's palette. Picked colours are the merchant's data (a label, a banner, a status).","Don't let colour be the only way a status is shown: keep its name visible.","Don't turn on `alpha`, `gradient` or more `formats` unless the place the colour is used can show them."],"content":["Label names what the colour is for: \"Status colour\", not \"Colour\".","Name your own swatches after what they mean (\"Won\", \"Lost\") or plainly (\"Blue\"); the hex code is added for you."],"accessibility":["The swatches are a `radiogroup` named by the label (or the element's `aria-label`): one tab stop, arrow keys move and select (wrapping; ArrowLeft moves forward in right-to-left text), Home and End jump, Space and Enter select. Each swatch is a `radio` named \"<name>, <hex>\" (\"Blue, #2e6faf\"), or by its hex code alone.","The selected swatch shows a check mark and a ring, so the choice doesn't rely on colour. The check is black or white, whichever contrasts more with the swatch (4.5:1 or more for any colour); every swatch has a `border-input` outline so light colours stand out on white and black on dark.","The hex box is named \"<label>, hex code\". A complete code updates the value as you type; leaving the box or pressing Enter commits it. Text that isn't a colour shows \"Enter a colour as #RRGGBB, for example #2e6faf.\" (announced, `aria-invalid`, linked with `aria-describedby`) and makes the field invalid. `#abc` and codes without `#` are accepted and normalised.","With `picker`, the button is named \"Choose a custom colour for <label>\", says it opens a dialog (`aria-haspopup`, `aria-expanded`) and opens the picker in the top layer with focus on its square; Escape or a click outside closes it and Escape returns focus to the button. See Colour picker for the panel. With `picker=\"native\"`, the browser's colour input has the same name.","With `alpha`, `gradient` or more `formats`, the box is named \"<label>, colour value\" and text that isn't a colour shows \"Enter a colour such as #2e6faf or rgb(46, 111, 175).\"","Form-associated like Text field: submits `value` under `name`, `required` blocks submission, `error` sets a custom error, a disabled `<fieldset>` disables it, `form.reset()` restores the first value."],"responsive":["Swatches wrap onto more rows when they don't fit; each is 32px with 8px between.","The hex box is wide enough for \"#rrggbb\" and does not stretch."],"related":["text-field","option-group","tag"]},{"tag":"cm-color-picker","slug":"color-picker","name":"Colour picker","react":"ColorPicker","group":"Forms","summary":"Picks any colour: a saturation square, hue and opacity, hex/RGB/HSL, the eyedropper, gradients, and the store's brand colours and recent colours.","lead":"The panel that colour field opens with `picker`; use it on its own in a side panel or popover of yours. From the top: Solid / Gradient tabs (`gradient`), the gradient bar with its stops, the saturation and brightness square, hue and opacity (`alpha`) sliders with a preview, the format menu (`formats`) with a box per channel and the eyedropper, then three swatch groups: **Brand colours**, **Recent** and **Palette**. Since 1.17.","docs_url":"https://commmerce.com/commmerceui/#components--color-picker","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"The colour: hex, `rgb()`, `hsl()` or, with `gradient`, a `linear-gradient()` / `radial-gradient()`. Empty for none."},{"attribute":"format","property":"format","type":"ColorFormat","default":"'hex'","description":"How the value is written: `hex` (default), `rgb` or `hsl`. Changes when the merchant picks another format."},{"attribute":"formats","property":"formats","type":"string","default":"'hex rgb hsl'","description":"Formats the merchant may switch between, space separated. Default `hex rgb hsl`; one format hides the menu."},{"attribute":"alpha","property":"alpha","type":"boolean","default":"false","description":"Shows the opacity slider. A see-through colour is written `#rrggbbaa`, `rgba()` or `hsla()`."},{"attribute":"gradient","property":"gradient","type":"boolean","default":"false","description":"Adds Solid / Gradient tabs: linear or radial gradients with two or more stops."},{"attribute":"swatches","property":"swatches","type":"Array<string | ColorSwatch> | undefined","description":"The palette, as colours or `{ value, name }`. Default: 12 colours from the Commmerce tokens. `[]` hides it."},{"attribute":"brand-colors","property":"brandColors","type":"Array<string | ColorSwatch> | undefined","description":"The store's brand colours. Wins over `source`. In HTML, pass JSON."},{"attribute":"recent-colors","property":"recentColors","type":"string[] | undefined","description":"Recent colours, newest first. Wins over `source`; update it from `cm-recent-change`."},{"attribute":"recent-key","property":"recentKey","type":"string","default":"''","description":"Keeps recents in this browser under this key when there is no `source` (a `localColorSource`)."},{"attribute":"max-recent","property":"maxRecent","type":"number","default":"MAX_RECENT","description":"How many recent colours to show. Default 16."},{"attribute":"eyedropper","property":"eyedropper","type":"boolean","default":"true","description":"Shows the eyedropper where the browser has one (Chrome and Edge on desktop). Default on."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction."},{"attribute":"_hsva","property":"_hsva","type":"Hsva","default":"{ h: 0, s: 0, v: 0, a: 1 }"},{"attribute":"_grad","property":"_grad","type":"Gradient | null","default":"null"},{"attribute":"_stop","property":"_stop","type":"number","default":"0"},{"attribute":"_brand","property":"_brand","type":"ColorSwatch[]","default":"[]"},{"attribute":"_recent","property":"_recent","type":"string[]","default":"[]"},{"attribute":"_drafts","property":"_drafts","type":"Record<string, string>","default":"{}","description":"Text in a box while it differs from the colour, keyed by box."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"source","type":"ColorSource | undefined","description":"Where brand and recent colours come from (see the colour picker docs)."},{"property":"allowedFormats","type":"ColorFormat[]","description":"Formats the merchant may choose."},{"property":"palette","type":"ColorSwatch[]","description":"The palette in use."},{"property":"brand","type":"ColorSwatch[]","description":"Brand colours in use (`brand-colors`, else from `source`)."},{"property":"recent","type":"string[]","description":"Recent colours in use (`recent-colors`, else from `source` / `recent-key`), without gradients unless `gradient`."}],"methods":[],"slots":[],"events":[{"name":"type"},{"name":"cm-recent-change","description":"`detail.colors`: the new recent list (newest first) after a commit added to it."},{"name":"input","description":"While the colour changes (dragging, typing a complete value)."},{"name":"change","description":"When a colour is committed: a drag ends, a swatch is picked, a box is left or Enter pressed."}],"parts":[],"examples":[{"title":"Brand and recent colours","description":"Brand colours are the ones the merchant set for the store. Each colour they commit that isn't a brand or palette colour goes first in Recent. Here `recent-key` keeps recents in this browser; try a few colours.","html":"<cm-color-picker value=\"#0a7cff\" recent-key=\"docs-picker\" brand-colors='[{\"value\":\"#0a7cff\",\"name\":\"Primary\"},{\"value\":\"#111827\",\"name\":\"Ink\"},{\"value\":\"#ff5a1f\",\"name\":\"Accent\"},{\"value\":\"#f4f1ea\",\"name\":\"Paper\"}]'></cm-color-picker>"},{"title":"Opacity and formats","description":"`alpha` adds the opacity slider and box. The format menu writes the value as hex (`#rrggbbaa` when see-through), `rgb()`/`rgba()` or `hsl()`/`hsla()`; limit it with `formats` (one format hides the menu).","html":"<cm-color-picker alpha value=\"rgba(46, 111, 175, 0.6)\"></cm-color-picker>"},{"title":"Gradients","description":"`gradient` adds Solid / Gradient tabs. Click the bar to add a stop, drag a stop or use the arrow keys to move it, Delete to remove it (two stay). The square, sliders and boxes edit the selected stop. Linear (with an angle) or radial.","html":"<cm-color-picker gradient alpha value=\"linear-gradient(135deg, #0a7cff 0%, #81bb47 100%)\"></cm-color-picker>"},{"title":"From App Bridge or your server","description":"`source` is any object with `brandColors()`, `recentColors()` and `addRecentColor(color)`. In an embedded app, `app.colors` (App Bridge 1.17) asks the admin. Elsewhere, `httpColorSource()` calls the Colour API on your server: `GET /brand-colors`, `GET /recent-colors`, `POST /recent-colors` with `{ \"color\": … }`, each answering `{ \"colors\": […] }`. A reference server (Node, no dependencies) is in the repository at examples/color-api. Lists that fail to load are left out. In JavaScript: `picker.source = httpColorSource({ baseUrl: '/api/colors', headers: () => ({ Authorization: 'Bearer ' + token }) })`, or `picker.source = app.colors` inside the admin, and save `picker.value` on `change`.","html":"<cm-color-picker value=\"#2e6faf\"></cm-color-picker>"}],"do":["Pass the store's brand colours wherever merchants style something customers see (labels, banners, emails), so they stay on brand.","Save `value` on `change`, not `input`: `input` fires on every step of a drag.","Check the value again on your server (the reference Colour API has a validator)."],"dont":["Don't theme your app's own interface with picked colours.","Don't turn on `alpha` or `gradient` for places that can only show a solid colour.","Don't keep recents only in the browser when the merchant works on several devices: use App Bridge or your server."],"content":["Name brand colours by role (\"Primary\", \"Accent\"), not by hex."],"accessibility":["The panel is a group named \"Colour picker\" (or its `aria-label`).","The square is a `slider` named \"Saturation and brightness\" with a value like \"Saturation 74%, brightness 69%\". Left and Right change saturation (reversed in right-to-left text), Up and Down brightness, Shift for steps of 10, Home/End for no or full saturation, PageUp/PageDown for full or no brightness. Each key press commits.","Hue and opacity are native range inputs (\"Hue\", \"Opacity\"), so arrow keys, Home and End work and screen readers read them as sliders. Each box is named after its channel (Hex, Red, Green, Blue, Hue, Saturation, Lightness, Opacity); text that isn't a value turns the box red (`aria-invalid`) and changes nothing.","Gradient stops are `slider`s named \"Stop 2, #0000ff at 100%\": arrows move them (Shift for 10), Home/End to the ends, Delete or Backspace removes one. Solid / Gradient is a `radiogroup`.","Swatches are buttons named \"<name>, <value>\" (or the value) with `aria-pressed` for the current colour, in groups named by their headings. See-through swatches sit on a checkerboard.","The eyedropper shows only where the browser has one (Chrome and Edge on desktop) and is named \"Pick a colour from the screen\".","All built-in text is translatable (`colorPicker` strings)."],"responsive":["272px wide, or narrower when its container is. The square is 160px tall.","Swatches are 24px with 8px between and wrap onto more rows.","On touch screens the square and the stop handles follow the finger; the page does not scroll while dragging on them."],"related":["color-field","modal","side-panel"]},{"tag":"cm-signature-field","slug":"signature-field","name":"Signature field","react":"SignatureField","group":"Forms","summary":"Collects a signature: drawn with a mouse, finger or pen, or typed and shown in a handwriting font.","lead":"A label, Draw and Type tabs with Undo and Clear, and a 3:1 pad with a dashed line and \"Sign here\". Draw takes mouse, touch and pen (with pen pressure), smoothing the strokes; Type shows the name in Dancing Script, self-hosted in `@commmerce/tokens/fonts.css` (falls back to a cursive system font). The value is a PNG data URL, cropped to the ink with 8px around it, at 2x, black ink on transparent in either theme, so it looks right in documents. `toDataURL()` and `toBlob()` give the same image; `empty` says whether anything is signed; `clear()` and `undo()` do what the buttons do. Set `value` to a saved PNG to show it again. There is no upload mode. Since 1.4.","docs_url":"https://commmerce.com/commmerceui/#components--signature-field","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the field, e.g. \"Your signature\". Without one, give the element an `aria-label`."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Lowercase bracketed note after the label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the field in text-tertiary, e.g. what the signer agrees to."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message from your own validation; turns the pad's border critical and is announced."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The signature as a PNG data URL (`data:image/png;base64,…`), cropped to the ink, or empty when nothing is\nsigned. Updated after every stroke and keystroke. Set it to a PNG or SVG data URL (or any image URL the page\nmay read) to show a saved signature in Draw mode; set it to `''` to clear both modes."},{"attribute":"mode","property":"mode","type":"'draw' | 'type'","default":"'draw'","description":"The selected tab: `draw` (pointer, touch, pen) or `type` (keyboard). Each keeps its own signature."},{"attribute":"typed-name","property":"typedName","type":"string","default":"''","description":"The name typed in Type mode. Set it to prefill the box with the signer's name."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Shows a red asterisk and blocks form submission until something is signed."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"_announce","property":"_announce"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"empty","type":"boolean","description":"True when the current mode has nothing signed: no strokes (or saved image) in Draw, no text in Type."}],"methods":[{"name":"toDataURL","description":"The signature as a PNG data URL: black ink on transparent at 2x the pad's size, cropped to the ink with 8px\n(16 image pixels) around it. Empty string when nothing is signed."},{"name":"toBlob","description":"The same PNG as `toDataURL()` as a Blob, for uploading. `null` when nothing is signed."},{"name":"clear","description":"Removes the current mode's signature (Draw: every stroke and any saved image; Type: the text)."},{"name":"undo","description":"Removes the last stroke in Draw mode (then the saved image, if one was loaded)."}],"slots":[],"events":[{"name":"cm-change","description":"After a stroke is finished, Undo, Clear, a switch between Draw and Type, or typing stops for 400ms. `detail`: `{ value, empty, mode }`. A plain `change` event (no detail) follows it, for code that treats every form field alike."},{"name":"change"}],"parts":[],"examples":[{"title":"Sign now dialog","description":"The CRM's e-sign step. The main button stays disabled until something is signed: listen for `change` (or `cm-change`) and read `empty`. Send `toBlob()` to your server, or submit `value`.","html":"<cm-button variant=\"primary\" data-opens=\"sign-now\">Sign now</cm-button>\n<cm-modal id=\"sign-now\" heading=\"Sign quote Q-1042\">\n <div style=\"display:grid;gap:var(--cm-space-16)\">\n <p style=\"margin:0\">By signing, you accept quote Q-1042 for ₹48,500.</p>\n <cm-signature-field name=\"signature\" label=\"Your signature\" required onchange=\"this.closest('cm-modal').querySelector('[data-sign]').disabled = this.empty\"></cm-signature-field>\n </div>\n <cm-button slot=\"footer\">Cancel</cm-button>\n <cm-button slot=\"footer\" variant=\"primary\" data-sign disabled>Sign and accept</cm-button>\n</cm-modal>"},{"title":"Required in a form","description":"Form-associated: submits the PNG data URL under `name`, and `required` blocks submission until something is signed (drawn or typed). Reset clears it.","html":"<form class=\"stack\" style=\"max-width:560px\" onsubmit=\"event.preventDefault(); const d = new FormData(this); this.querySelector('output').textContent = 'Submitted: ' + d.get('signer') + ', signature PNG of ' + Math.ceil(d.get('signature').length * 0.75 / 1024) + ' KB'\">\n <cm-text-field name=\"signer\" label=\"Full name\" value=\"Asha Rao\" required></cm-text-field>\n <cm-signature-field name=\"signature\" label=\"Signature\" required help-text=\"Draw your signature, or choose Type to type your name.\"></cm-signature-field>\n <div class=\"row\">\n <cm-button type=\"reset\">Reset</cm-button>\n <cm-button type=\"submit\" variant=\"primary\">Submit</cm-button>\n </div>\n <output></output>\n</form>"},{"title":"Typed signature","description":"`mode=\"type\"` opens on Type; `typed-name` prefills the box, for example with the signer's name from the record. Typing is the way to sign with a keyboard or a screen reader. The font is Dancing Script (Latin letters); other scripts use the system's cursive font.","html":"<cm-signature-field name=\"signature\" label=\"Signature\" mode=\"type\" typed-name=\"Asha Rao\"></cm-signature-field>"},{"title":"The exported image","description":"What `value` holds after each change: a PNG cropped to the ink, black on transparent in the light and dark theme. It is shown here on white, as it would be on a document.","html":"<div class=\"stack\" style=\"gap:var(--cm-space-16)\">\n <cm-signature-field label=\"Signature\" onchange=\"const img = this.nextElementSibling; img.hidden = this.empty; img.src = this.value || ''\"></cm-signature-field>\n <img alt=\"Exported signature\" hidden style=\"justify-self:start;max-width:100%;height:80px;background:white;border:1px dashed var(--cm-border-input)\">\n</div>"}],"do":["Say what the signer agrees to right above the field (the quote, the amount, the terms), and name the main button after it: \"Sign and accept\".","Keep both Draw and Type: typing is the accessible way to sign, and many signers prefer it on a laptop.","Store the PNG with who signed, when, and what they signed; the image alone is not proof.","Load `fonts.css` on signing pages, so typed signatures use the handwriting font."],"dont":["Don't prefill `typed-name` and submit without the signer acting: prefill only to save typing, and make them press the sign button.","Don't put the pad in a scrolling area that is too small to draw in: on phones, give it the full width.","Don't recolour or invert the exported image for the dark theme: it is meant for light documents."],"content":["Label it \"Signature\" or \"Your signature\".","Help text says what signing means in one sentence: \"By signing, you accept the quote.\""],"accessibility":["Draw and Type are a real `tablist`: one tab stop, ArrowLeft/ArrowRight (mirrored in right-to-left text), Home and End move and select; each tab controls its `tabpanel`. The tab list is named by the label (or the element's `aria-label`, else \"How to sign\").","The drawing area is a canvas with `role=\"img\"`, named \"Signature drawing area\" (\"…, signed\" once drawn) and described by the instructions: \"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.\" Its panel takes focus so screen reader users hear this.","Type is the keyboard and screen reader path: a text box named \"<label>: Type your full name\", with `autocomplete=\"name\"`.","Undo (\"Undo last stroke\") and Clear (\"Clear signature\") are native buttons, disabled while there is nothing to undo or clear; when the one with focus becomes disabled, focus moves to the selected tab (or the text box). \"Last stroke removed\" and \"Signature cleared\" are announced in a polite status region.","Ink is `text-default` on `bg-surface` (AA in both themes); the pad outline is `border-input`, critical with an `error`. The exported image is always black on transparent.","Form-associated like Text field: `required` gives \"Please sign here.\", `error` sets a custom error (announced, `aria-invalid` on the text box), a disabled `<fieldset>` disables it, `form.reset()` clears it.","`touch-action: none` on the canvas, so drawing on a phone doesn't scroll the page. Only the first finger draws; right-clicks are ignored.","No Figma design exists for this component; it follows the Text field and Status tabs styles."],"responsive":["Fills the width of its container; the pad keeps a 3:1 shape (about 96px tall in a 288px column, 200px at 600px).","When the pad is resized (rotating a phone, a panel opening) the signature is drawn again from its strokes at the new size, so it stays sharp and in place.","Draw / Type and Undo / Clear share one row and wrap onto two when they don't fit."],"related":["text-field","modal","file-upload"]},{"tag":"cm-option-group","slug":"option-group","name":"Option group","react":"OptionGroup","group":"Forms","summary":"Switches a form between a few types, with one always selected.","lead":"A row of 36px outlined buttons under a field-style label. The selected one is black. It works like a radio group, so it suits choices that change which fields follow, such as the offer type.","docs_url":"https://commmerce.com/commmerceui/#components--option-group","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Heading above the options, e.g. \"Select offer type\". Without one, give the element an `aria-label`."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the selected option; empty when nothing is selected."},{"attribute":"options","property":"options","type":"Array<string | OptionGroupOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, tone }`. Used instead of `<option>` children when set."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks every option. Also set by a disabled `<fieldset>`."},{"attribute":"_slotted","property":"_slotted","type":"OptionGroupOption[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"OptionGroupOption[]","description":"The options in use, normalised."}],"methods":[{"name":"focus","description":"Focuses the selected option, or the first one."}],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements. `disabled`, `selected` and `tone` (`success`, `critical`) are honoured."}],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the merchant picks a different option."}],"parts":[],"examples":[{"title":"Offer type","html":"<cm-option-group name=\"offer\" label=\"Select offer type\">\n <option value=\"orders\" selected>Orders over</option>\n <option value=\"categories\">Categories</option>\n <option value=\"product\">Specific product</option>\n <option value=\"product-group\">Product group</option>\n <option value=\"customer-group\">Customer group</option>\n</cm-option-group>"},{"title":"Without a heading","description":"When the card title already asks the question, name the group with `aria-label`.","html":"<cm-option-group name=\"discount\" aria-label=\"Discount type\">\n <option value=\"percent\" selected>Percentage</option>\n <option value=\"flat\">Flat amount</option>\n</cm-option-group>"},{"title":"Visit outcome (tones)","description":"Since 1.3. `tone=\"success\"` or `tone=\"critical\"` on an option (or `tone` in `options`) colours it by the outcome it records, with the same colours as Button tones: outlined in the tone, filled in it once selected. The label still says what it means; use tones only for clearly good or bad outcomes and leave the rest plain.","html":"<cm-option-group name=\"outcome\" label=\"Visit outcome\">\n <option value=\"pitched\">Pitched</option>\n <option value=\"demo\">Demo done</option>\n <option value=\"signed_up\" tone=\"success\">Signed up</option>\n <option value=\"not_interested\" tone=\"critical\">Not interested</option>\n <option value=\"later\">Visit again later</option>\n</cm-option-group>"},{"title":"Disabled option","html":"<cm-option-group name=\"delivery\" label=\"Delivery\">\n <option value=\"ship\" selected>Ship to customer</option>\n <option value=\"pickup\">Store pickup</option>\n <option value=\"local\" disabled>Local delivery</option>\n</cm-option-group>"}],"do":["Use it for two to six short options that switch what the rest of the form asks.","Pre-select the most common option, so one is always selected.","Keep labels to one to three words so the row fits."],"dont":["Don't use it for actions: use buttons.","Don't use it to filter a list or switch a view: use a Segmented control or Status tabs.","Don't use it for long or many options: use a select."],"content":["The heading asks the question: \"Select offer type\".","Option labels are short nouns in sentence case."],"accessibility":["A `radiogroup` of `radio` buttons named by the heading.","Tones (since 1.3) never carry meaning on their own: the label says what the outcome is, and selected options are filled while the others are outlined, in every tone. They use the same token pairs as Button tones (4.5:1 or more for text, 3:1 for outlines, in light and dark); disabled options look the same with or without a tone.","One tab stop on the selected option; arrow keys move and select (skipping disabled options, wrapping at the ends), Home and End jump, Space or Enter selects.","Form-associated: submits the selected `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice.","Unselected options are white with a `border-input` outline (3:1 or more), like fields. On phones the buttons wrap; use a `cm-select` yourself if a phone layout needs one row."],"responsive":["Options wrap onto more lines when they don't fit.","Options are 36px tall with 14px text and 8px apart at every width; on touch screens they are 44px tall."],"related":["radio","select","segmented-control"]},{"tag":"cm-segmented-control","slug":"segmented-control","name":"Segmented control","react":"SegmentedControl","group":"Forms","summary":"Switches between two to four views or filters of the same content, right away.","lead":"Two to four options side by side in one grey track; the selected one is white with an outline. Use it for view switches such as Open / Done or Board / List, where picking an option changes what is shown at once. It is an Option group with a compact look, so it has the same keyboard, events and form behaviour. Two sizes: `default` 36px, the height of buttons beside it, and `small` 32px for toolbars, filter rows and card headers. Since 1.5.","docs_url":"https://commmerce.com/commmerceui/#components--segmented-control","properties":[{"attribute":"size","property":"size","type":"'default' | 'small'","default":"'default'","description":"`default`: a 36px track, the height of buttons and fields beside it. `small`: 32px, for toolbars, filter rows and\ncard headers next to small fields and slim buttons. On touch screens both are 44px tall."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Heading above the options, e.g. \"Select offer type\". Without one, give the element an `aria-label`."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the selected option; empty when nothing is selected."},{"attribute":"options","property":"options","type":"Array<string | OptionGroupOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, tone }`. Used instead of `<option>` children when set."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks every option. Also set by a disabled `<fieldset>`."},{"attribute":"_slotted","property":"_slotted","type":"OptionGroupOption[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"OptionGroupOption[]","description":"The options in use, normalised."}],"methods":[{"name":"focus","description":"Focuses the selected option, or the first one."}],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements. `disabled` and `selected` are honoured."}],"events":[{"name":"change","description":"When the merchant picks a different option."},{"name":"input","description":"Same moment as `change`."}],"parts":[],"examples":[{"title":"Open / Done","description":"A filter at the top of a task list. Name the control with `aria-label` when nothing visible labels it.","html":"<cm-segmented-control name=\"state\" aria-label=\"Tasks\" size=\"small\" value=\"open\">\n <option value=\"open\">Open</option>\n <option value=\"done\">Done</option>\n</cm-segmented-control>"},{"title":"Board / List","description":"A view switch. Listen for `change` and swap the view; `value` is the selected option.","html":"<div class=\"stack\">\n <cm-segmented-control aria-label=\"View\" value=\"board\" onchange=\"this.nextElementSibling.textContent = this.value === 'board' ? 'Showing the board' : 'Showing the list'\">\n <option value=\"board\">Board</option>\n <option value=\"list\">List</option>\n </cm-segmented-control>\n <p style=\"margin:0\">Showing the board</p>\n</div>"},{"title":"In a toolbar","description":"With `size=\"small\"` it lines up with a small search, small selects and slim buttons (all 32px).","html":"<div style=\"display:flex;flex-wrap:wrap;gap:8px;align-items:center\">\n <cm-search size=\"small\" label=\"Search deals\" placeholder=\"Search deals\" style=\"flex:1 1 200px;min-width:0\"></cm-search>\n <cm-select size=\"small\" aria-label=\"Owner\" placeholder=\"Owner\"><option value=\"me\">Me</option><option value=\"team\">My team</option></cm-select>\n <cm-segmented-control size=\"small\" aria-label=\"View\" value=\"board\">\n <option value=\"board\">Board</option>\n <option value=\"list\">List</option>\n </cm-segmented-control>\n</div>"},{"title":"With a label","description":"`label` shows a field-style label above the track and names the group.","html":"<cm-segmented-control name=\"period\" label=\"Show\" value=\"week\">\n <option value=\"day\">Day</option>\n <option value=\"week\">Week</option>\n <option value=\"month\">Month</option>\n</cm-segmented-control>"}],"do":["Use it for two to four short options that change what is shown right away, with no Save button.","Always have one option selected: set `value` or mark an `<option selected>`.","Keep the same order everywhere the same switch appears."],"dont":["Don't use it for a setting that is saved with a form: use an Option group.","Don't use it for five or more choices: use a Select.","Don't use it to move between pages or sections with their own address: use Link tabs or Status tabs.","Don't mix it with actions: every option is a view, not a command."],"content":["One or two words per option, in sentence case: \"Open\", \"Done\", \"Board\", \"List\".","Write a text label on every option; don't use icons alone.","Options are parallel: all nouns or all states."],"accessibility":["A `radiogroup` of `radio` buttons named by `label` or the element's `aria-label`.","One tab stop on the selected option; arrow keys move and select (skipping disabled options and wrapping; mirrored in right-to-left text), Home and End jump, Space or Enter selects. Each new choice fires `input` and `change`.","The selected option is shown by a white fill, a `border-input` outline (3:1 or more) and dark text, not by colour alone; unselected options are `text-tertiary` (4.5:1 or more).","At least 44px tall on touch screens (`pointer: coarse`).","Form-associated: submits the selected `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice. Built-in text is in its own `segmentedControl` namespace."],"responsive":["The track is as wide as its options and never wider than its container; a long label is cut short with an ellipsis rather than pushing the page wider.","On touch screens the track is 44px tall at either size."],"related":["option-group","status-tabs","link-tabs","select"]},{"tag":"cm-tag","slug":"tag","name":"Tag","react":"Tag","group":"Forms","summary":"Shows a product tag or an applied filter, with an optional remove button.","lead":"A 24px pill with 12px text and an outline. Removable tags have a small circled × that fires `cm-remove`; your code takes the tag out of the list, for example `tag.addEventListener('cm-remove', () => tag.remove())`, and moves focus to the next tag.","docs_url":"https://commmerce.com/commmerceui/#components--tag","properties":[{"attribute":"removable","property":"removable","type":"boolean","default":"false","description":"Shows the remove button."},{"attribute":"remove-label","property":"removeLabel","type":"string","default":"''","description":"Accessible name of the remove button. Defaults to \"Remove\" plus the tag text."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Hides the remove button's action and dims the tag."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The tag text."}],"events":[{"name":"cm-remove","description":"When the remove button is pressed."}],"parts":[],"examples":[{"title":"Product tags","description":"Tags sit `space-8` apart in both directions.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-tag removable>Karnataka</cm-tag>\n <cm-tag removable>Orange</cm-tag>\n <cm-tag removable>Cotton</cm-tag>\n <cm-tag removable>Summer sale</cm-tag>\n</div>"},{"title":"Applied filters","description":"Name the remove button with what it removes.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-tag removable remove-label=\"Remove filter: Payment status is Paid\">Paid</cm-tag>\n <cm-tag removable remove-label=\"Remove filter: Order type is Store pickup\">Store pickup</cm-tag>\n</div>"},{"title":"Read-only","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-tag>Cotton</cm-tag>\n <cm-tag>Handmade</cm-tag>\n</div>"}],"do":["Keep tag text to one or two words.","After removing a tag, move focus to the next tag or to the field that adds tags, so keyboard users are not lost.","Use `remove-label` when the tag text alone doesn't say what is removed."],"dont":["Don't use tags for status: use a badge.","Don't make tags clickable links; use buttons or links."],"content":["Write tags as the merchant typed them; don't change their case."],"accessibility":["The remove button is a real button, named \"Remove <tag text>\" by default, and reachable with Tab.","Its 20px target, with tags 8px apart, meets the 24px target-spacing rule.","The outline is `border-strong`, which meets 3:1 against the tag fill in both themes."],"responsive":["Tags are 24px tall with a 20px remove button at every width."],"related":["badge","search"]},{"tag":"cm-badge","slug":"badge","name":"Badge","react":"Badge","group":"Feedback","summary":"Shows the status of an order, payment or other object.","lead":"A 24px pill (owner standard, 1.6; 20px in 1.5) with one or two words in sentence case, 12px medium text with tabular numbers. Colour says the kind of status; the words say the status. Since 1.5 the text is shown as written (it used to be upper-cased and letter-spaced).","docs_url":"https://commmerce.com/commmerceui/#components--badge","properties":[{"attribute":"tone","property":"tone","type":"Tone | 'neutral'","default":"'neutral'","description":"Colour and meaning. `neutral` for drafts and other states with no status."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Status text."}],"events":[],"parts":[],"examples":[{"title":"Tones","html":"<div class=\"row\">\n <cm-badge tone=\"information\">Order placed</cm-badge>\n <cm-badge tone=\"success\">Accepted</cm-badge>\n <cm-badge tone=\"critical\">Cancelled</cm-badge>\n <cm-badge tone=\"attention\">New</cm-badge>\n <cm-badge>Draft</cm-badge>\n</div>"},{"title":"Next to a title","description":"Use the card's `title-adornment` slot.","html":"<cm-card heading=\"Order #1042\">\n <cm-badge slot=\"title-adornment\" tone=\"success\">Paid</cm-badge>\n <p style=\"margin:0\">2 items · Rs. 2,340</p>\n</cm-card>"}],"do":["Keep it to one or two words.","Use the same word for the same status everywhere in the admin.","Information is orange and attention is blue in this system: pick the tone by meaning, not by colour."],"dont":["Don't use a badge as a button: it is not interactive.","Don't rely on colour alone: the words must say the status."],"content":["Write in sentence case: \"Order placed\", \"2 h late\". The badge shows the text exactly as written.","Use the state, not an action: \"Paid\", not \"Pay now\"."],"accessibility":["Text colours meet 4.5:1 on their badge fills in both themes.","Not focusable. If the status changes while the page is open, announce it elsewhere (for example with a banner)."],"related":["banner","card"]},{"tag":"cm-card","slug":"card","name":"Card","react":"Card","group":"Layout","summary":"Groups related content and actions into a section of the page.","lead":"The white section container every admin page is built from: flat, with a 1px `border-subtle` edge, 8px corners and no shadow. The heading is 16px semibold, the description 13px grey. Three variants (owner standard, 1.6): `standard` (default) is padded 24px with 16px between header and body, `compact` 16px and 12px (dashboards, task summaries, metrics), and `interactive` makes the whole card a link (`href`) or a button (`cm-action`) with hover, pressed, focus and `selected` states. On phones every card is padded 16px. With `flush` the body starts 8px under the heading, so a list sits right under it.","docs_url":"https://commmerce.com/commmerceui/#components--card","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Card title, rendered as a heading at `heading-level`."},{"attribute":"description","property":"description","type":"string","default":"''","description":"One sentence under the title, 13px in text-tertiary."},{"attribute":"flush","property":"flush","type":"boolean","default":"false","description":"Removes body padding, for lists and tables that run edge to edge."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level for the title, so pages keep a correct outline. Default 2."},{"attribute":"variant","property":"variant","type":"'standard' | 'compact' | 'interactive' | 'interactive compact' | 'compact interactive'","default":"'standard'","description":"`standard` (default: 24px padding), `compact` (16px padding, for dashboards, task summaries and metrics) or\n`interactive` (the whole card is a link or button, with hover, pressed, focus and selected states). Combine\nwith a space, e.g. `interactive compact`. Phones always get 16px padding. Since 1.6."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Interactive cards: the address the card opens. Without it the card is a button that fires `cm-action`. Since 1.6."},{"attribute":"target","property":"target","type":"string","default":"''","description":"Link target when `href` is set. `_blank` adds `rel=\"noopener noreferrer\"`. Since 1.6."},{"attribute":"selected","property":"selected","type":"boolean","default":"false","description":"Interactive cards: shows the card as chosen (a 2px dark outline). A button card reports it as pressed, a link card as the current one. Since 1.6."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Interactive cards without a `heading`: the accessible name of the card's link or button. Since 1.6."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Body."},{"name":"actions","description":"Header actions (buttons, links), at the end of the header. Since 1.3 they also show on a card with no `heading` or `description`, in a row of their own at the top of the card."},{"name":"title-adornment","description":"Badge or icon next to the title."}],"events":[{"name":"cm-action","description":"An interactive card without `href` was pressed (click, Enter or Space). Not fired by the header actions. Since 1.6."}],"parts":[],"examples":[{"title":"Basic","html":"<cm-card heading=\"Pricing\">\n <div class=\"stack\">\n <cm-text-field label=\"Price\" hint=\"rs.\" type=\"number\" value=\"1299\"></cm-text-field>\n <cm-text-field label=\"Compare-at price\" hint=\"rs.\" type=\"number\"></cm-text-field>\n </div>\n</cm-card>"},{"title":"Description and actions","html":"<cm-card heading=\"Shipping\" description=\"How this product is weighed and shipped.\">\n <cm-button slot=\"actions\" size=\"slim\">Edit</cm-button>\n <p style=\"margin:0\">0.4 kg · Ships from Bengaluru warehouse</p>\n</cm-card>"},{"title":"Badges next to the heading","description":"Put counts or a status in the `title-adornment` slot. On a narrow card (try a phone) the badges move under the heading so it is never squeezed, and the actions move under the title only if the heading would have less than about 12 characters of room.","html":"<cm-card heading=\"Partner tasks\" heading-level=\"3\" style=\"max-width:390px\">\n <cm-badge slot=\"title-adornment\" tone=\"critical\">1 overdue</cm-badge>\n <cm-badge slot=\"title-adornment\" tone=\"attention\">2 today</cm-badge>\n <cm-badge slot=\"title-adornment\">4 later</cm-badge>\n <cm-button slot=\"actions\" size=\"slim\">View all</cm-button>\n <p style=\"margin:0\">Call back Priya S. about the bulk order</p>\n</cm-card>"},{"title":"Compact","description":"`variant=\"compact\"`: 16px padding, for dashboards, task summaries and metrics. Since 1.6.","html":"<div class=\"row\" style=\"align-items:stretch\">\n <cm-card variant=\"compact\" heading=\"Due today\" style=\"flex:1 1 160px\"><cm-metric label=\"Open\" value=\"12\"></cm-metric></cm-card>\n <cm-card variant=\"compact\" heading=\"Overdue\" style=\"flex:1 1 160px\"><cm-metric label=\"Open\" value=\"3\"></cm-metric></cm-card>\n</div>"},{"title":"Interactive","description":"`variant=\"interactive\"`: the whole card opens something. With `href` the heading is a link stretched over the card; without it the card is a button that fires `cm-action` (Enter and Space work too). `selected` draws a 2px outline and is announced (pressed for a button card, current for a link card). Header actions stay separately clickable; keep other controls out of the body. Combine with compact: `variant=\"interactive compact\"`. Since 1.6.","html":"<div class=\"row\" style=\"align-items:stretch\">\n <cm-card variant=\"interactive compact\" heading=\"Monthly plan\" selected style=\"flex:1 1 180px\">Rs. 499 a month</cm-card>\n <cm-card variant=\"interactive compact\" heading=\"Yearly plan\" style=\"flex:1 1 180px\">Rs. 4,990 a year</cm-card>\n <cm-card variant=\"interactive compact\" heading=\"Renewals\" href=\"#/components/card\" style=\"flex:1 1 180px\">8 renewals this month</cm-card>\n</div>"},{"title":"Flush","description":"`flush` removes the body padding for lists and tables that run edge to edge.","html":"<cm-card heading=\"Recent orders\" flush>\n <ul style=\"list-style:none;margin:0;padding:0\">\n <li style=\"display:flex;justify-content:space-between;padding:12px 20px;border-top:1px solid var(--cm-border-subtle)\">#1042 · Priya S. <cm-badge tone=\"success\">Paid</cm-badge></li>\n <li style=\"display:flex;justify-content:space-between;padding:12px 20px;border-top:1px solid var(--cm-border-subtle)\">#1041 · Rahul M. <cm-badge tone=\"information\">Order placed</cm-badge></li>\n </ul>\n</cm-card>"},{"title":"Actions without a heading","description":"Since 1.3, the `actions` slot also shows on a card with no `heading` or `description`: the actions sit in a row of their own at the top, at the end. (Before 1.3 they were not shown at all.) With a heading, the header is unchanged.","html":"<cm-card style=\"max-width:480px\">\n <cm-button slot=\"actions\" size=\"slim\">Edit shipping</cm-button>\n <p style=\"margin:0\">0.4 kg · Ships from Bengaluru warehouse</p>\n</cm-card>"}],"do":["Give every card a heading unless it is the only thing on the page.","Set `heading-level` so the page outline makes sense (2 under the page title, 3 inside a section).","Stack cards `space-24` apart (the `cm-layout-section` default since 1.6).","Use `variant=\"compact\"` for dashboard tiles and summaries, the standard card for forms and details."],"dont":["Don't nest cards inside cards: use `bg-inset` panels instead.","Don't put more than two actions in the header."],"content":["Headings are short nouns: \"Pricing\", \"Shipping\", \"Variants\".","The description is one sentence in plain language."],"accessibility":["The heading is exposed with `role=\"heading\"` and `aria-level`, so screen-reader users can jump between cards.","The card is a labelled region named by its heading. An interactive card is not a region: it is one link or button, named by its heading (or `label` when it has none), with a 2px focus ring around the whole card.","A card without a heading is not a named region: if its actions need context (\"Edit\" what?), name them, e.g. `aria-label=\"Edit shipping\"` on the button."],"responsive":["Follows the card's own width, not the window. When the heading and its `title-adornment` don't fit on one line, the adornment moves under the heading instead of squeezing it (since 1.2).","The header actions stay beside the title while the heading keeps about 12 characters of room (or its whole text, if shorter); below that they move under the title. Wide cards keep everything on one row."],"related":["badge","button"]},{"tag":"cm-page","slug":"page","name":"Page","react":"Page","group":"Layout","summary":"Wraps a whole admin page: the page header, then the content on the page background.","lead":"The outermost element of a screen. The page header runs edge to edge across the top; the content sits on `bg-page` with `space-24` padding (`space-16` when the page is 640px wide or less), so it lines up with the page header's title, centred at the width you choose with `width`. Inside `cm-app-frame panel` the background is transparent, so the page sits on the white panel.","docs_url":"https://commmerce.com/commmerceui/#components--page","properties":[{"attribute":"width","property":"width","type":"'' | 'form' | 'detail' | 'wide' | 'full'","default":"''","description":"Largest width of the content, centred: `form` (640px), `detail` (1040px), `wide` (1600px) or `full` (no limit).\nEmpty is `wide`, unless `narrow` or `full-width` is set."},{"attribute":"full-width","property":"fullWidth","type":"boolean","default":"false","description":"Same as `width=\"full\"`: the content uses every pixel of width (wide tables, reports)."},{"attribute":"narrow","property":"narrow","type":"boolean","default":"false","description":"Content at most 800px wide, centred. Kept from 1.0; prefer `width=\"form\"` (640px) or `width=\"detail\"` (1040px)."}],"script_properties":[],"methods":[],"slots":[{"name":"header","description":"A `cm-page-header`. Runs edge to edge."},{"name":"(default)","description":"The page content, usually a `cm-layout`."},{"name":"footer","description":"A `cm-save-bar` or `cm-action-bar`, after the content."}],"events":[],"parts":[],"examples":[{"title":"Page anatomy","description":"Every page has the same order: the header (the title, with the primary action at the end), then a filter or toolbar row, then the content. Pick the width by what the page holds: `width=\"form\"` (640px) for settings and single-column forms, `width=\"detail\"` (1040px) for one record such as an order or a customer, the default `wide` (1600px) for lists and dashboards, and `width=\"full\"` for wide tables and reports.","html":"<cm-page width=\"detail\">\n <cm-page-header slot=\"header\" heading=\"Orders\">\n <cm-button slot=\"actions\" variant=\"primary\">Create order</cm-button>\n </cm-page-header>\n <cm-status-tabs aria-label=\"Order status\" style=\"margin-bottom:var(--cm-space-16)\">\n <option value=\"all\" count=\"233\">All</option>\n <option value=\"open\" count=\"23\" selected>Open</option>\n <option value=\"done\" count=\"210\">Done</option>\n </cm-status-tabs>\n <cm-card heading=\"Open orders\" flush>\n <cm-resource-list selectable resource-name=\"order\">\n <cm-resource-item value=\"o1\">#1042 · Priya S.</cm-resource-item>\n <cm-resource-item value=\"o2\">#1041 · Rahul M.</cm-resource-item>\n </cm-resource-list>\n </cm-card>\n</cm-page>"},{"title":"Detail page","description":"Page header, then a layout with a main and a side column. This is the shape of every detail page. The columns stack here because the example frame is narrower than 768px.","html":"<cm-page>\n <cm-page-header slot=\"header\" heading=\"Order #1042\" breadcrumbs='[{\"label\":\"Orders\",\"href\":\"#/components/page\"}]'>\n <cm-button slot=\"actions\" variant=\"primary\">Fulfil items</cm-button>\n </cm-page-header>\n <cm-layout>\n <cm-layout-section variant=\"two-thirds\">\n <cm-card heading=\"Items\">2 items · Rs. 2,340</cm-card>\n <cm-card heading=\"Payment\">Paid by UPI</cm-card>\n </cm-layout-section>\n <cm-layout-section variant=\"one-third\">\n <cm-card heading=\"Customer\">Priya S.</cm-card>\n </cm-layout-section>\n </cm-layout>\n</cm-page>"},{"title":"Form width","description":"`width=\"form\"` keeps settings and single-column forms at a readable 640px.","html":"<cm-page width=\"form\">\n <cm-page-header slot=\"header\" heading=\"Store details\"></cm-page-header>\n <cm-card heading=\"Contact\">\n <cm-stack>\n <cm-text-field label=\"Store name\" value=\"Ananya Handlooms\"></cm-text-field>\n <cm-text-field label=\"Support email\" type=\"email\"></cm-text-field>\n </cm-stack>\n </cm-card>\n</cm-page>"}],"do":["Use one `cm-page` per screen, with one page header.","Set `width`: `form` for settings forms, `detail` for one record, `full` for wide tables and reports; leave it empty for lists and dashboards.","Put a save bar or action bar in the `footer` slot, or anywhere on the page: both stick to the bottom."],"dont":["Don't add your own page padding or background around it.","Inside the admin, don't add a header bar or side navigation: the admin draws them around your app."],"content":["The page title in the header names the record or list: \"Order #1042\", \"Products\"."],"accessibility":["Put the page header first so the page title is the first heading.","The content keeps its source order on every width."],"responsive":["Content is centred, at most as wide as `width` says: `form` 640px, `detail` 1040px, `wide` (the default) 1600px, `full` no limit. `narrow` (800px) and `full-width` from 1.0 still work.","Follows the page's own width, not the window: at 640px or narrower the padding around the content drops from `space-24` (24px) to `space-16` (16px)."],"related":["page-header","layout","card"]},{"tag":"cm-layout","slug":"layout","name":"Layout","react":"Layout","group":"Layout","summary":"Arranges a page into columns: a main column and a side column, halves, or full-width rows.","lead":"A six-track grid of `cm-layout-section`s: `two-thirds` and `one-third` for detail pages, `one-half` for two equal columns, `full` (default) across the page. Sections are 24px apart and each stacks its cards `space-24` apart (owner standard, 1.6; was `space-20`). When the layout itself is narrower than 768px, every section goes full width, in source order. `variant=\"record\"` (since 1.7) is the standard record page: a main column and a 320px `aside` section, see Record page.","docs_url":"https://commmerce.com/commmerceui/#components--layout","properties":[{"attribute":"gap","property":"gap","type":"SpaceStep","default":"'24'","description":"Space between sections, across and down: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `24` (owner standard, 1.6: 24px between page sections; was 20).\nIn a record layout the default `24` becomes `16` once the layout is 640px wide or less."},{"attribute":"variant","property":"variant","type":"'default' | 'record' | 'sidebar'","default":"'default'","description":"`default`: a six-track grid for `full`, `one-half`, `one-third` and `two-thirds` sections.\n`record` (since 1.7): a main column and a 320px `aside` section on the end side from 880px (a 1280px laptop window with the side navigation gives about 950px); see the element description."},{"attribute":"aside-position","property":"asidePosition","type":"'above' | 'below'","default":"'above'","description":"Record layout: where the aside goes once the columns stack (below 880px), `above` the main content (default) or `below` it. Since 1.7."},{"attribute":"sticky-aside","property":"stickyAside","type":"boolean","default":"false","description":"Record layout: the aside stays in view below the header while the main column scrolls, as long as the whole aside\nfits in the window (a taller aside scrolls with the page, so nothing in it is out of reach). Only while the\ncolumns are side by side. Since 1.7."}],"script_properties":[{"property":"asideSticks","description":"Whether the aside currently sticks (`sticky-aside` is on and the whole aside fits in the window). For tests and debugging."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-layout-section` elements."}],"events":[],"parts":[{"tag":"cm-layout-section","react":"LayoutSection","properties":[{"attribute":"variant","property":"variant","type":"'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside' | 'sidebar'","default":"'full'","description":"Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a\n`two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.\n`aside` (since 1.7) is the 320px side column of a `cm-layout variant=\"record\"`; in other layouts it is `one-third`.\n`sidebar` (since 1.8.2) is the 240px start column of a `cm-layout variant=\"sidebar\"`."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The section's content, usually cards."}],"events":[]}],"examples":[{"title":"Main and side columns","html":"<cm-layout>\n <cm-layout-section variant=\"two-thirds\">\n <cm-card heading=\"Details\">Title, description</cm-card>\n <cm-card heading=\"Pricing\">Price, compare-at price</cm-card>\n </cm-layout-section>\n <cm-layout-section variant=\"one-third\">\n <cm-card heading=\"Status\">Active</cm-card>\n </cm-layout-section>\n</cm-layout>"},{"title":"Halves, then a full row","html":"<cm-layout>\n <cm-layout-section variant=\"one-half\"><cm-card heading=\"Online store\">Rs. 48,200 this week</cm-card></cm-layout-section>\n <cm-layout-section variant=\"one-half\"><cm-card heading=\"Stores\">Rs. 1,12,900 this week</cm-card></cm-layout-section>\n <cm-layout-section><cm-card heading=\"Recent orders\">12 orders today</cm-card></cm-layout-section>\n</cm-layout>"},{"title":"Record page: main column and 320px aside","description":"`variant=\"record\"` with one main section and one `variant=\"aside\"` section. From 880px of the layout's own width the aside is a 320px column on the end side; narrower, it stacks above the main content (`aside-position=\"below\"` puts it under). `sticky-aside` keeps a short aside in view while the main column scrolls. Since 1.7.","html":"<cm-layout variant=\"record\" sticky-aside>\n <cm-layout-section variant=\"aside\">\n <cm-info-panel heading=\"Details\" variant=\"compact\" layout=\"rows\">\n <cm-info-item label=\"Email\"><a href=\"mailto:asha@example.com\">asha@example.com</a></cm-info-item>\n <cm-info-item label=\"Phone\">+91 98450 12345</cm-info-item>\n <cm-info-item label=\"Company\">Rao Textiles</cm-info-item>\n </cm-info-panel>\n </cm-layout-section>\n <cm-layout-section>\n <cm-card heading=\"Activity\">Called on 14 Nov: interested in the Growth plan.</cm-card>\n <cm-card heading=\"Deals\" variant=\"compact\">\n <cm-empty-state size=\"inline\" heading=\"No deals yet\" action=\"Add deal\"></cm-empty-state>\n </cm-card>\n </cm-layout-section>\n</cm-layout>"}],"do":["Put what customers see (details, media, pricing) in the main column and settings and summaries in the side column.","Put the main section first in the source: it comes first when the columns stack.","Fill a row: `two-thirds` + `one-third`, two `one-half`, or one `full`.","Record layout: put the sections in the source in their stacked order: the aside first with the default `aside-position=\"above\"`, the main section first with `below`. On wide layouts the aside moves to the end column wherever it is in the source.","Use `variant=\"record\"` for every record (lead, contact, deal, account, ticket, order, product) so they all look and behave the same."],"dont":["Don't nest layouts: use a grid inside a card for fields side by side.","Don't reorder sections with CSS: keyboard and screen-reader order would no longer match what is seen.","Don't put more than one main and one aside section in a record layout: the aside sits beside the first row only."],"content":[],"accessibility":["Default layouts never change order, so reading and Tab order follow the page on every width.","A record layout moves only the aside, as one block: on wide layouts to the end column, stacked to wherever `aside-position` says. Matching the source order to the stacked order keeps phones (where order matters most) exactly in reading order.","A sticky aside sticks only while it fits in the window, so every part of it can still be scrolled to and nothing is covered at 200% zoom.","The layout adds no landmarks or headings: your cards carry the headings."],"responsive":["Follows the layout's own width, not the window: below 768px every section takes the full width and they stack in source order. From 768px, `one-half`, `one-third` and `two-thirds` sections sit side by side.","`variant=\"record\"`: from 880px of the layout's own width the aside is a 320px column on the end side; narrower, the sections stack with the aside above the main content (or below it with `aside-position=\"below\"`), 24px apart, 16px once the layout is 640px wide or less. Inside a `cm-page` the layout is 48px narrower than the window (32px on phones), so an 880px window stacks; a 1024px window (976px of layout) keeps the aside beside the content."],"related":["page","grid","card"]},{"tag":"cm-stack","slug":"stack","name":"Stack","react":"Stack","group":"Layout","summary":"Spaces items evenly in a column or a row, using the spacing scale.","lead":"A column (default) or a row (`direction=\"inline\"`) of items `gap` apart. `gap` takes a spacing step: `0`, `10`, `12`, `15`, `20` (default), `22` or `30`. Rows can wrap, align and spread their items. The items stay in your page, so your styles and forms work as usual.","docs_url":"https://commmerce.com/commmerceui/#components--stack","properties":[{"attribute":"direction","property":"direction","type":"'block' | 'inline'","default":"'block'","description":"`block` stacks top to bottom; `inline` lays items out in a row (right to left in RTL pages)."},{"attribute":"gap","property":"gap","type":"SpaceStep","default":"'20'","description":"Space between items: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`, the gap between cards."},{"attribute":"align","property":"align","type":"'start' | 'center' | 'end' | 'stretch' | 'baseline' | undefined","description":"Cross-axis alignment. Default `stretch` in a column and `center` in a row."},{"attribute":"justify","property":"justify","type":"'start' | 'center' | 'end' | 'space-between' | undefined","description":"Main-axis distribution. `space-between` pushes the first and last items to the edges."},{"attribute":"wrap","property":"wrap","type":"boolean","default":"false","description":"Lets a row wrap onto more lines when it runs out of space."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The items to stack."}],"events":[],"parts":[],"examples":[{"title":"Fields in a card","description":"`space-16` between fields, as in the product editor.","html":"<cm-card heading=\"Details\" style=\"max-width:520px\">\n <cm-stack gap=\"32\">\n <cm-text-field label=\"Title\" placeholder=\"Short sleeve t-shirt\"></cm-text-field>\n <cm-text-field label=\"Description\" multiline rows=\"3\"></cm-text-field>\n </cm-stack>\n</cm-card>"},{"title":"Buttons in a row","html":"<cm-stack direction=\"inline\" gap=\"8\" wrap>\n <cm-button>Export</cm-button>\n <cm-button>Import</cm-button>\n <cm-button variant=\"primary\">Add product</cm-button>\n</cm-stack>"},{"title":"Spread across a row","html":"<cm-stack direction=\"inline\" justify=\"space-between\">\n <span>Subtotal</span>\n <strong>Rs. 2,340</strong>\n</cm-stack>"}],"do":["Use the default `20` between cards, `30` between fields in a card, `10` between buttons.","Use `wrap` on rows of buttons or tags so they never overflow on phones."],"dont":["Don't add margins to the items: the gap does the spacing.","Don't use a stack for a table-like layout: use a grid."],"content":[],"accessibility":["Order on screen is the order in the source."],"related":["grid","layout"]},{"tag":"cm-grid","slug":"grid","name":"Grid","react":"Grid","group":"Layout","summary":"Puts items in equal columns, for fields side by side, tiles and summary cards.","lead":"`columns` equal columns (default 2) that become one column when the grid is 640px wide or less, or with `min-column-width`, as many columns as fit, each at least that wide. `gap` takes a spacing step (default `20`).","docs_url":"https://commmerce.com/commmerceui/#components--grid","properties":[{"attribute":"columns","property":"columns","type":"number","default":"2","description":"Number of columns. Default 2. Ignored when `min-column-width` is set."},{"attribute":"min-column-width","property":"minColumnWidth","type":"string | undefined","description":"Fit as many columns as there is room for, each at least this wide (a CSS length such as `240px` or `15rem`).\nNever wider than the grid, so it reaches one column on its own on narrow screens."},{"attribute":"gap","property":"gap","type":"SpaceStep","default":"'20'","description":"Space between items: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The grid items, in reading order."}],"events":[],"parts":[],"examples":[{"title":"Fields side by side","description":"Two columns while the grid is wider than 640px; one column below that (try Phone).","html":"<cm-card heading=\"Pricing\" style=\"max-width:760px\">\n <cm-grid columns=\"2\">\n <cm-text-field label=\"Price\" hint=\"rs.\" type=\"number\"></cm-text-field>\n <cm-text-field label=\"Compare-at price\" hint=\"rs.\" type=\"number\"></cm-text-field>\n </cm-grid>\n</cm-card>"},{"title":"As many as fit","description":"`min-column-width=\"200px\"`: resize the example to see columns come and go. A row of totals is a grid of Metric tiles.","html":"<cm-grid min-column-width=\"200px\">\n <cm-metric label=\"Orders\" value=\"128\"></cm-metric>\n <cm-metric label=\"Sales\" value=\"Rs. 2,41,000\"></cm-metric>\n <cm-metric label=\"Visitors\" value=\"3420\"></cm-metric>\n <cm-metric label=\"Returns\" value=\"4\"></cm-metric>\n</cm-grid>"}],"do":["Use two columns for pairs of short fields (price and compare-at price, city and PIN code).","Use `min-column-width` for tiles, so the count follows the space."],"dont":["Don't put long text fields side by side: give them the full width.","Don't place a grid inside a horizontal stack: it needs a width to work out its columns."],"content":[],"accessibility":["Items read left to right, then down, the same as the source order."],"responsive":["Follows the grid's own width, not the window: with `columns`, a grid 640px wide or narrower shows one column.","With `min-column-width`, it fits as many columns of at least that width as there is room for (never wider than the grid itself), at any width."],"related":["stack","layout","metric"]},{"tag":"cm-banner","slug":"banner","name":"Banner","react":"Banner","group":"Feedback","summary":"Tells merchants about something important on the page or in their store.","lead":"A full-width message with a tone, an optional heading and actions. Critical banners are announced immediately.","docs_url":"https://commmerce.com/commmerceui/#components--banner","properties":[{"attribute":"tone","property":"tone","type":"Tone","default":"'attention'","description":"attention = blue, information = orange, success = green, critical = red."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Bold first line. Leave empty for one-line banners."},{"attribute":"dismissible","property":"dismissible","type":"boolean","default":"false","description":"Shows a close button. Use for messages the merchant can act on later."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Message body."},{"name":"actions","description":"Buttons or links under the message."}],"events":[{"name":"cm-dismiss","description":"When the close button is pressed (cancelable; default hides the banner)."}],"parts":[],"examples":[{"title":"Tones","html":"<div class=\"stack\" style=\"gap:var(--cm-space-12)\">\n <cm-banner tone=\"attention\" heading=\"Your store is in test mode\">Orders placed now won't be charged.</cm-banner>\n <cm-banner tone=\"information\">GST rates changed on 1 Nov. Check your tax settings.</cm-banner>\n <cm-banner tone=\"success\">Product saved.</cm-banner>\n <cm-banner tone=\"critical\" heading=\"Payment failed\">The card was declined. Ask the customer for another payment method.</cm-banner>\n</div>"},{"title":"With actions","html":"<cm-banner tone=\"attention\" heading=\"Connect a payment provider\">\n You need one before customers can check out.\n <cm-button slot=\"actions\" variant=\"primary\" size=\"slim\">Set up payments</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Learn more</cm-button>\n</cm-banner>"},{"title":"Dismissible","description":"Fires `cm-dismiss`. Call `preventDefault()` on it to keep the banner open, for example to confirm first.","html":"<cm-banner tone=\"information\" dismissible>Your plan renews on 1 Dec.</cm-banner>"}],"do":["Put page-level banners at the top of the page, under the title.","Lead with what happened, then what to do.","Use `critical` only when something has failed or needs action now."],"dont":["Don't stack more than two banners: prioritise.","Don't use a banner for a passing confirmation that needs no action; use an App Bridge toast (`app.toast.show`) when your app runs in the admin."],"content":["Headings are a short statement: \"Payment failed\", not \"Error!\".","Body copy is one or two sentences.","Action labels follow the button rules."],"accessibility":["`critical` uses `role=\"alert\"` and interrupts the screen reader; other tones use `role=\"status\"`.","The dismiss button has an accessible name (\"Dismiss\") and a focus ring.","Text on every banner fill meets 4.5:1 in both themes."],"related":["badge","button"]},{"tag":"cm-icon","slug":"icon","name":"Icon","react":"Icon","group":"Images and icons","summary":"Draws one of the Commmerce line icons.","lead":"Icons inherit the text colour and are decorative unless you give them a label.","docs_url":"https://commmerce.com/commmerceui/#components--icon","properties":[{"attribute":"name","property":"name","type":"IconName","default":"'more'","description":"Icon from"},{"attribute":"size","property":"size","type":"number","default":"18","description":"Pixel size. Header icons are 18, buttons 16."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name. Leave empty when the icon sits next to text that says the same thing."},{"attribute":"mirror","property":"mirror","type":"'auto' | 'always' | 'never'","default":"'auto'","description":"Mirroring in right-to-left text: `auto` mirrors only directional icons, `never` keeps any icon as drawn, `always` mirrors any icon."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Basic","html":"<div class=\"row\">\n <cm-icon name=\"home\"></cm-icon><cm-icon name=\"cart\"></cm-icon><cm-icon name=\"box\"></cm-icon><cm-icon name=\"users\"></cm-icon><cm-icon name=\"chart\"></cm-icon><cm-icon name=\"settings\"></cm-icon>\n</div>"},{"title":"Sizes","description":"Three sizes: 16px inside controls (buttons, fields, menu items), 20px in navigation, 24px for feature icons on their own (empty states, tiles). The tokens are `--cm-icon-size-sm`, `-md` and `-lg`.","html":"<div class=\"row\"><cm-icon name=\"bell\" size=\"16\"></cm-icon><cm-icon name=\"bell\" size=\"18\"></cm-icon><cm-icon name=\"bell\" size=\"24\"></cm-icon><cm-icon name=\"bell\" size=\"32\"></cm-icon></div>"},{"title":"Colour","description":"Set `color` on the icon or its parent. Use the icon tokens.","html":"<div class=\"row\">\n <cm-icon name=\"check-circle\" size=\"24\" style=\"color:var(--cm-icon-success)\"></cm-icon>\n <cm-icon name=\"x-circle\" size=\"24\" style=\"color:var(--cm-icon-critical)\"></cm-icon>\n <cm-icon name=\"clock\" size=\"24\" style=\"color:var(--cm-icon-default)\"></cm-icon>\n</div>"},{"title":"Meaningful icon","description":"When the icon is the only thing that carries the meaning, give it a `label`.","html":"<span style=\"display:inline-flex;align-items:center;gap:8px\">Stock <cm-icon name=\"alert\" label=\"Low stock\" style=\"color:var(--cm-icon-critical)\"></cm-icon></span>"}],"do":["Pair icons with text in navigation and buttons.","Use the same icon for the same thing everywhere."],"dont":["Don't use icons from other sets next to these: stroke weights won't match.","Don't resize below 16px."],"content":["A `label` describes meaning, not the picture: \"Low stock\", not \"Warning triangle\"."],"accessibility":["Hidden from screen readers by default (`aria-hidden`).","With `label`, exposed as an image with that name.","Meaningful icons use colours with at least 3:1 contrast (`icon-default` is 3.4:1)."],"related":["button","avatar","thumbnail"]},{"tag":"cm-avatar","slug":"avatar","name":"Avatar","react":"Avatar","group":"Images and icons","summary":"Shows a person or a store as a photo or their initials.","lead":"Round for people, square for stores. Without a photo it shows the initials of `name` on the avatar green, and without a name a person or store icon.","docs_url":"https://commmerce.com/commmerceui/#components--avatar","properties":[{"attribute":"name","property":"name","type":"string","default":"''","description":"Who or what it shows. Used for the initials and as the accessible name."},{"attribute":"src","property":"src","type":"string","default":"''","description":"Photo or logo URL. Shown cropped to fill the avatar."},{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"`small` 24px, `medium` 36px, `large` 48px. Set `--cm-avatar-size` for any other size."},{"attribute":"shape","property":"shape","type":"'round' | 'square'","default":"'round'","description":"`round` for people, `square` for stores and businesses."},{"attribute":"decorative","property":"decorative","type":"boolean","default":"false","description":"Hides it from screen readers. Use when the name is written right next to the avatar."},{"attribute":"_failed","property":"_failed","type":"boolean","default":"false"}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"People","html":"<div class=\"row\">\n <cm-avatar name=\"Asha Rao\" size=\"small\"></cm-avatar>\n <cm-avatar name=\"Asha Rao\"></cm-avatar>\n <cm-avatar name=\"Asha Rao\" size=\"large\"></cm-avatar>\n <cm-avatar></cm-avatar>\n</div>"},{"title":"Stores","description":"`shape=\"square\"` for stores and businesses.","html":"<div class=\"row\">\n <cm-avatar shape=\"square\" name=\"Indiranagar store\"></cm-avatar>\n <cm-avatar shape=\"square\"></cm-avatar>\n</div>"},{"title":"Next to the name","description":"When the name is written beside it, mark the avatar `decorative` so screen readers don't hear the name twice.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-avatar name=\"Rahul Mehta\" decorative></cm-avatar>\n <span>Rahul Mehta · Store manager</span>\n</div>"}],"do":["Use the person's full name, so the initials and the accessible name are right.","Use square avatars for stores, round ones for people."],"dont":["Don't use an avatar for products: use a thumbnail.","Don't make the avatar the only way to tell people apart in a list: show the name too."],"content":["Pass the name as the merchant entered it; the avatar takes the first letters of the first and last word."],"accessibility":["An image named after `name`, unless `decorative` (then hidden).","Initials are dark text on `avatar-bg` (AA in both themes).","Without a name it is hidden from screen readers: give it a name if it carries meaning."],"related":["thumbnail","header-bar"]},{"tag":"cm-thumbnail","slug":"thumbnail","name":"Thumbnail","react":"Thumbnail","group":"Images and icons","summary":"Shows a small product or file image in a fixed square.","lead":"The whole image fits the box (never cropped) on a grey backdrop, so product photos of any shape line up in lists. Without an image, or when it fails to load, it shows a placeholder.","docs_url":"https://commmerce.com/commmerceui/#components--thumbnail","properties":[{"attribute":"src","property":"src","type":"string","default":"''","description":"Image URL."},{"attribute":"alt","property":"alt","type":"string","default":"''","description":"What the image shows, e.g. \"Blue cotton kurta, front\". Leave empty when the product name is written next to\nthe thumbnail: the image is then decorative."},{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"`small` 40px, `medium` 60px, `large` 80px. Set `--cm-thumbnail-size` for any other size."},{"attribute":"loading","property":"loading","type":"'eager' | 'lazy'","default":"'eager'","description":"`lazy` waits until the thumbnail is near the screen: use it in long lists."},{"attribute":"_failed","property":"_failed","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Sizes","description":"40px in dense lists, 60px in resource lists, 80px on detail pages.","html":"<div class=\"row\">\n <cm-thumbnail size=\"small\" alt=\"\" src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Crect width='40' height='60' rx='6' fill='%23327EC2'/%3E%3C/svg%3E\"></cm-thumbnail>\n <cm-thumbnail alt=\"\" src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Crect width='40' height='60' rx='6' fill='%23327EC2'/%3E%3C/svg%3E\"></cm-thumbnail>\n <cm-thumbnail size=\"large\" alt=\"\" src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Crect width='40' height='60' rx='6' fill='%23327EC2'/%3E%3C/svg%3E\"></cm-thumbnail>\n</div>"},{"title":"In a list","description":"Next to the product name, the image is decorative: leave `alt` empty. Use `loading=\"lazy\"` in long lists.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-thumbnail size=\"small\" loading=\"lazy\"></cm-thumbnail>\n <span>Blue cotton kurta · 12 in stock</span>\n</div>"}],"do":["Describe what the image shows in `alt` when nothing next to it does: \"Blue cotton kurta, front\".","Keep every thumbnail in one list the same size."],"dont":["Don't use a thumbnail for people or stores: use an avatar.","Don't write \"image of\" in `alt`."],"content":["Write `alt` as a short phrase in sentence case, without a full stop."],"accessibility":["An empty `alt` makes the image decorative.","The placeholder icon is decorative; the box is named from `alt` when it has one."],"related":["avatar","resource-list"]},{"tag":"cm-tooltip","slug":"tooltip","name":"Tooltip","react":"Tooltip","group":"Overlays","summary":"Explains a control in a few words when it is hovered or focused.","lead":"A small dark label next to one control: 12px white text on `bg-panel-header`, 8 x 12px padding, 6px corners, at most 240px wide (owner standard, 1.6). It appears on hover after 400ms and at once on keyboard focus, hides as soon as the pointer leaves (it stays while the pointer moves onto the bubble), and Esc closes it. The text is also the control's accessible description. Never the only way to get information: touch screens don't show it.","docs_url":"https://commmerce.com/commmerceui/#components--tooltip","properties":[{"attribute":"content","property":"content","type":"string","default":"''","description":"The tooltip text. Plain text, ideally under 80 characters."},{"attribute":"placement","property":"placement","type":"'top' | 'bottom' | 'start' | 'end'","default":"'top'","description":"Preferred side. It flips to the opposite side when there is no room."},{"attribute":"delay","property":"delay","type":"number","default":"400","description":"Wait before showing on hover, in ms. Keyboard focus shows it at once. Default 400 (since 1.6; was 300)."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"True while the tooltip is shown. Read it; use `show()` / `hide()` to change it."},{"attribute":"visual-only","property":"visualOnly","type":"boolean","default":"false","description":"Shows the bubble without adding its text to the control's accessible description. Use it only when the text\nrepeats the control's accessible name, such as the label of an icon-only navigation item, so screen readers\ndon't hear it twice."},{"attribute":"_side","property":"_side","type":"'top' | 'bottom' | 'start' | 'end'","default":"'top'"}],"script_properties":[],"methods":[{"name":"show","description":"Shows the tooltip now."},{"name":"hide","description":"Hides the tooltip now."}],"slots":[{"name":"(default)","description":"The one focusable element the tooltip belongs to (a `cm-button`, a link, an input…)."}],"events":[{"name":"cm-show","description":"When the tooltip appears."},{"name":"cm-hide","description":"When the tooltip disappears."}],"parts":[],"examples":[{"title":"Icon button","description":"An icon-only button still needs its own name: here, its `label`. The tooltip adds a description.","html":"<cm-tooltip content=\"Download this report as a CSV file\">\n <cm-button icon-only icon=\"download\" label=\"Download\"></cm-button>\n</cm-tooltip>"},{"title":"Placement","description":"It flips to the other side when there is no room.","html":"<div class=\"row\" style=\"gap:var(--cm-space-24);padding:40px 0\">\n <cm-tooltip content=\"Above\" placement=\"top\"><cm-button>Top</cm-button></cm-tooltip>\n <cm-tooltip content=\"Below\" placement=\"bottom\"><cm-button>Bottom</cm-button></cm-tooltip>\n <cm-tooltip content=\"Before\" placement=\"start\"><cm-button>Start</cm-button></cm-tooltip>\n <cm-tooltip content=\"After\" placement=\"end\"><cm-button>End</cm-button></cm-tooltip>\n</div>"},{"title":"Longer text","description":"Since 1.6 the bubble wraps at 240px. Keep it to one sentence; anything longer belongs in help text on the page.","html":"<div style=\"padding:24px 0 96px\"><cm-tooltip placement=\"bottom\" content=\"Orders paid more than 30 days ago are archived automatically, with their invoices.\">\n <cm-button>Archive rules</cm-button>\n</cm-tooltip></div>"},{"title":"Explaining a field","html":"<cm-tooltip content=\"Shown to customers at checkout\">\n <cm-text-field label=\"Display name\"></cm-text-field>\n</cm-tooltip>"}],"do":["Keep it under about 80 characters, one sentence or less.","Use it to explain icons and abbreviations.","Make sure what it says is also somewhere else (a label, help text, the page): a tooltip is never the only way to get information."],"dont":["Don't put links, buttons or other controls in a tooltip: it can't be reached.","Don't hide information a merchant needs to finish a task: put it in help text.","Don't add a tooltip that repeats the button text.","Don't wrap a disabled control: it can't be focused, so keyboard users never see the tooltip."],"content":["Write in sentence case without a full stop for fragments.","Say what the control does, not what it looks like."],"accessibility":["The text becomes the control's accessible description: `aria-describedby` on native controls, an element reference on the control inside a component.","It describes, it doesn't name: icon-only buttons need their own name.","With `visual-only`, the text is shown but not added as a description: use it only when it repeats the control's accessible name, as the collapsed Side navigation does with its item labels, so screen readers don't hear it twice.","Hover over it, keep it open while needed and dismiss it with Esc (WCAG 1.4.13).","White on near-black (`text-on-dark` on `bg-panel-header`), AA in both themes."],"responsive":["At most 240px wide (280px before 1.6), and never wider than the window minus 16px.","Positioned against the window: if the bubble doesn't fit on its `placement` side but fits on the opposite one, it flips, and it always stays 8px inside the window. It is placed again when the page scrolls or the window is resized."],"related":["button","icon"]},{"tag":"cm-page-header","slug":"page-header","name":"Page header","react":"PageHeader","group":"Layout","summary":"Tops every admin page with breadcrumbs, the page title and the page's main actions.","lead":"A white bar at least 64px tall: 13px breadcrumbs over a 24/32 semibold title on the left (with an optional 13px `description` under it, since 1.6), buttons 8px apart on the right. A badge in `title-adornment` sits beside the title and wraps under it only when the title runs out of room (fixed in 1.6, issue #32). Its sides are padded 24px (16px on phones), the same as Page content, so the title lines up with the cards below. Pass the parent pages as `breadcrumbs`; the title is added as the current page. On phones it is at least 48px with a 20px title, and the breadcrumbs become a back arrow to the parent page. `back-href` (since 1.7) shows that back arrow at every width, before the title: use it on record pages opened from a list.","docs_url":"https://commmerce.com/commmerceui/#components--page-header","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Page title, rendered as the page's `<h1>` and as the last (current) breadcrumb."},{"attribute":"description","property":"description","type":"string","default":"''","description":"One line under the title saying what the page is for, 13px in text-tertiary (owner standard: page description 13). Since 1.6.\nOn a record page, the record's facts at a glance: \"Owner Asha Rao · Created 12 Nov 2026 · Source Website form\"."},{"attribute":"breadcrumbs","property":"breadcrumbs","type":"Breadcrumb[]","default":"[]","description":"Parent pages, outermost first, as `{label, href}`. Don't include the current page.\nIn HTML pass JSON: `breadcrumbs='[{\"label\":\"Products\",\"href\":\"/products\"}]'`."},{"attribute":"back-href","property":"backHref","type":"string","default":"''","description":"Address of the page this one was opened from (the list of leads, of orders). Shows a back arrow before the title\nat every width, named \"Back to {back-label}\". Without it the arrow appears only on narrow screens, for the last\nbreadcrumb with an `href`. Since 1.7."},{"attribute":"back-label","property":"backLabel","type":"string","default":"''","description":"Name of the page `back-href` leads to (\"Leads\"), for the back arrow's accessible name. Since 1.7."},{"attribute":"pagination","property":"pagination","type":"boolean","default":"false","description":"Shows previous/next arrows for stepping through records (orders, products)."},{"attribute":"has-previous","property":"hasPrevious","type":"boolean","default":"false","description":"Enables the previous arrow."},{"attribute":"has-next","property":"hasNext","type":"boolean","default":"false","description":"Enables the next arrow."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"actions","description":"Buttons, right-aligned, secondary first and the primary action last (large size)."},{"name":"title-adornment","description":"Badge or count next to the title."}],"events":[{"name":"name"},{"name":"cm-previous","description":"When the previous-record arrow is pressed (with `pagination`)."},{"name":"cm-next","description":"When the next-record arrow is pressed (with `pagination`)."}],"parts":[],"examples":[{"title":"Record header","description":"The standard record header: `back-href` back to the list, the status in `title-adornment`, the record's owner, created date and source in `description`, secondary actions then the primary one. Since 1.7.","html":"<cm-page-header heading=\"Asha Rao\" back-href=\"#leads\" back-label=\"Leads\" description=\"Owner Ravi Kumar · Created 12 Nov 2026 · Source Website form\">\n <cm-badge slot=\"title-adornment\" tone=\"attention\">Qualified</cm-badge>\n <cm-button slot=\"actions\">Log call</cm-button>\n <cm-button slot=\"actions\" variant=\"primary\">Convert</cm-button>\n</cm-page-header>"},{"title":"Title badge and description","description":"A count or status in `title-adornment` sits beside the title (it wraps under it only when the title runs out of room), and `description` adds one 13px line under the title. Since 1.6.","html":"<cm-page-header heading=\"Tasks\" description=\"Calls, visits and follow-ups for your accounts.\">\n <cm-badge slot=\"title-adornment\" tone=\"attention\">5 open</cm-badge>\n <cm-button slot=\"actions\">Export</cm-button>\n <cm-button slot=\"actions\" variant=\"primary\">Add task</cm-button>\n</cm-page-header>"},{"title":"Edit page","description":"Secondary actions first, the primary action last, `space-20` apart.","html":"<cm-page-header heading=\"Add product\" breadcrumbs='[{\"label\":\"Dashboard\",\"href\":\"#\"},{\"label\":\"Products\",\"href\":\"#\"}]'>\n <cm-button slot=\"actions\" size=\"large\">Duplicate</cm-button>\n <cm-button slot=\"actions\" size=\"large\">Cancel</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Save</cm-button>\n</cm-page-header>"},{"title":"Record with previous/next","description":"`pagination` adds arrows that fire `cm-previous` and `cm-next`; enable them with `has-previous` and `has-next`.","html":"<cm-page-header heading=\"Order #ODYOD0744\" breadcrumbs='[{\"label\":\"Orders\",\"href\":\"#\"}]' pagination has-previous has-next>\n <cm-badge slot=\"title-adornment\" tone=\"information\">Order placed</cm-badge>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Fulfil</cm-button>\n</cm-page-header>"},{"title":"List page","description":"A count next to the title and import/export actions.","html":"<cm-page-header heading=\"Products\">\n <cm-badge slot=\"title-adornment\">39</cm-badge>\n <cm-button slot=\"actions\" size=\"large\">Import</cm-button>\n <cm-button slot=\"actions\" size=\"large\">Export</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Add product</cm-button>\n</cm-page-header>"}],"do":["Use one page header per page, at the top.","Keep it to three actions; put the rest in an action menu.","Make the title the same words as the link that led here."],"dont":["Don't include the current page in `breadcrumbs`: it is added from `heading`.","Don't use it inside cards or panels.","Don't use it to ask about unsaved changes: use the save bar."],"content":["Titles are nouns or short verb phrases: \"Products\", \"Add product\", \"Order #1042\".","Breadcrumbs use the page names from navigation."],"accessibility":["The title is the page's `<h1>`.","Breadcrumbs are a `nav` named \"Breadcrumb\" with an ordered list; the current page has `aria-current=\"page\"`.","The back arrow (on phones, or always with `back-href`) is a link named \"Back to <parent>\" (`back-label`; just \"Back\" without one). Previous/next arrows are buttons named \"Previous\" and \"Next\", disabled at the ends.","The previous/next arrows are 36px icon buttons (40px on touch screens, with a 44px hit area) with a `border-input` edge, so they meet 3:1."],"responsive":["When the window is 640px wide or less, the breadcrumbs are replaced by a back link to the parent page, the title is 20px, the sides are padded 16px instead of 24px, and the header is at least 48px tall and stays on one line."],"related":["action-bar","save-bar","button"]},{"tag":"cm-action-bar","slug":"action-bar","name":"Action bar","react":"ActionBar","group":"Layout","summary":"Keeps a record's name and its main actions in reach at the bottom of long pages.","lead":"A bar at least 64px tall: a 13px eyebrow and optional badge over a 16px semibold record name, buttons 8px apart on the right. Add `sticky` to pin it to the bottom of the scrolling area. With `tone=\"critical\"` it explains a blocking error and offers the fix.","docs_url":"https://commmerce.com/commmerceui/#components--action-bar","properties":[{"attribute":"eyebrow","property":"eyebrow","type":"string","default":"''","description":"Small line above the heading: the page or record ID (\"Add product\", \"#ODYOD0744\")."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The record name, or the error message when `tone=\"critical\"`."},{"attribute":"tone","property":"tone","type":"'default' | 'critical'","default":"'default'","description":"`default` white bar; `critical` pink bar with a red top edge and warning icon, announced as an alert."},{"attribute":"sticky","property":"sticky","type":"boolean","default":"false","description":"Sticks the bar to the bottom of the scrolling area."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of the bar's region. Defaults to the heading."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Extra content under the heading, such as an amount."},{"name":"adornment","description":"Badge next to the eyebrow (for example the order status)."},{"name":"actions","description":"Buttons, secondary first and the primary action last (large size)."}],"events":[],"parts":[],"examples":[{"title":"Order actions","description":"Badge in the `adornment` slot, extra content (an amount) in the default slot.","html":"<cm-action-bar eyebrow=\"#ODYOD0744\">\n <cm-badge slot=\"adornment\" tone=\"information\">Order placed</cm-badge>\n <p style=\"margin:0;font-size:16px;font-weight:600\">Amount payable: ₹2,234.00</p>\n <cm-button slot=\"actions\" size=\"large\">Cancel order</cm-button>\n <cm-button slot=\"actions\" size=\"large\">Mark as processing</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Mark as paid</cm-button>\n</cm-action-bar>"},{"title":"Record name","html":"<cm-action-bar eyebrow=\"Add product\" heading=\"Brocato Mobster Golden TR90 Rimless Square Eyeglasses\">\n <cm-button slot=\"actions\" size=\"large\">Cancel</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Save</cm-button>\n</cm-action-bar>"},{"title":"Blocking error","description":"Says what is wrong and offers one button that fixes it.","html":"<cm-action-bar tone=\"critical\" heading=\"Tax could not be calculated. Choose a tax rate for this order.\">\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Change tax rate</cm-button>\n</cm-action-bar>"}],"do":["Use it on long forms and order pages where the page header scrolls away.","Repeat the same actions as the page header, in the same order.","Give critical bars one action that fixes the problem."],"dont":["Don't show more than three buttons; on phones keep one and move the rest into a menu.","Don't use it for unsaved changes: use the save bar.","Don't stack two action bars."],"content":["Critical messages say what happened and what to do: \"Tax could not be calculated. Choose a tax rate.\"","Button labels are verbs: \"Mark as paid\", not \"Paid\"."],"accessibility":["A `region` named by the heading (or `label`), so screen-reader users can jump to it.","Critical headings have `role=\"alert\"`, so they are announced when the bar appears or the text changes.","Text on the critical fill (`bg-error-bar`) meets 4.5:1 and the red icon meets 3:1, both themes (checked on every build).","The warning icon is the vector `alert` icon on a 36px white circle; on phones the extra buttons stay visible and wrap instead of moving into a \"more\" menu — compose that with an action menu when it ships."],"responsive":["When the window is 640px wide or less, the bar is at least 56px tall instead of 64px, with 8px by 12px padding, a 14px heading, a 12px eyebrow and a 32px icon.","The actions move under the text when there is no room for both side by side (the text keeps at least 280px)."],"related":["page-header","save-bar","banner"]},{"tag":"cm-save-bar","slug":"save-bar","name":"Save bar","react":"SaveBar","group":"Layout","summary":"Asks the merchant to save or discard unsaved changes.","lead":"A bar with a message, Discard and Save, hidden until there are unsaved changes. Set `open` yourself, or point `form` at a form's ID: the bar opens when a field changes, Save submits the form and Discard resets it. Both events are cancelable, so you can confirm or save with your own code instead. It sticks to the bottom of the scrolling area.","docs_url":"https://commmerce.com/commmerceui/#components--save-bar","properties":[{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the bar. Set it when the page has unsaved changes."},{"attribute":"message","property":"message","type":"string","description":"The question or status shown next to the buttons. Default: the built-in string `message` (\"Unsaved changes\")."},{"attribute":"save-label","property":"saveLabel","type":"string","description":"Primary button label. Default: the built-in string `save` (\"Save\")."},{"attribute":"discard-label","property":"discardLabel","type":"string","description":"Secondary button label. Default: the built-in string `discard` (\"Discard\")."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner on Save and blocks both buttons while saving."},{"attribute":"save-disabled","property":"saveDisabled","type":"boolean","default":"false","description":"Disables Save, for example while the form has errors."},{"attribute":"form","property":"form","type":"string","default":"''","description":"ID of a `<form>` to watch: the bar opens on input, Save submits it and Discard resets it."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"name"},{"name":"cm-save","description":"Save pressed (cancelable). With `form`, the default submits that form."},{"name":"cm-discard","description":"Discard pressed (cancelable). With `form`, the default resets that form and closes the bar."}],"parts":[],"examples":[{"title":"Watching a form","description":"Type in the field to open the bar. Discard puts the old value back.","html":"<form id=\"product-form\" class=\"stack\" onsubmit=\"event.preventDefault(); this.nextElementSibling.open = false\">\n <cm-text-field label=\"Title\" name=\"title\" value=\"Ceramic mug\"></cm-text-field>\n</form>\n<cm-save-bar form=\"product-form\"></cm-save-bar>"},{"title":"Open, with your own handlers","description":"Set `loading` while saving; `save-disabled` while the form has errors.","html":"<cm-save-bar open message=\"Do you want to save changes before closing?\" discard-label=\"Cancel\"></cm-save-bar>"}],"do":["Show it as soon as anything changes, and hide it after saving or discarding.","Keep the merchant on the page if they try to leave with unsaved changes.","Set `loading` while the save request runs."],"dont":["Don't use it on pages that save straight away (toggles, for example).","Don't add other actions to it: use the action bar.","Don't show it alongside an action bar with its own Save button."],"content":["The message is short: \"Unsaved changes\" or a question such as \"Save changes before closing?\".","Keep the labels \"Save\" and \"Discard\" unless the context needs \"Cancel\"."],"accessibility":["The message is a `status` live region, so it is announced when the bar opens.","The bar is a `region` named by the message; buttons are real buttons in a sensible tab order (Discard, then Save).","While `loading`, Save shows a spinner with `aria-busy` and both buttons are blocked.","The bar is at least 64px tall with a 16px semibold message and large (40px) Discard and Save buttons 8px apart."],"responsive":["The buttons move under the message when there is no room for both side by side (the message keeps at least 200px).","When the window is 640px wide or less, the bar is at least 56px tall instead of 64px, with 8px by 12px padding and a 14px message."],"related":["page-header","action-bar","button"]},{"tag":"cm-info-panel","slug":"info-panel","name":"Info panel","react":"InfoPanel","group":"Layout","summary":"Lists the facts about a record as label/value pairs, in the side column of detail pages.","lead":"A card (about 380px in the side column) with a 16px semibold title, an optional underlined text action, and `cm-info-item`s: a 13px grey label over a 14px medium value. Values can be text, badges or tags. `half` puts two short facts on one line. For record pages (since 1.7), `variant=\"compact\"` gives it a compact card's 16px padding and `layout=\"rows\"` puts each label beside its value.","docs_url":"https://commmerce.com/commmerceui/#components--info-panel","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Panel title."},{"attribute":"action","property":"action","type":"string","default":"''","description":"Text of the header action, in sentence case (\"Remove\", \"Edit\"). Leave empty for none."},{"attribute":"action-label","property":"actionLabel","type":"string","default":"''","description":"Accessible name of the header action when the text alone is unclear, e.g. \"Remove order details\"."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level for the title. Default 2."},{"attribute":"variant","property":"variant","type":"'default' | 'compact'","default":"'default'","description":"`default` (24px padding, like a standard `cm-card`; 16px on phones; 20px before 1.7.1) or `compact` (16px padding and 12px under the title, like a compact `cm-card`). Since 1.7."},{"attribute":"layout","property":"layout","type":"'stacked' | 'rows'","default":"'stacked'","description":"`stacked` (default: each label over its value; `half` items share a line) or `rows` (each label beside its value,\ntwo fifths of the width for the label; `half` is ignored). Since 1.7."},{"attribute":"_list","property":"_list","type":"boolean","default":"true","description":"The items area is a list only while it holds just `cm-info-item`s (not, say, a loading skeleton)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"`cm-info-item` elements."}],"events":[{"name":"cm-action","description":"When the header text action (for example REMOVE) is pressed."}],"parts":[{"tag":"cm-info-item","react":"InfoItem","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"What the value is (\"Ordered on\", \"SKU\")."},{"attribute":"half","property":"half","type":"boolean","default":"false","description":"Takes half the width, so two short facts share a line."},{"attribute":"editable","property":"editable","type":"boolean","default":"false","description":"Shows a pencil button after the value that fires `cm-edit`. Since 1.9.1."},{"attribute":"edit-label","property":"editLabel","type":"string","default":"''","description":"Accessible name of the pencil; default \"Edit {label}\". Since 1.9.1."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The value."}],"events":[{"name":"cm-edit","description":"When the pencil of an `editable` fact is pressed."}]}],"examples":[{"title":"Record details: compact rows","description":"The Details card of a record page's 320px aside: `variant=\"compact\"` (16px padding) and `layout=\"rows\"` (13px label on the start side, 14px value beside it, 12px between rows). Since 1.7.","html":"<div style=\"max-width:320px\">\n<cm-info-panel heading=\"Details\" action=\"Edit\" action-label=\"Edit details\" variant=\"compact\" layout=\"rows\">\n <cm-info-item label=\"Email\"><a href=\"mailto:asha@example.com\">asha@example.com</a></cm-info-item>\n <cm-info-item label=\"Phone\">+91 98450 12345</cm-info-item>\n <cm-info-item label=\"Company\">Rao Textiles</cm-info-item>\n <cm-info-item label=\"Lead source\">Website form</cm-info-item>\n <cm-info-item label=\"Status\"><cm-badge tone=\"attention\">Qualified</cm-badge></cm-info-item>\n</cm-info-panel>\n</div>"},{"title":"Order details","html":"<div style=\"max-width:380px\">\n<cm-info-panel heading=\"Order details\" action=\"Remove\" action-label=\"Remove order details\">\n <cm-info-item label=\"Ordered on\">Mar 29, 2023 3:45 AM</cm-info-item>\n <cm-info-item label=\"Order status\"><cm-badge tone=\"information\">Order placed</cm-badge></cm-info-item>\n <cm-info-item label=\"Order type\">Store pickup</cm-info-item>\n <cm-info-item label=\"Payment status\"><cm-badge tone=\"success\">Accepted</cm-badge></cm-info-item>\n <cm-info-item label=\"Transaction ID\">098765432108976</cm-info-item>\n <cm-info-item label=\"SKU\" half>OD673892</cm-info-item>\n <cm-info-item label=\"Inventory available\" half>8202</cm-info-item>\n <cm-info-item label=\"Product tags\">\n <cm-tag removable>Yellow</cm-tag><cm-tag removable>Cotton</cm-tag><cm-tag removable>Summer</cm-tag>\n </cm-info-item>\n</cm-info-panel>\n</div>"}],"do":["Put it in the side column of detail pages, next to the main cards.","On record pages use `variant=\"compact\" layout=\"rows\"` in the aside.","Use `half` only for short values that fit side by side.","Name the header action with `action-label` when \"Remove\" alone is unclear."],"dont":["Don't put form fields in it: use a card.","Don't use it for long text: values should be one line or a few tags."],"content":["Labels are sentence-case nouns: \"Ordered on\", \"Payment status\".","Write values the way the merchant sees them elsewhere (same date format, same status words)."],"accessibility":["The panel is a region named by its heading; the items are a list, each a list item, so screen readers announce \"list, 8 items\" and read each label before its value.","The header action is a real button; it fires `cm-action`.","The action is written in sentence case and underlined, and the panel takes the width you give it."],"related":["card","badge","tag"]},{"tag":"cm-accordion","slug":"accordion","name":"Accordion","react":"Accordion","group":"Layout","summary":"Shows or hides extra detail under a row, inside side panels and cards.","lead":"A 48px bordered row with 14px medium text and a 28px round chevron; the detail opens below a divider. Each accordion opens on its own; stack them `space-8` apart.","docs_url":"https://commmerce.com/commmerceui/#components--accordion","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The always-visible row text."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the detail."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks opening and closing."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"3","description":"Heading level wrapping the toggle button, so the page outline stays correct. Default 3."}],"script_properties":[],"methods":[{"name":"toggle","description":"Opens or closes it, as if the row was pressed."}],"slots":[{"name":"(default)","description":"The detail shown when open."}],"events":[{"name":"cm-toggle","description":"After it opens or closes; `detail.open` is the new state."}],"parts":[],"examples":[{"title":"Customer matches","html":"<div class=\"stack\" style=\"gap:var(--cm-space-8);max-width:480px\">\n <cm-accordion heading=\"Email and phone found in an abandoned cart\">\n <p style=\"margin:0\">Cart from 18-12-2022 · 3 items · Rs. 1,240</p>\n </cm-accordion>\n <cm-accordion heading=\"Email and phone found in 2 orders\" open>\n <p style=\"margin:0\">#NAYOD0736 · 20-12-2022<br>#NAYOD0741 · 02-01-2023</p>\n </cm-accordion>\n</div>"}],"do":["Use it to tuck away detail that most merchants don't need.","Write the row so it says what is inside: \"Found in 2 orders\".","Set `heading-level` to fit the page outline."],"dont":["Don't hide information needed to finish the task.","Don't nest accordions.","Don't use it for navigation: use tabs or links."],"content":["Row text is a short statement in sentence case, no full stop."],"accessibility":["The row is a button inside a heading, with `aria-expanded` and `aria-controls`; the detail is a region labelled by the row.","Enter or Space opens and closes it; `cm-toggle` reports the new state.","The chevron rotation respects reduced motion.","Built from the written guidance in the design-system artifact; sizes follow the 1.5 scale."],"responsive":["The header row is at least 48px tall with 14px text and a 28px chevron circle at every width."],"related":["card","info-panel"]},{"tag":"cm-empty-state","slug":"empty-state","name":"Empty state","react":"EmptyState","group":"Feedback","summary":"Fills a list or page that has nothing in it yet, and offers the next step.","lead":"Owner standard (1.6): a 48px icon tile with a 24px icon, a 16px semibold line saying what is missing, 13px supporting text and one 36px action, 8 to 12px apart, so an empty card stays compact. `size=\"large\"` keeps the 160px illustration circle (120px on phones) for a first-run page with a real illustration; it was the default before 1.6. `size=\"small\"` is a 120px circle and `size=\"inline\"` one line of text.","docs_url":"https://commmerce.com/commmerceui/#components--empty-state","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"What is missing, said plainly: \"No products found\"."},{"attribute":"image","property":"image","type":"string","default":"''","description":"URL of an illustration shown in the circle. Decorative, so it has no alt text."},{"attribute":"icon","property":"icon","type":"IconName | ''","default":"'box'","description":"System icon shown in the circle when there is no `image` or `image` slot."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level, so the page outline stays correct. Default 2."},{"attribute":"size","property":"size","type":"'default' | 'large' | 'small' | 'inline'","default":"'default'","description":"`default` (since 1.6, owner standard: a 48px icon tile, 16px heading, 13px text; for pages, cards and lists),\n`large` (the 160px illustration circle, 120px on phones: a first-run page with a real illustration; the default\nbefore 1.6), `small` (a 120px circle) or `inline` (since 1.2: no tile, a 20px icon, heading and text on one or two\nleft-aligned lines; for an empty list inside a card, panel or table). Inline shows the `icon` (default `box`); set `icon=\"\"` for text only."},{"attribute":"action","property":"action","type":"string","default":"''","description":"Text of one action drawn as a text button (\"Add task\", \"View all\"), after the text. Meant for `size=\"inline\"`; larger sizes put a `cm-button` in the `actions` slot. Fires `cm-action`. Since 1.2."},{"attribute":"action-href","property":"actionHref","type":"string","default":"''","description":"Makes the text action a link to this URL instead of a button. Since 1.2."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Optional supporting text under the heading (inline: after it, on the same line)."},{"name":"image","description":"Your own illustration or icon, drawn inside the tile (or the circle with `size=\"large\"`/`\"small\"`). Decorative: give it `alt=\"\"`. Inline: 20px."},{"name":"actions","description":"The primary action (usually one primary `cm-button`), plus an optional link."}],"events":[{"name":"cm-action","description":"The text action (`action`) was pressed. Not fired when it has `action-href` (it is then a link)."}],"parts":[],"examples":[{"title":"Default","description":"A 48px icon tile, 16px heading, 13px text and a 36px action. Since 1.6.","html":"<cm-empty-state heading=\"No visits planned\" icon=\"calendar\">\n Plan a visit to see it here.\n <cm-button slot=\"actions\" variant=\"primary\">Plan a visit</cm-button>\n</cm-empty-state>"},{"title":"Large illustration","description":"`size=\"large\"`: the 160px circle (120px on phones), for a first-run page.","html":"<cm-empty-state size=\"large\" heading=\"No products found\">\n <cm-button slot=\"actions\" variant=\"primary\" size=\"large\">Add product</cm-button>\n</cm-empty-state>"},{"title":"Inside a card, with supporting text","html":"<cm-card heading=\"Orders\" style=\"max-width:420px\">\n <cm-empty-state size=\"small\" icon=\"cart\" heading=\"No orders yet\">\n Orders appear here when customers check out.\n <cm-button slot=\"actions\" variant=\"primary\">Share your store</cm-button>\n </cm-empty-state>\n</cm-card>"},{"title":"Inline, for an empty list inside a card","description":"`size=\"inline\"` says \"nothing here\" in one or two left-aligned lines, with no circle and no extra height, so an empty card is no taller than a full one. The heading is bold, the supporting text follows it on the same line, an optional 20px `icon` sits in front (set `icon=\"\"` for text only), and `action` adds one text action that fires `cm-action` (or is a link with `action-href`). Since 1.2.","html":"<div class=\"row\" style=\"align-items:flex-start\">\n <cm-card heading=\"Customer tasks\" style=\"flex:1 1 260px;max-width:360px\">\n <cm-empty-state size=\"inline\" icon=\"tasks\" heading=\"Nothing due today.\" heading-level=\"3\" action=\"Add task\">4 later.</cm-empty-state>\n </cm-card>\n <cm-card heading=\"Chats\" style=\"flex:1 1 260px;max-width:360px\">\n <cm-empty-state size=\"inline\" icon=\"\" heading=\"No chats waiting.\" heading-level=\"3\"></cm-empty-state>\n </cm-card>\n</div>"}],"do":["Say what is missing and what to do next.","Inside a card, panel, table or list that sits next to full ones, use `size=\"inline\"`: one line, at most one text action.","Offer one primary action; add a link only if there is a real second path.","Use your own illustration in the `image` slot or `image` attribute when you have one."],"dont":["Don't use it for errors: use a critical banner.","Don't use it for search with no results without saying how to widen the search.","Don't show it while data is loading: use a skeleton."],"content":["Heading in sentence case, no exclamation mark: \"No products found\".","Supporting text is one sentence about what will appear and when."],"accessibility":["The heading is a real heading (`heading-level`, default 2) so screen-reader users find it in the outline.","The illustration is decorative and hidden from assistive technology.","The circle shows a system icon (`icon`, default `box`); pass your own artwork in the `image` slot."],"responsive":["The default tile is the same at every width. With `size=\"large\"`, when the window is 640px wide or less, the circle is 120px, as in the small size."],"related":["skeleton","banner","button"]},{"tag":"cm-toast","slug":"toast","name":"Toast","react":"Toast","group":"Feedback","summary":"A short confirmation at the bottom of the screen that goes away on its own.","lead":"One sentence on a dark bar, bottom centre, 48px tall with an 8px radius: \"Product saved\". Show it with `showToast()`, which keeps one polite live region on the page so every toast is announced. It stays 5 seconds (10 with an action), and pauses while the pointer or focus is on it. For reversible actions, act at once and offer Undo in a toast instead of asking first: see Undo instead of confirm.","docs_url":"https://commmerce.com/commmerceui/#components--toast","properties":[{"attribute":"message","property":"message","type":"string","default":"''","description":"The text: one short sentence, up to about 50 characters."},{"attribute":"tone","property":"tone","type":"ToastTone","default":"'default'","description":"`critical` for failures. Never the only place an error is shown: also say it next to what failed."},{"attribute":"duration","property":"duration","type":"number | undefined","description":"How long it stays, in ms: 2000–10000. Default 5000, or 10000 when it has an action."},{"attribute":"action-label","property":"actionLabel","type":"string","default":"''","description":"Label of one optional action (\"Undo\", \"View\"). The toast stays 10 seconds when it has one."},{"attribute":"open","property":"open","type":"boolean","default":"true","description":"Whether it is showing. Set it to show the toast again; it is cleared when the toast closes."},{"attribute":"_inRegion","property":"_inRegion"},{"attribute":"_primed","property":"_primed","type":"boolean","default":"false","description":"Alone, the toast's live region must exist before its text, or screen readers skip the first message."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"closed","type":"Promise<ToastCloseReason>","description":"Resolves when the toast closes (this time it is shown), with the reason: `action` (its action was pressed),\n`close` (Dismiss, Esc or `open = false`), `timeout`, or `removed` (taken off the page while open, e.g. pushed out by newer toasts)."},{"property":"effectiveDuration","type":"number","description":"The time the toast stays, clamped to 2000–10000 ms."}],"methods":[{"name":"show","description":"Shows the toast again and restarts its timer."},{"name":"dismiss","description":"Closes the toast, as if the close button were pressed. Returns false if a listener kept it open."}],"slots":[{"name":"(default)","description":"The message, if not given with `message`."}],"events":[{"name":"cm-action","description":"The action button was pressed (cancelable; by default the toast then closes)."},{"name":"cm-dismiss","description":"The toast is closing: `detail.reason` is `timeout`, `close` or `action` (cancelable; keeps it open)."}],"parts":[{"tag":"cm-toast-region","react":"ToastRegion","properties":[{"attribute":"max","property":"max","type":"number","default":"3","description":"Most toasts shown at once. When a new one would exceed it, the oldest is removed. Default 3."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"focusToast","description":"Moves focus to the newest open toast with an action (else the newest toast): its action, or its Dismiss button.\nF6 does this; call it to offer another shortcut. Returns false when there is no toast to focus."},{"name":"add","description":"Adds a toast, removing the oldest ones above `max`."}],"slots":[{"name":"(default)","description":"`cm-toast` elements. Closed toasts are removed."}],"events":[]}],"examples":[{"title":"Show a toast","description":"Call `showToast(message, { tone, duration, action })`. Each button here calls it.","html":"<div class=\"row\">\n <cm-button data-toast=\"Product saved\">Save product</cm-button>\n <cm-button data-toast=\"Order archived\" data-toast-action=\"Undo\">Archive order</cm-button>\n <cm-button data-toast=\"Couldn't save product. Check your connection.\" data-toast-tone=\"critical\">Fail to save</cm-button>\n</div>"},{"title":"Default","description":"A toast element on its own carries its own live region; set `open` to show it again.","html":"<cm-toast message=\"Product saved\" duration=\"10000\"></cm-toast>"},{"title":"With an action","html":"<cm-toast message=\"3 orders archived\" action-label=\"Undo\" duration=\"10000\"></cm-toast>"},{"title":"Critical","description":"Also show the error where it happened: a toast disappears, so it must never be the only place.","html":"<cm-toast tone=\"critical\" message=\"Couldn't save product\" duration=\"10000\"></cm-toast>"}],"do":["Confirm something the merchant just did: \"Product saved\", \"Order archived\".","Offer Undo for actions that are easy to reverse (archive, mark done, move, remove from a list), and don't ask first: Undo instead of confirm.","Use `showToast()` so toasts stack in one place and are announced."],"dont":["Don't use a toast as the only sign of an error: show the error next to what failed (a banner or field error) too.","Don't put essential information or links the merchant must follow in a toast.","Don't show more than one toast for one action.","Don't offer Undo for something that can't be undone (a sent email, a real delete): ask first with a modal instead."],"content":["Noun and past-tense verb: \"Product saved\", not \"Your product has been saved successfully!\".","About 50 characters at most, one sentence, no full stop for confirmations.","Action labels are one verb: \"Undo\", \"View\".","With Undo, say what happened in the past tense: \"Lead archived\", \"3 tasks marked done\"."],"accessibility":["`showToast()` adds toasts to `cm-toast-region`, a polite `role=\"status\"` region, so screen readers announce them without moving focus.","Hovering or focusing a toast pauses its timer; it never closes in under 2 seconds, and stays 10 seconds when it has an action.","Keyboard: F6 moves focus to the newest toast's action (`aria-keyshortcuts=\"F6\"`) and F6 again goes back; Esc closes the focused toast; focus returns to where it was when the toast closes, so it is never lost. A toast with an action ends with visually hidden text, \"Press F6 to reach it.\" (built-in string `toast.shortcut`; set it to an empty string to leave it out).","The Dismiss and action buttons are real buttons with visible focus rings; text is white on black (or black on the error tint) and meets 4.5:1 in both themes."],"responsive":["At most 480px wide, and never wider than the window minus 32px."],"related":["banner","spinner","progress-bar"]},{"tag":"cm-spinner","slug":"spinner","name":"Spinner","react":"Spinner","group":"Feedback","summary":"Shows that something is loading when the wait is short or of unknown length.","lead":"A turning arc: 20px (`small`) inside buttons, rows and fields, 44px (`large`) for a section. The arc is `border-strong` on a `border-subtle` track. A product can show its own graphic in place of the arc (since 1.12).","docs_url":"https://commmerce.com/commmerceui/#components--spinner","properties":[{"attribute":"size","property":"size","type":"'small' | 'large'","default":"'large'","description":"`small` (20px) for inline use in buttons, rows and fields; `large` (44px) for a section or page."},{"attribute":"accessible-label","property":"accessibleLabel","type":"string","description":"What screen readers announce. Name what is loading when it helps: \"Loading orders\". Default: the built-in string `loading` (\"Loading\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Optional graphic shown instead of the arc, such as an inline SVG. Decorative: give it `aria-hidden=\"true\"`. Drawn 12px tall (`small`) or 20px (`large`) with its own width; colour it with `currentColor`."}],"events":[],"parts":[],"examples":[{"title":"Sizes","html":"<div class=\"row\" style=\"align-items:center;gap:var(--cm-space-32)\">\n <cm-spinner size=\"large\"></cm-spinner>\n <cm-spinner size=\"small\"></cm-spinner>\n</div>"},{"title":"Loading a section","description":"Mark the region busy and name what is loading.","html":"<cm-card heading=\"Recent orders\">\n <div aria-busy=\"true\" style=\"display:flex;justify-content:center;padding:var(--cm-space-32)\">\n <cm-spinner accessible-label=\"Loading recent orders\"></cm-spinner>\n </div>\n</cm-card>"},{"title":"Your own graphic","description":"Since 1.12. Put a decorative graphic inside to show it instead of the arc: the spinner keeps the status, the label and the height (12px small, 20px large). The graphic animates itself with `--cm-spinner-duration` and `--cm-spinner-play-state`, which pauses it under reduced motion. Commmerce products use this for the Commmerce loader from Commmerce Brand Assets; the loader itself is not part of Commmerce UI.","html":"<style>\n .demo-bars rect { fill: currentColor; animation: demo-pulse var(--cm-spinner-duration) ease-in-out infinite; animation-play-state: var(--cm-spinner-play-state); }\n .demo-bars rect:nth-child(2) { animation-delay: calc(var(--cm-spinner-duration) / 6); }\n .demo-bars rect:nth-child(3) { animation-delay: calc(var(--cm-spinner-duration) / 3); }\n @keyframes demo-pulse { 0%, 60%, 100% { opacity: 1; } 30% { opacity: .3; } }\n</style>\n<div class=\"row\" style=\"align-items:center;gap:var(--cm-space-32)\">\n <cm-spinner size=\"large\" accessible-label=\"Loading orders\">\n <svg class=\"demo-bars\" viewBox=\"0 0 44 20\" aria-hidden=\"true\"><rect width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"16\" width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"32\" width=\"12\" height=\"20\" rx=\"2\"/></svg>\n </cm-spinner>\n <cm-spinner size=\"small\">\n <svg class=\"demo-bars\" viewBox=\"0 0 44 20\" aria-hidden=\"true\"><rect width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"16\" width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"32\" width=\"12\" height=\"20\" rx=\"2\"/></svg>\n </cm-spinner>\n</div>"}],"do":["Use it for waits of about 1 to 10 seconds where the length is unknown.","Name what is loading with `accessible-label` when there is more than one on the page.","Use a button's own `loading` state for button actions.","With your own graphic, mark it `aria-hidden=\"true\"`, draw it in `currentColor` and run its animation on `--cm-spinner-duration` and `--cm-spinner-play-state`."],"dont":["Don't use it for a whole page's first load: use a skeleton display.","Don't use it when you know how far along the task is: use a progress bar.","Don't show several spinners for one task.","Don't put the Commmerce logo or loader in an app you build for the admin: apps embedded in the admin keep the arc."],"content":["The label is \"Loading\" or \"Loading <thing>\": no ellipsis, no \"please wait\"."],"accessibility":["A `role=\"status\"` with hidden text, so the label is announced; the graphic is hidden from screen readers.","The arc meets 3:1 against the page and card backgrounds in both themes.","Under reduced motion it turns three times slower; a slotted graphic gets `--cm-spinner-play-state: paused`.","A slotted graphic is coloured by the spinner's `color` (`border-strong` by default, which meets 3:1); if you change it, keep 3:1 against the background."],"related":["progress-bar","skeleton","button"]},{"tag":"cm-progress-bar","slug":"progress-bar","name":"Progress bar","react":"ProgressBar","group":"Feedback","summary":"Shows how far a longer task has got, such as an import or a bulk update.","lead":"A label above an 8px (`medium`) or 4px (`small`) rounded track in `bg-inset`, filled with `action-primary`. Without a `value` it is indeterminate: a segment slides along the track.","docs_url":"https://commmerce.com/commmerceui/#components--progress-bar","properties":[{"attribute":"value","property":"value","type":"number | null","default":"null","description":"Percent done, 0–100. Leave unset (or `null`) for an indeterminate bar when the amount is unknown."},{"attribute":"label","property":"label","type":"string","default":"''","description":"What is in progress, shown above the bar and used as its accessible name. Required."},{"attribute":"label-hidden","property":"labelHidden","type":"boolean","default":"false","description":"Keeps the label for screen readers only, when the surrounding text already says what is running."},{"attribute":"show-value","property":"showValue","type":"boolean","default":"false","description":"Shows the percentage next to the label. Determinate bars only."},{"attribute":"size","property":"size","type":"'small' | 'medium'","default":"'medium'","description":"`small` (4px) inside rows and cards; `medium` (8px) for a page-level task."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"clampedValue","type":"number | null","description":"The value clamped to 0–100, or `null` when indeterminate."}],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Determinate","html":"<cm-progress-bar label=\"Importing 1,240 products\" value=\"62\" show-value style=\"max-width:520px\"></cm-progress-bar>"},{"title":"Indeterminate","description":"Leave out `value` when you can't tell how far along it is.","html":"<cm-progress-bar label=\"Syncing inventory with your stores\" style=\"max-width:520px\"></cm-progress-bar>"},{"title":"Small, in a card","html":"<cm-card heading=\"Bulk price update\">\n <div class=\"stack\">\n <p style=\"margin:0\">Updating 350 products. You can leave this page.</p>\n <cm-progress-bar label=\"Bulk price update\" label-hidden size=\"small\" value=\"30\"></cm-progress-bar>\n </div>\n</cm-card>"}],"do":["Use it for tasks over about 10 seconds, and say what is happening in the label.","Update `value` at least every few seconds, so it never looks stuck.","Tell the merchant whether they can leave the page."],"dont":["Don't use it for short waits: use a spinner.","Don't let a determinate bar go backwards."],"content":["Label in the present continuous with the amount: \"Importing 1,240 products\"."],"accessibility":["A WAI-ARIA `progressbar` named by its label, with `aria-valuenow` (0–100) when determinate and no value when indeterminate.","`label-hidden` keeps the name for screen readers when the text around it already says what is running.","The fill meets 3:1 against the track and page in both themes; under reduced motion the indeterminate segment moves three times slower."],"related":["spinner","toast","banner"]},{"tag":"cm-skeleton","slug":"skeleton","name":"Skeleton","react":"Skeleton","group":"Feedback","summary":"Grey placeholder shapes shown where content is loading.","lead":"Lines, square thumbnails (34, 40, 50 or 186px) and blocks in `bg-input-filled`, pulsing gently to `thumb-bg`.","docs_url":"https://commmerce.com/commmerceui/#components--skeleton","properties":[{"attribute":"variant","property":"variant","type":"'text' | 'thumbnail' | 'block'","default":"'text'","description":"`text` (one or more lines), `thumbnail` (a square image placeholder) or `block` (fills the width; set a height)."},{"attribute":"lines","property":"lines","type":"number","default":"1","description":"Number of text lines. The last of several lines is shorter, like a real paragraph."},{"attribute":"size","property":"size","type":"keyof typeof THUMB","default":"'large'","description":"Thumbnail size: `small` 34px, `medium` 40px, `large` 50px, `xlarge` 186px."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Product row loading","html":"<div aria-busy=\"true\" style=\"display:flex;gap:var(--cm-space-12);align-items:center;max-width:520px\">\n <cm-skeleton variant=\"thumbnail\" size=\"large\"></cm-skeleton>\n <cm-skeleton lines=\"2\" style=\"flex:1\"></cm-skeleton>\n</div>"},{"title":"Thumbnail sizes","html":"<div style=\"display:flex;gap:var(--cm-space-20);align-items:flex-end;flex-wrap:wrap\">\n <cm-skeleton variant=\"thumbnail\" size=\"xlarge\"></cm-skeleton>\n <cm-skeleton variant=\"thumbnail\" size=\"large\"></cm-skeleton>\n <cm-skeleton variant=\"thumbnail\" size=\"medium\"></cm-skeleton>\n <cm-skeleton variant=\"thumbnail\" size=\"small\"></cm-skeleton>\n</div>"},{"title":"Block","html":"<cm-skeleton variant=\"block\" style=\"--cm-skeleton-height:90px;max-width:520px\"></cm-skeleton>"}],"do":["Match the shape of the content that will replace it.","Mark the loading region with `aria-busy=\"true\"` and remove it when content arrives.","Use `cm-skeleton-display` for a whole page."],"dont":["Don't use skeletons for actions that take under a second.","Don't mix skeletons and spinners for the same content."],"content":["Skeletons carry no text."],"accessibility":["Each skeleton is `aria-hidden`; announce loading on the region (`aria-busy`) or with `cm-skeleton-display`.","The pulse stops under reduced motion; in forced-colours mode the shapes get an outline.","Shapes are decorative, so they are not part of the contrast checks."],"related":["skeleton-display","empty-state"]},{"tag":"cm-skeleton-display","slug":"skeleton-display","name":"Skeleton display","react":"SkeletonDisplay","group":"Feedback","summary":"A whole-page loading placeholder laid out like a detail page.","lead":"An 80px page-header bar, then a main column (472, 90, 90 and 251px cards) and a 30% side column (five cards), 8px apart. On mobile the columns stack.","docs_url":"https://commmerce.com/commmerceui/#components--skeleton-display","properties":[{"attribute":"layout","property":"layout","type":"'two-column' | 'one-column'","default":"'two-column'","description":"`two-column` (main cards plus a side column, as on detail pages) or `one-column` (lists and settings)."},{"attribute":"navigation","property":"navigation","type":"boolean","default":"false","description":"Adds a 250px side-navigation placeholder on the left. Admin chrome: for Commmerce products only, not for apps."},{"attribute":"label","property":"label","type":"string","description":"What screen readers announce while it shows. Default: the built-in string `loading` (\"Loading\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Detail page","html":"<cm-skeleton-display style=\"max-width:760px\"></cm-skeleton-display>"},{"title":"One column","html":"<cm-skeleton-display layout=\"one-column\" style=\"max-width:760px\"></cm-skeleton-display>"}],"do":["Show it only for the first load of a page; later updates should keep the old content visible.","Pick the layout closest to the page that will load."],"dont":["Don't use `navigation` in apps: the side navigation is admin chrome, for Commmerce products only.","Don't leave it up if loading fails: replace it with an error banner."],"content":["Change `label` if \"Loading\" is too vague, e.g. \"Loading order\"."],"accessibility":["Announces its `label` once through a status region and sets `aria-busy`; the shapes are hidden.","Pulse stops under reduced motion.","Card widths are 70/30 of the space, and the 250px navigation placeholder is opt-in."],"responsive":["When the window is 768px wide or less, the navigation column is hidden, the body is one column and the header placeholder is 60px tall instead of 80px."],"related":["skeleton","page-header"]},{"tag":"cm-comment-box","slug":"comment","name":"Comment","react":"CommentBox","group":"Feedback","summary":"Staff notes on an order or customer: a box to write one and the timeline of earlier ones.","lead":"A 16px semibold \"Comments\" heading, a 128px text box and a primary \"Post comment\" button, 12px apart. Each comment is a bordered 6px-radius box with the time, the text and the author, 12px padding and 8px between comments.","docs_url":"https://commmerce.com/commmerceui/#components--comment","properties":[{"attribute":"heading","property":"heading","type":"string","description":"Section title above the box. Default: the built-in string `heading` (\"Comments\")."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the text box. Default: the built-in string `label` (\"Add a comment\")."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Placeholder in the empty box."},{"attribute":"action","property":"action","type":"string","description":"Text of the post button. Default: the built-in string `action` (\"Post comment\")."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Current text in the box."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks typing and posting (for example while the comment saves)."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level of the title. Default 2."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"submit","description":"Posts the current text, as if Post was pressed."}],"slots":[{"name":"(default)","description":"Existing `cm-comment` elements, shown as a list under the box."}],"events":[{"name":"cm-submit","description":"When Post is pressed with text; `detail.value` is the trimmed text. Cancelable: the default clears the box."}],"parts":[{"tag":"cm-comment","react":"Comment","properties":[{"attribute":"author","property":"author","type":"string","default":"''","description":"Who wrote it (a staff name, \"System\" or an app name)."},{"attribute":"datetime","property":"datetime","type":"string","default":"''","description":"When it was written, as an ISO date-time (`2023-02-09T17:07`). Used for `<time datetime>`."},{"attribute":"time","property":"time","type":"string","default":"''","description":"The date as shown. Leave empty to format `datetime` in the viewer's locale."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The comment text."}],"events":[]}],"examples":[{"title":"Order comments","html":"<cm-comment-box style=\"max-width:720px\">\n <cm-comment author=\"Robinson Painatillo\" datetime=\"2023-02-09T17:07\" time=\"09-02-2023 05:07 PM\">Order status changed from processing to partially fulfilled.</cm-comment>\n <cm-comment author=\"System\" datetime=\"2023-02-09T16:40\" time=\"09-02-2023 04:40 PM\">Order cancelled: the payment confirmation period is over.</cm-comment>\n</cm-comment-box>"},{"title":"A single comment","html":"<cm-comment author=\"Robinson Painatillo\" datetime=\"2023-02-09T17:07\" style=\"max-width:400px\">Called the customer about the delivery address.</cm-comment>"}],"do":["Listen for `cm-submit`, save the text, then add a `cm-comment` for it. Call `preventDefault()` to keep the text if saving fails.","Set `disabled` while a comment saves.","Give `datetime` in ISO format so screen readers and browsers get the exact time."],"dont":["Don't use comments for system errors: use a banner.","Don't edit a posted comment in place without saying so."],"content":["Button: \"Post comment\".","Author is a person's name, \"System\" or the app's name."],"accessibility":["The box is a section named by its heading; the text box has its own label (\"Add a comment\").","Ctrl/⌘ + Enter posts; an empty box does not post and keeps focus in the box.","Comments inside the box form a list; each time is a `<time datetime>`.","Time and author are 12px `text-tertiary` (4.5:1 or more); the text box uses the `border-input` edge for contrast."],"responsive":["When the window is 640px wide or less, the text area starts 96px tall instead of 128px, and the post button moves to the end of the row."],"related":["text-field","card","info-panel","timeline"]},{"tag":"cm-smart-tips","slug":"smart-tip","name":"Smart tip","react":"SmartTips","group":"Feedback","summary":"Short linked tips that lead merchants to guides, with an optional tour banner.","lead":"A dark tour banner at least 56px tall, then a white card titled \"Smart tips\" with tip cards at least 88px tall: a 14px semibold title, a 13px grey description and a 32px round arrow that turns black on hover and focus.","docs_url":"https://commmerce.com/commmerceui/#components--smart-tip","properties":[{"attribute":"heading","property":"heading","type":"string","description":"Title above the tips. Default: the built-in string `heading` (\"Smart tips\")."},{"attribute":"tour-heading","property":"tourHeading","type":"string","default":"''","description":"Text of the dark tour banner (\"Take a tour of Commmerce\"). Leave empty for no banner."},{"attribute":"tour-action","property":"tourAction","type":"string","description":"Label of the tour banner's button. Default: the built-in string `tourAction` (\"Start\")."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level of the title. Default 2."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"`cm-smart-tip` elements."}],"events":[{"name":"cm-tour","description":"When the tour banner's button is pressed."}],"parts":[{"tag":"cm-smart-tip","react":"SmartTip","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Tip title, at most two short lines."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Where the tip leads."},{"attribute":"target","property":"target","type":"string","default":"''","description":"Link target. `_blank` adds `rel=\"noopener noreferrer\"` and tells screen readers it opens a new tab."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"One or two lines that say what the merchant gets from the guide."}],"events":[]}],"examples":[{"title":"Home page tips","html":"<cm-smart-tips tour-heading=\"Take a tour of Commmerce\" style=\"max-width:340px\">\n <cm-smart-tip heading=\"Manage your own online store\" href=\"#/components/smart-tip\">Handle shipping, taxes, payments and more in one place.</cm-smart-tip>\n <cm-smart-tip heading=\"Shipping and delivery\" href=\"#/components/smart-tip\">Set rates and delivery areas.</cm-smart-tip>\n <cm-smart-tip heading=\"Importing and exporting products\" href=\"#/components/smart-tip\">Move products in and out with a CSV file.</cm-smart-tip>\n</cm-smart-tips>"}],"do":["Keep three to six tips, most useful first.","Write the title as the outcome: \"Shipping and delivery\".","Use `target=\"_blank\"` only for help-centre pages outside the admin."],"dont":["Don't put actions that change data in a tip: link to the page that does it.","Don't show the tour banner after the merchant has taken the tour."],"content":["Titles at most two short lines; descriptions one or two lines.","The section title is \"Smart tips\", in sentence case."],"accessibility":["Each tip is one link, so it is one tab stop and its name is the title plus description.","Tips form a list inside a section named by its heading.","Links opening a new tab say so to screen readers.","The tour icon is the system `rocket` icon; the tour banner uses `bg-panel-header`."],"related":["card","banner"]},{"tag":"cm-pagination","slug":"pagination","name":"Pagination","react":"Pagination","group":"Lists","summary":"Moves through a long list or table one page at a time.","lead":"A 48px bar under a list or table, in 13px text and tabular numbers: \"Number of rows\" on the left, what is showing in the middle, and \"Page [n] of N\" with compact 32px previous and next arrows on the right. On phones (640px or less) only the page field and arrows remain, 36px tall; on touch screens the fields and arrows are 44px. Since 1.6 (before: 14px text in a 52px bar).","docs_url":"https://commmerce.com/commmerceui/#components--pagination","properties":[{"attribute":"page","property":"page","type":"number","default":"1","description":"Current page, starting at 1."},{"attribute":"total","property":"total","type":"number","default":"0","description":"Total number of items across all pages. 0 hides the summary."},{"attribute":"page-size","property":"pageSize","type":"number","default":"20","description":"Items per page."},{"attribute":"page-sizes","property":"pageSizes","type":"number[]","default":"[10, 20, 50, 100]","description":"Choices for \"Number of rows\". Empty hides the picker. JSON in the attribute: `page-sizes=\"[10,20,50]\"`."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Change it when a page has two paginations. Default: the built-in string `label` (\"Pagination\")."},{"attribute":"resource-name","property":"resourceName","type":"string","default":"''","description":"Plural noun used in the summary, e.g. \"products\": \"Showing 21–40 of 290 products\"."},{"attribute":"_draft","property":"_draft","type":"string | null","default":"null"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"pageCount","description":"Number of pages, at least 1."}],"methods":[{"name":"goTo","description":"Moves to a page (clamped to 1…pageCount) and fires `cm-page-change` if it changed."}],"slots":[],"events":[{"name":"cm-page-change","description":"`detail: { page }` when the merchant asks for another page."},{"name":"cm-page-size-change","description":"`detail: { pageSize }` when rows per page changes. `page` resets to 1."}],"parts":[],"examples":[{"title":"Under a product list","html":"<cm-pagination total=\"290\" page=\"2\" page-size=\"20\" resource-name=\"products\"></cm-pagination>"},{"title":"Without rows per page","description":"Set `page-sizes=\"[]\"` when the page size is fixed.","html":"<cm-pagination total=\"58\" page-size=\"20\" page-sizes=\"[]\" style=\"max-width:480px\"></cm-pagination>"}],"do":["Listen for `cm-page-change` and `cm-page-size-change`, load that page, then set `page` and `total`.","Keep the merchant's page and rows per page in the URL so Back works.","Put it directly under the list it controls."],"dont":["Don't use it for fewer than one page of items: hide it.","Don't use it inside a modal or picker with a few items: let the list scroll."],"content":["Summary reads \"Showing 21–40 of 290 products\"; set `resource-name` to the plural noun.","Labels are \"Number of rows\" and \"Page … of …\"."],"accessibility":["It is a navigation landmark named \"Pagination\"; give each one a different `label` if a page has two.","The summary is a polite live region, so screen readers hear the new range after a page change.","The page field takes a number and commits on Enter or when it loses focus; out-of-range numbers are clamped. Escape restores the current page.","Arrows are real buttons named \"Previous page\" and \"Next page\", disabled at the ends.","The rows and page fields use the `border-input` edge (3:1 or more); the bar has no shadow of its own (put it in a card)."],"responsive":["When the window is 640px wide or less, rows per page and the \"Showing…\" summary are hidden: only the page field and the previous and next arrows remain, the arrows at either end, 36px tall instead of 32px.","On touch screens (any width) the fields and arrows are 44px."],"related":["resource-list","table-header","status-tabs"]},{"tag":"cm-status-tabs","slug":"status-tabs","name":"Status tabs","react":"StatusTabs","group":"Lists","summary":"Filters a list by status, with a count for each status.","lead":"Statuses in a 40px row of 14px medium labels, `space-24` apart, over a hairline. The chosen one is black and semibold with a 2px underline (black, or Commmerce blue in the refined look); the others are grey. A count sits after the label in a small neutral pill. `size=\"small\"` (13px, 32px row) is for view switches inside a card. Since 1.5 (before: 18px labels with counts in brackets).","docs_url":"https://commmerce.com/commmerceui/#components--status-tabs","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the chosen tab. Defaults to the first tab."},{"attribute":"tabs","property":"tabs","type":"Array<string | StatusTab>","default":"[]","description":"Tabs as strings or `{ value, label, count, disabled }`. Used instead of `<option>` children when set."},{"attribute":"controls","property":"controls","type":"string","default":"''","description":"Id of the list or panel the tabs filter (in the same document or shadow root as the tabs). Each tab is linked to it\nwith ARIA element reflection (`ariaControlsElements`), since an `aria-controls` id cannot point out of a shadow root.\nBrowsers without element reflection skip the link."},{"attribute":"size","property":"size","type":"'large' | 'small'","default":"'large'","description":"`large` (the default: 14px labels, page-level statuses) or `small` (13px, tighter, inside a card, e.g. review sorting)."},{"attribute":"mobile","property":"mobile","type":"'scroll' | 'select'","default":"'scroll'","description":"What the tabs become on screens 640px wide or less: `scroll` (default: the row scrolls sideways, with a fade at the\nedge that has more tabs) or `select` (a dropdown of the same choices, with the counts; one control instead of a long\nrow). Since 1.6."},{"attribute":"_slotted","property":"_slotted","type":"StatusTab[]","default":"[]"},{"attribute":"_more","property":"_more","type":"string","default":"''","description":"Which edges have more tabs past them: '' | 'start' | 'end' | 'both'."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"StatusTab[]","description":"The tabs in use, normalised."}],"methods":[{"name":"focus","description":"Focuses the selected tab (or the dropdown, when `mobile=\"select\"` shows it)."}],"slots":[{"name":"(default)","description":"`<option value=\"…\" count=\"23\">Label</option>` elements. `disabled` and `selected` are honoured."}],"events":[{"name":"change","description":"When the merchant picks another status (a tab, or the dropdown). Read `value`."}],"parts":[],"examples":[{"title":"Order statuses","html":"<cm-status-tabs controls=\"order-list\">\n <option value=\"all\" count=\"233\">All</option>\n <option value=\"unprocessed\" count=\"23\" selected>Unprocessed</option>\n <option value=\"processing\" count=\"23\">Processing</option>\n <option value=\"fulfilled\" count=\"23\">Fulfilled</option>\n <option value=\"delivered\" count=\"23\">Delivered</option>\n <option value=\"returned\" count=\"23\">Returned</option>\n <option value=\"cancelled\" count=\"23\">Cancelled</option>\n</cm-status-tabs>"},{"title":"On phones: a dropdown","description":"`mobile=\"select\"` shows the statuses as a dropdown when the window is 640px wide or less (try a phone width); wider, it is the usual row. It fires the same `change` event. Use it when there are more than four or five statuses. Since 1.6.","html":"<cm-status-tabs mobile=\"select\" aria-label=\"Task status\">\n <option value=\"date\" count=\"4\" selected>Needs a date</option>\n <option value=\"week\" count=\"12\">This week</option>\n <option value=\"later\" count=\"40\">Later</option>\n <option value=\"lost\" count=\"2\">Not interested</option>\n <option value=\"archived\">Archived</option>\n</cm-status-tabs>"},{"title":"Small, inside a card","html":"<cm-card heading=\"Reviews\" style=\"max-width:420px\">\n <cm-status-tabs size=\"small\">\n <option value=\"newest\" count=\"233\">Newest</option>\n <option value=\"highest\" count=\"33\">Highest rating</option>\n <option value=\"lowest\">Lowest rating</option>\n </cm-status-tabs>\n</cm-card>"}],"do":["Put it directly above the list it filters and set `controls` to the list's id.","Start with \"All\".","Update counts when the list changes."],"dont":["Don't use it to move between pages: use links or a page header.","Don't use it for more than about eight statuses; use a filter instead.","Don't hide a status with zero items; show a count of 0."],"content":["One or two words per status, in sentence case.","Counts are whole numbers; they are formatted for the merchant's locale."],"accessibility":["It is an ARIA tab list: one tab stop, ←/→ move and select, Home/End jump to the ends. Disabled tabs are skipped.","Each tab's name includes its count, so screen readers hear \"Unprocessed, 23, tab, 2 of 7\".","The chosen tab is marked with `aria-selected`, not only colour and underline.","Differs from Figma: unselected tabs are `text-tertiary` (#707070) because Figma's #9E9E9E is 2.7:1 on white; Figma's mobile row is fixed width, ours scrolls sideways."],"responsive":["Tabs stay on one line; when they don't fit the component's width, the row scrolls sideways, snaps to a tab and fades out at the edge that has more tabs past it (since 1.6), so it reads as a row that scrolls.","When the window is 640px wide or less, tabs are `space-16` apart instead of `space-24`. With `mobile=\"select\"` they become a dropdown of the same choices (with counts) instead (since 1.6)."],"related":["resource-list","pagination","option-group"]},{"tag":"cm-table-header","slug":"table-header","name":"Table header","react":"TableHeader","group":"Lists","summary":"The grey label bar at the top of a table or list, with sorting and select all.","lead":"A 40px `bg-hover` bar with a `border-subtle` edge and rounded top corners, the heading row of the table standard. Column names are 12px semibold `text-tertiary`, in sentence case; with `selectable` a 20px select-all box leads the row. In a resource list the bar runs edge to edge with hairlines above and below, as tall as the list's selection row. Rows below share its grid through `--cm-table-columns`. Since 1.6 (before: 32px, 12px medium).","docs_url":"https://commmerce.com/commmerceui/#components--table-header","properties":[{"attribute":"columns","property":"columns","type":"Array<string | TableColumn>","default":"[]","description":"Columns as strings or `{ key, label, sortable, align, hidden }`. Used instead of `<option>` children when set."},{"attribute":"sort","property":"sort","type":"string","default":"''","description":"Key of the sorted column."},{"attribute":"direction","property":"direction","type":"'ascending' | 'descending'","default":"'ascending'","description":"Sort direction of the `sort` column."},{"attribute":"selectable","property":"selectable","type":"boolean","default":"false","description":"Adds a leading \"select all\" checkbox column."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Select-all box is ticked."},{"attribute":"indeterminate","property":"indeterminate","type":"boolean","default":"false","description":"Select-all box shows a dash: some rows are selected."},{"attribute":"resource-rows","property":"resourceRows","type":"'plain' | 'selectable' | undefined","description":"Lines the columns up with `cm-resource-item` rows: `plain` matches the rows' padding, `selectable` also leaves\nroom for the rows' checkboxes. Set by `cm-resource-list` on a header in its `header` slot (from its own\n`selectable`); you don't need to set it. Unset (the default) is the standalone bar."},{"attribute":"_slotted","property":"_slotted","type":"TableColumn[]","default":"[]"},{"attribute":"_inTable","property":"_inTable","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"TableColumn[]","description":"The columns in use, normalised."}],"methods":[],"slots":[{"name":"(default)","description":"`<option value=\"key\" sortable align=\"end\">Label</option>` elements."}],"events":[{"name":"cm-sort","description":"`detail: { key, direction }` when a sortable column is clicked. Set `sort` and `direction` yourself."},{"name":"cm-select-all","description":"`detail: { checked }` when the select-all box is toggled."}],"parts":[],"examples":[{"title":"Products table","html":"<div role=\"table\" aria-label=\"Products\" style=\"--cm-table-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 80px\">\n <cm-table-header sort=\"price\">\n <option value=\"product\" sortable>Product</option>\n <option value=\"sku\">SKU</option>\n <option value=\"code\">Code</option>\n <option value=\"price\" sortable>Selling price</option>\n <option value=\"stock\" sortable>Stock</option>\n <option value=\"category\">Category</option>\n <option value=\"status\">Status</option>\n <option value=\"action\" align=\"end\">Action</option>\n </cm-table-header>\n</div>"},{"title":"With select all, on a phone","html":"<div role=\"table\" aria-label=\"Products\" style=\"max-width:384px;--cm-table-columns: 2fr 1fr 1fr 1fr\">\n <cm-table-header selectable indeterminate>\n <option>Product name</option><option>SKU</option><option>Code</option><option align=\"end\">Price</option>\n </cm-table-header>\n</div>"},{"title":"In a resource list","description":"Put it in the `header` slot of a `cm-resource-list` and give each row `columns`, with one element per column. The list lines the headings up with the cells, leaving room for the rows' checkboxes when it is `selectable`. Don't set `selectable` on the header here: the list puts its own select-all box in the header's checkbox column. The headings form a plain bar (the rows are a list, not a table), and sort buttons say their state.","html":"<cm-resource-list selectable resource-name=\"lead\" style=\"--cm-table-columns: 1.4fr 1.2fr 1fr 110px\">\n <cm-table-header slot=\"header\" sort=\"name\">\n <option value=\"name\" sortable>Name</option><option value=\"company\">Company</option><option value=\"owner\">Owner</option><option value=\"status\">Status</option>\n </cm-table-header>\n <cm-resource-item value=\"l1\" label=\"Asha Rao\" columns><strong>Asha Rao</strong><span>Rao Textiles</span><span>Rahul Kumar</span><span><cm-badge tone=\"information\">New</cm-badge></span></cm-resource-item>\n <cm-resource-item value=\"l2\" label=\"Ben Cole\" columns><strong>Ben Cole</strong><span>Cole &amp; Sons</span><span>Meera Iyer</span><span><cm-badge tone=\"success\">Contacted</cm-badge></span></cm-resource-item>\n</cm-resource-list>"}],"do":["Put it inside an element with `role=\"table\"` (or a `<table>` wrapper) so it becomes a real header row.","Set `--cm-table-columns` once on the table and use the same grid for the rows, with `column-gap: var(--cm-space-20)` and `min-width: 0` on the cells (or `fr` columns written `minmax(0, 1fr)`).","Above a `cm-resource-list`, put it in the list's `header` slot and set `columns` on the rows: the list lines everything up, checkbox column included.","Listen for `cm-sort`, sort the data, then set `sort` and `direction`."],"dont":["Don't make every column sortable: only those merchants scan by (name, price, stock, date).","Don't leave an icon-only column unnamed: add an option with `hidden` so screen readers hear \"Actions\".","Don't set `selectable` on a header inside a selectable `cm-resource-list`: there would be two select-all boxes. The list already puts one in the header's checkbox column.","Don't use the rows' `actions` or `media` slots with column headings: put buttons and thumbnails in a column instead, so the grid stays the same width as the header."],"content":["Column names in sentence case, one or two words: \"Selling price\", not \"Selling Price\"."],"accessibility":["Inside a table it renders `row` and `columnheader` roles; sorted columns carry `aria-sort`.","Outside a table it is a plain bar and sort buttons say \"sortable\" or \"sorted ascending/descending\".","The select-all box is named \"Select all\" and shows a mixed state when some rows are selected.","In a `cm-resource-list` it stays a plain bar: the rows are a list of resources, not table rows, so the headings are a visual guide and each row's checkbox and link carry its name.","The fill is `bg-hover`; sort arrows appear on hover and on the sorted column."],"related":["resource-list","pagination","checkbox","data-table"]},{"tag":"cm-data-table","slug":"data-table","name":"Data table","react":"DataTable","group":"Lists","summary":"Shows numbers and facts in rows and columns, for reports and lists of records.","lead":"A real table built to the Commmerce table standard (since 1.6): a 40px heading row in 12px semibold `text-tertiary` on `bg-hover`; 48px body rows (40px compact) divided by `border-subtle` lines; cells padded 12px across and 10px down in 13px text and tabular figures. `numeric`, `money` and `actions` columns are right-aligned, numbers and dates never wrap, and text ends in \"…\" with the full value on hover. Columns can sort, resize and be shown or hidden; rows can carry actions; the heading row can stick while the page scrolls; and on phones each table picks cards, sideways scroll or priority columns.","docs_url":"https://commmerce.com/commmerceui/#components--data-table","properties":[{"attribute":"columns","property":"columns","type":"DataTableColumn[]","default":"[]","description":"The columns, in order."},{"attribute":"rows","property":"rows","type":"DataTableRow[]","default":"[]","description":"The rows: objects keyed by column `key`. Values are shown as text."},{"attribute":"totals","property":"totals","type":"DataTableRow | null","default":"null","description":"A totals row shown at the bottom (`<tfoot>`), keyed like a row. Leave a key out for an empty cell."},{"attribute":"caption","property":"caption","type":"string","default":"''","description":"What the table shows, e.g. \"Sales by day\". Every table needs one; it names the table for screen readers."},{"attribute":"caption-hidden","property":"captionHidden","type":"boolean","default":"false","description":"Keeps the caption for screen readers but hides it, when a card or page heading already says it."},{"attribute":"sort","property":"sort","type":"string","default":"''","description":"Key of the sorted column. Empty: rows stay in the order given."},{"attribute":"direction","property":"direction","type":"SortDirection","default":"'ascending'","description":"Direction of the sorted column."},{"attribute":"sort-mode","property":"sortMode","type":"'auto' | 'manual'","default":"'auto'","description":"`auto`: the table sorts its own rows. `manual`: it only fires `cm-sort` (sort on your server, then set `rows`)."},{"attribute":"sticky-header","property":"stickyHeader","type":"boolean","default":"false","description":"Keeps the heading row in view while the rows scroll: inside `--cm-data-table-max-height` when you set one,\notherwise under the top of the page or of the nearest scrolling box (plus `--cm-data-table-sticky-top`)."},{"attribute":"sticky-first-column","property":"stickyFirstColumn","type":"boolean","default":"false","description":"Keeps the first column visible while the table scrolls sideways (on narrow screens)."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows placeholder rows and marks the table busy."},{"attribute":"loading-rows","property":"loadingRows","type":"number","default":"5","description":"How many placeholder rows `loading` shows."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height (since 1.6): `comfortable` 48px rows or `compact` 40px rows. Unset: the nearest `data-cm-density` on an\nancestor, else comfortable. On touch screens rows are at least 44px tall either way."},{"attribute":"mobile","property":"mobile","type":"'scroll' | 'cards' | 'priority'","default":"'scroll'","description":"What the table does when it is 640px wide or less (since 1.6): `scroll` keeps every column, scrolls sideways and\nsays so (\"Scroll for more\", faded edges); `cards` shows each row as a card of label and value pairs with the primary\ncolumn as its title and the actions at the bottom; `priority` hides `priority: 'low'` columns and gives each row a\n\"View all fields\" button that shows them. Pick one per table: see the \"Tables on phones\" pattern."},{"attribute":"row-actions","property":"rowActions","type":"'hover' | 'always'","default":"'hover'","description":"`hover` (default): an `actions` column's buttons appear when the row is hovered or has focus (always on touch screens). `always`: always shown."},{"attribute":"resizable","property":"resizable","type":"boolean","default":"false","description":"Adds a resize handle to each heading: drag it, or focus it and press the left and right arrow keys (16px a press)."},{"attribute":"column-picker","property":"columnPicker","type":"boolean","default":"false","description":"Adds a \"Columns\" button above the table that shows and hides columns."},{"attribute":"_light","property":"_light","type":"boolean","default":"false"},{"attribute":"_announce","property":"_announce","type":"string","default":"''"},{"attribute":"_widths","property":"_widths","type":"Record<string, number>","default":"{}"},{"attribute":"_expanded","property":"_expanded","default":"new Set<DataTableRow>()"},{"attribute":"_picker","property":"_picker","type":"boolean","default":"false"},{"attribute":"_overflows","property":"_overflows","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"sortedRows","type":"DataTableRow[]","description":"The rows in display order: sorted when `sort` is set and `sort-mode` is `auto`."},{"property":"visibleColumns","type":"DataTableColumn[]","description":"The columns shown: every column whose `visible` isn't `false`."}],"methods":[],"slots":[{"name":"(default)","description":"Optional: a native `<table>` to style instead of `columns`/`rows`."},{"name":"empty","description":"Shown instead of the rows when `rows` is empty, e.g. a `cm-empty-state`."}],"events":[{"name":"cm-row-action","description":"`detail: { action, row, index }` when a button in an `actions` column is pressed: the action's `value`, the row object and its index in `rows`."},{"name":"cm-column-resize","description":"`detail: { key, width }` when the merchant resizes a column (`resizable`), in pixels. Store it and pass it back as the column's `width`."},{"name":"cm-columns-change","description":"`detail: { key, visible, columns }` when the merchant shows or hides a column with the column picker. `columns` is the new array (the table has already switched to it); store it to keep the choice."},{"name":"cm-sort","description":"`detail: { key, direction }` when a sortable heading is clicked. Cancelable: call `preventDefault()` to stop the table sorting itself. With `sort-mode=\"manual\"` it never sorts itself."}],"parts":[],"examples":[{"title":"Sales report with totals","description":"Give it `columns`, `rows` and `totals`. `numeric` and `money` columns align right; sortable columns sort themselves.","html":"<cm-data-table caption=\"Sales by day, 1 to 5 November\" sort=\"day\"\n columns='[{\"key\":\"day\",\"label\":\"Day\",\"type\":\"date\",\"sortable\":true},{\"key\":\"orders\",\"label\":\"Orders\",\"type\":\"numeric\",\"sortable\":true},{\"key\":\"items\",\"label\":\"Items sold\",\"type\":\"numeric\"},{\"key\":\"sales\",\"label\":\"Net sales\",\"type\":\"money\",\"sortable\":true}]'\n rows='[{\"day\":\"2026-11-01\",\"orders\":38,\"items\":61,\"sales\":\"Rs. 48,210\"},{\"day\":\"2026-11-02\",\"orders\":45,\"items\":70,\"sales\":\"Rs. 56,980\"},{\"day\":\"2026-11-03\",\"orders\":29,\"items\":41,\"sales\":\"Rs. 33,150\"},{\"day\":\"2026-11-04\",\"orders\":52,\"items\":88,\"sales\":\"Rs. 71,400\"},{\"day\":\"2026-11-05\",\"orders\":41,\"items\":66,\"sales\":\"Rs. 52,075\"}]'\n totals='{\"day\":\"Total\",\"orders\":205,\"items\":326,\"sales\":\"Rs. 2,61,815\"}'></cm-data-table>"},{"title":"Accounts with row actions","description":"An `actions` column (`type: \"actions\"`) lists buttons for every row; they appear when the row is hovered or has keyboard focus, and are always shown on touch screens (`row-actions=\"always\"` shows them everywhere). Each button is named with its row for screen readers (\"Open, Ravi Stores\") and fires `cm-row-action` with the action, the row and its index. The long account name ends in \"…\": hover it to read it all.","html":"<cm-data-table caption=\"Accounts up for renewal\"\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true,\"width\":220},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\",\"sortable\":true},{\"key\":\"actions\",\"label\":\"Actions\",\"type\":\"actions\",\"actions\":[{\"label\":\"Open\",\"value\":\"open\"},{\"label\":\"Snooze\",\"value\":\"snooze\",\"icon\":\"clock\",\"iconOnly\":true}]}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>"},{"title":"Comfortable and compact density","description":"Rows are 48px (comfortable) or 40px (compact); the heading row stays 40px. Set `density` on one table, or `data-cm-density` on any ancestor to switch every table and resource list on a screen. Try the switch.","html":"<div style=\"display:grid;gap:var(--cm-space-16)\">\n <cm-segmented-control size=\"small\" label=\"Density\" data-density-for=\"density-demo\">\n <option value=\"comfortable\" selected>Comfortable</option>\n <option value=\"compact\">Compact</option>\n </cm-segmented-control>\n <div id=\"density-demo\" data-cm-density=\"comfortable\" style=\"display:grid;gap:var(--cm-space-16)\">\n <cm-data-table caption=\"Accounts\" caption-hidden\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>\n <cm-resource-list resource-name=\"account\">\n <cm-resource-item value=\"a1\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Ravi Stores</cm-resource-item>\n <cm-resource-item value=\"a2\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Delhi Spice Co.</cm-resource-item>\n </cm-resource-list>\n </div>\n</div>"},{"title":"Sticky heading row in a 400px box","description":"`sticky-header` keeps the headings in view under the top of the nearest scrolling box, or of the page when nothing else scrolls (add `--cm-data-table-sticky-top` to stick under an app header). Scroll the box. To scroll inside the table itself, set `--cm-data-table-max-height`.","html":"<div tabindex=\"0\" role=\"region\" aria-label=\"Renewals, scrolling\" style=\"height:400px;overflow:auto;border:var(--cm-border-1) solid var(--cm-border-subtle);border-radius:var(--cm-radius-md);padding-inline:var(--cm-space-8)\">\n <cm-data-table caption=\"All renewals\" sticky-header\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 12,750\"},{\"name\":\"Blue Pottery House\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-02\",\"value\":\"Rs. 17,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-03\",\"value\":\"Rs. 21,250\"},{\"name\":\"Mumbai Mart\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-04\",\"value\":\"Rs. 25,500\"},{\"name\":\"Pune Paper Co.\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-05\",\"value\":\"Rs. 29,750\"},{\"name\":\"Goa Gifts\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-06\",\"value\":\"Rs. 34,000\"},{\"name\":\"Surat Silks\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-07\",\"value\":\"Rs. 38,250\"},{\"name\":\"Indore Snacks\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-08\",\"value\":\"Rs. 42,500\"},{\"name\":\"Nagpur Oranges\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 46,750\"},{\"name\":\"Agra Leather\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-10\",\"value\":\"Rs. 51,000\"},{\"name\":\"Vizag Seafoods\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-11\",\"value\":\"Rs. 55,250\"},{\"name\":\"Hubli Cottons\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-12\",\"value\":\"Rs. 59,500\"},{\"name\":\"Kochi Coir Works\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-13\",\"value\":\"Rs. 63,750\"},{\"name\":\"Mysuru Silk House\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-14\",\"value\":\"Rs. 68,000\"},{\"name\":\"Patna Pickles\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-15\",\"value\":\"Rs. 72,250\"},{\"name\":\"Ranchi Crafts\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-16\",\"value\":\"Rs. 76,500\"}]'></cm-data-table>\n</div>"},{"title":"Resize and choose columns","description":"`resizable` adds a handle to each heading: drag it, or focus it (Tab) and press ← and → to change the width 16px at a time; each change is announced and fires `cm-column-resize`. `column-picker` adds a Columns button that shows and hides columns (`visible: false` starts one hidden) and fires `cm-columns-change` with the new `columns`; store both to keep the merchant's layout.","html":"<cm-data-table caption=\"Accounts\" resizable column-picker\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"width\":200},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"stage\",\"label\":\"Stage\",\"visible\":false},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>"},{"title":"On a phone: cards","description":"`mobile=\"cards\"`: at 640px or less (the table's own width; here a 390px box) each row becomes a card: the primary column is its title, the other columns label and value pairs, and the actions sit at the bottom, always visible. Use it for short lists people act on, one record at a time.","html":"<div style=\"max-width:390px\">\n <cm-data-table caption=\"At risk\" mobile=\"cards\"\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"stage\",\"label\":\"Stage\",\"priority\":\"low\"},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\",\"sortable\":true},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\",\"sortable\":true},{\"key\":\"actions\",\"label\":\"Actions\",\"type\":\"actions\",\"actions\":[{\"label\":\"Open\",\"value\":\"open\"},{\"label\":\"Snooze\",\"value\":\"snooze\"}]}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>\n</div>"},{"title":"On a phone: scroll","description":"`mobile=\"scroll\"` (the default) keeps every column and scrolls sideways, and says so: the far edge fades and \"Scroll for more\" shows under the table until the end is reached. `sticky-first-column` keeps each row's name in view. Use it when people compare across columns.","html":"<div style=\"max-width:390px\">\n <cm-data-table caption=\"Team\" mobile=\"scroll\" sticky-first-column\n columns='[{\"key\":\"name\",\"label\":\"Name\"},{\"key\":\"role\",\"label\":\"Role\"},{\"key\":\"region\",\"label\":\"Region\"},{\"key\":\"accounts\",\"label\":\"Accounts\",\"type\":\"numeric\"},{\"key\":\"visits\",\"label\":\"Visits this month\",\"type\":\"numeric\"},{\"key\":\"last\",\"label\":\"Last active\",\"type\":\"date\"}]'\n rows='[{\"name\":\"Asha Rao\",\"role\":\"Field sales\",\"region\":\"Bengaluru\",\"accounts\":42,\"visits\":18,\"last\":\"2026-11-16\"},{\"name\":\"Meera Iyer\",\"role\":\"Account manager\",\"region\":\"Chennai\",\"accounts\":35,\"visits\":11,\"last\":\"2026-11-15\"},{\"name\":\"Rahul Kumar\",\"role\":\"Field sales\",\"region\":\"Delhi\",\"accounts\":51,\"visits\":22,\"last\":\"2026-11-17\"}]'></cm-data-table>\n</div>"},{"title":"On a phone: priority columns","description":"`mobile=\"priority\"` hides columns marked `priority: \"low\"` at 640px or less, and gives each row a \"View all fields\" button that shows them under the row. Use it when two or three columns tell most of the story.","html":"<div style=\"max-width:390px\">\n <cm-data-table caption=\"Renewals\" mobile=\"priority\"\n columns='[{\"key\":\"name\",\"label\":\"Account\"},{\"key\":\"owner\",\"label\":\"Owner\",\"priority\":\"low\"},{\"key\":\"stage\",\"label\":\"Stage\",\"priority\":\"low\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>\n</div>"},{"title":"Inside a card, wide on a phone","description":"The card heading names the table, so the caption is kept for screen readers only. `sticky-first-column` keeps the location in view while the merchant scrolls sideways.","html":"<cm-card heading=\"Stock by location\" flush style=\"max-width:384px\">\n <cm-data-table caption=\"Stock by location\" caption-hidden sticky-first-column\n columns='[{\"key\":\"location\",\"label\":\"Location\",\"sortable\":true},{\"key\":\"on_hand\",\"label\":\"On hand\",\"type\":\"numeric\",\"sortable\":true},{\"key\":\"committed\",\"label\":\"Committed\",\"type\":\"numeric\"},{\"key\":\"available\",\"label\":\"Available\",\"type\":\"numeric\"},{\"key\":\"incoming\",\"label\":\"Incoming\",\"type\":\"numeric\"}]'\n rows='[{\"location\":\"Bengaluru warehouse\",\"on_hand\":240,\"committed\":32,\"available\":208,\"incoming\":100},{\"location\":\"Indiranagar store\",\"on_hand\":18,\"committed\":2,\"available\":16,\"incoming\":0},{\"location\":\"Koramangala store\",\"on_hand\":7,\"committed\":0,\"available\":7,\"incoming\":24}]'></cm-data-table>\n</cm-card>"},{"title":"Server-rendered table","description":"In PHP or EJS, write a native `<table>` inside it and it is styled to match. Mark number cells with `data-type=\"numeric\"`. Add `data-sort=\"text|numeric|money|date\"` to a heading to let the merchant sort that column in the browser; give cells a `data-value` when their text is formatted (money, dates). Use `sort-mode=\"manual\"` to sort on the server instead. The phone strategies work here too: cells get their heading as a label for `mobile=\"cards\"`, and headings marked `data-priority=\"low\"` hide with `mobile=\"priority\"` (link each row to its record instead of View all fields). Mark an actions column `data-type=\"actions\"`.","html":"<cm-data-table mobile=\"cards\">\n <table>\n <caption>Order lines</caption>\n <thead><tr><th scope=\"col\" data-sort=\"text\">Product</th><th scope=\"col\" data-sort=\"numeric\">Quantity</th><th scope=\"col\" data-sort=\"money\">Amount</th></tr></thead>\n <tbody>\n <tr><td>Ceramic mug</td><td data-type=\"numeric\">2</td><td data-type=\"money\" data-value=\"798\">Rs. 798</td></tr>\n <tr><td>Linen apron</td><td data-type=\"numeric\">1</td><td data-type=\"money\" data-value=\"1250\">Rs. 1,250</td></tr>\n </tbody>\n <tfoot><tr><td>Total</td><td data-type=\"numeric\">3</td><td data-type=\"money\">Rs. 2,048</td></tr></tfoot>\n </table>\n</cm-data-table>"}],"do":["Use it for reports and lists of records: sales by day, stock by location, accounts, tasks, renewals.","Give every table a `caption`; hide it with `caption-hidden` when a heading above already says it.","Use `numeric` or `money` for numbers so they line up, and `date` for dates so they sort and never wrap.","Pick a phone strategy for every table (`mobile`) and say why in the review: see Tables on phones.","Put row buttons in an `actions` column (one or two short verbs) so they line up at the end and appear on hover and focus.","Store `cm-column-resize` and `cm-columns-change` (for example per user) and pass the widths and `visible` flags back in `columns`.","With thousands of rows, sort on the server: `sort-mode=\"manual\"`, listen for `cm-sort`, then set `rows`.","For long text such as notes or a list of signals, set `lines: 2` (or 3) on the column so rows stay compact: the text wraps onto up to that many lines and ends in \"…\", with the full value on hover. In a server-rendered table, put `data-lines=\"1\"` to `\"4\"` on any element inside a cell (for a list of signals, one per item: `<li><div data-lines=\"1\">…</div></li>`); one-line items are capped at `--cm-data-table-cell-max-width` (320px)."],"dont":["Don't use it for lists merchants select and act on in bulk (products, orders, customers): use Resource list, which has selection and bulk actions.","Don't put more than two buttons in a row: link the row to its record for everything else.","Don't make every column sortable: only those merchants scan by.","Don't mix densities on one screen: set `data-cm-density` once on the page.","Don't hide the column that names the rows: the column picker keeps the primary column."],"content":["Column headings in sentence case, one or two words: \"Net sales\", not \"NET SALES\".","Write money the same way in every row and in the totals (\"Rs. 1,250\").","Label the totals row \"Total\"."],"accessibility":["A native `<table>`: a caption, column headers with `scope=\"col\"` and the first cell of each row as a row header, so screen readers read \"Bengaluru warehouse, Available, 208\".","Text cut off with \"…\" is cut off visually only: screen readers read the whole value, and the mouse shows it on hover.","Row actions are hidden with opacity only: they stay in the tab order and the accessibility tree, show as soon as the row has focus, and are always visible on touch screens and in forced colours. Each is named with its row (\"Open, Ravi Stores\").","Resize handles are focusable separators named \"Resize Owner column\" with the width as their value; ← and → change it by 16px (mirrored in right-to-left) and the new width is announced.","The column picker is a button with `aria-expanded` that opens a group of checkboxes (\"Show columns\"); Esc closes it and returns focus to the button.","Cards (`mobile=\"cards\"`) are a list named by the caption, with each field as a term and value. \"View all fields\" is a button with `aria-expanded` that controls the row of extra fields.","\"Scroll for more\" and the faded edges are visual only; a table that scrolls sideways is a focusable region named by its caption, so keyboard users can scroll it.","Sortable headings are buttons inside the column header, which carries `aria-sort`. Every sort is also announced politely (\"Sorted by Orders, descending\"), because screen readers don't reliably read `aria-sort` changes; in `manual` mode the announcement waits until you set `sort` and `direction`.","Cell values are always shown as text, never as HTML.","A table with a sticky header or first column scrolls in a focusable region named by its caption, so keyboard users can scroll it.","While `loading`, the table is `aria-busy` and the placeholders are hidden from screen readers."],"responsive":["Judged by the table's own width, not the window's: at 640px or less the table follows its `mobile` strategy. `scroll` (default): it keeps every column and scrolls sideways, with a faded edge and \"Scroll for more\" under it while there is more to see. `cards`: each row becomes a card. `priority`: `priority: 'low'` columns are hidden and each row gets \"View all fields\". See Tables on phones.","With `sticky-first-column`, the first column stays visible while the table scrolls sideways.","On touch screens rows are at least 44px tall and row actions are always shown."],"related":["resource-list","table-header","pagination","empty-state"]},{"tag":"cm-resource-list","slug":"resource-list","name":"Resource list","react":"ResourceList","group":"Lists","summary":"Lists products, orders or customers, with bulk selection and actions.","lead":"56px rows with a 16px checkbox, an optional 40px thumbnail and 14px text, divided by `border-subtle` lines; `density=\"compact\"` (or `data-cm-density=\"compact\"` on any ancestor) makes them 40px with a 32px thumbnail. Hovered and selected rows turn `bg-hover`. A selectable list starts with a 40px header row (32px before 1.6), as tall as a table's heading row: the select-all box, lined up with the rows' checkboxes, and a small chevron menu (this page, all matching, none). Once rows are ticked the same row shows \"2 products selected\", a link to select every match and the bulk actions; nothing is added above the list. With a `cm-table-header` in the `header` slot, the header is that row: the box sits in its checkbox column and the selection covers the column names while rows are ticked. Since 1.5 (before: a 40px bordered Select button on a row of its own).","docs_url":"https://commmerce.com/commmerceui/#components--resource-list","properties":[{"attribute":"selectable","property":"selectable","type":"boolean","default":"false","description":"Rows get checkboxes and the selection toolbar appears."},{"attribute":"total","property":"total","type":"number","default":"0","description":"Number of resources matching the current filter across all pages. When higher than the rows shown, offers \"Select all\"."},{"attribute":"resource-name","property":"resourceName","type":"string","description":"Singular noun, e.g. \"product\". Default: the built-in string `resourceName` (\"item\")."},{"attribute":"resource-name-plural","property":"resourceNamePlural","type":"string","default":"''","description":"Plural noun. Defaults to the singular plus \"s\" (or the built-in `resourceNamePlural`, \"items\", when `resource-name` isn't set)."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Dims the rows and shows a spinner while results load."},{"attribute":"all-selected","property":"allSelected","type":"boolean","default":"false","description":"Every matching resource is selected, not just the rows on this page."},{"attribute":"hide-select-menu","property":"hideSelectMenu","type":"boolean","default":"false","description":"Hides the menu next to the select box (select this page, select all matching, select none)."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of the list, e.g. \"Products\". Defaults to the plural noun."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height (since 1.6): `comfortable` 56px rows with 40px thumbnails, or `compact` 40px rows with 32px thumbnails.\nUnset: the nearest `data-cm-density` on an ancestor, else comfortable. On touch screens rows are at least 44px tall."},{"attribute":"mobile","property":"mobile","type":"'columns' | 'stack'","default":"'columns'","description":"How rows with `columns` (and a `cm-table-header` in the `header` slot) lay out on phones, 640px or less (since 1.13).\n`columns` (default): every column stays on the row's one line. `stack`: each row's first cell gets a line of its\nown and the other cells follow on the next line; the header's column names wrap the same way, so sorting still works.\nUse `stack` when the columns can't fit a phone."},{"attribute":"_count","property":"_count","type":"number","default":"0"},{"attribute":"_rows","property":"_rows","type":"number","default":"0"},{"attribute":"_hasHeader","property":"_hasHeader","type":"boolean","default":"false"},{"attribute":"_hasTable","property":"_hasTable","type":"boolean","default":"false"},{"attribute":"_hasActions","property":"_hasActions","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"CmResourceItem[]","description":"The `cm-resource-item` rows."},{"property":"selected","type":"string[]","description":"Values of the selected rows on this page."}],"methods":[{"name":"selectPage","description":"Ticks or unticks every enabled row on this page."},{"name":"selectAll","description":"Selects every matching resource (`total`), including rows on other pages."},{"name":"clearSelection","description":"Clears the selection."}],"slots":[{"name":"(default)","description":"`cm-resource-item` rows."},{"name":"header","description":"A `cm-table-header` (or anything) above the rows. A `cm-table-header` here is lined up with the rows, checkbox column included, and shares its row with the select-all box."},{"name":"bulk-actions","description":"Buttons that act on the selection, e.g. \"Bulk orders\". Shown once a row is selected, in the header row: use `size=\"slim\"` buttons (32px, in the 40px row)."},{"name":"actions","description":"Buttons at the end of the header row, e.g. \"Customise columns\". With a slotted header they get a row of their own above it."},{"name":"empty","description":"Shown instead of the rows when there are none, e.g. a `cm-empty-state`."}],"events":[{"name":"cm-selection-change","description":"`detail: { selected, all }`: values of the selected rows, and whether every matching resource (all `total`) is selected."}],"parts":[{"tag":"cm-resource-item","react":"ResourceItem","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the row in the list's `selected` array."},{"attribute":"selected","property":"selected","type":"boolean","default":"false","description":"The row is ticked."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"The row cannot be selected or opened."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the row a link to the resource's page."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Name for the checkbox and link, e.g. the product name. Defaults to the row's text."},{"attribute":"selectable","property":"selectable","type":"boolean","default":"false","description":"Shows the checkbox. Set by the parent list from its own `selectable`."},{"attribute":"columns","property":"columns","type":"boolean","default":"false","description":"Lays the row's content out on the `--cm-table-columns` grid (set it on the list), one child element per column,\n`space-20` apart: the same grid as a `cm-table-header` in the list's `header` slot, so cells sit under their headings."},{"attribute":"mobile","property":"mobile","type":"'stack' | undefined","description":"With `columns`, how the row lays out on phones (640px or less). Set by the parent list from its own `mobile`.\n`stack`: the first cell gets a line of its own and the other cells follow on the next line, side by side.\nUnset: the columns stay on one line."},{"attribute":"actions","property":"actions","type":"'auto' | 'wrap' | 'inline'","default":"'auto'","description":"How the `actions` slot behaves when the row gets narrow (issue #31, since 1.6). `auto` (default): on phones (640px or\nless) the buttons wrap onto their own line under the content once the content would get narrower than 12rem.\n`wrap`: the same at any width. `inline`: the buttons always stay on the content's line (the 1.5 behaviour).\nRows with `columns` keep their actions inline unless `actions=\"wrap\"`."},{"attribute":"_hasActions","property":"_hasActions","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"name","description":"Accessible name: `label` or the row's text."}],"methods":[{"name":"toggle","description":"Ticks or unticks the row and fires `cm-resource-select`."}],"slots":[{"name":"(default)","description":"Row content: name, details, badges. To line up with a `cm-table-header`, set `columns` and give one element per column."},{"name":"media","description":"A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=\"\"` when the row names the product), an `<img>`, or a `cm-icon` (centred in the square, for settings and navigation lists)."},{"name":"actions","description":"Buttons at the end of the row. They do not toggle selection. When the row is too narrow for the content and the buttons (the content would get narrower than 12rem), they wrap onto a line of their own under the content, at the start: on phones (640px or less) by default, at any width with `actions=\"wrap\"` (issue #31)."}],"events":[{"name":"cm-resource-select","description":"`detail: { value, selected }` when the merchant ticks or unticks the row. The list handles it."}]}],"examples":[{"title":"Selectable, with bulk actions","html":"<cm-resource-list selectable total=\"15000\" resource-name=\"product\">\n <cm-button slot=\"bulk-actions\" size=\"slim\">Bulk orders</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Customise columns</cm-button>\n <cm-resource-item value=\"p1\" selected>New normal modern classic darkness T-shirt</cm-resource-item>\n <cm-resource-item value=\"p2\" selected>Linen overshirt, sand</cm-resource-item>\n <cm-resource-item value=\"p3\">Canvas tote bag</cm-resource-item>\n <cm-resource-item value=\"p4\">Cotton socks, 3 pairs</cm-resource-item>\n</cm-resource-list>"},{"title":"With thumbnails and links","html":"<cm-resource-list resource-name=\"product\" style=\"max-width:520px\">\n <cm-resource-item value=\"p1\" href=\"#/components/resource-list\" label=\"Ceramic mug\">\n <cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>\n Ceramic mug<br><small style=\"color:var(--cm-text-tertiary)\">24 in stock</small>\n </cm-resource-item>\n <cm-resource-item value=\"p2\" href=\"#/components/resource-list\" label=\"Linen napkins\">\n <cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>\n Linen napkins<br><small style=\"color:var(--cm-text-tertiary)\">Out of stock</small>\n </cm-resource-item>\n</cm-resource-list>"},{"title":"Row buttons on phones","description":"Buttons in a row's `actions` slot wrap onto their own line under the content when the content would get narrower than 12rem: on phones (640px or less) by default, at any width with `actions=\"wrap\"` (as here), never with `actions=\"inline\"`. Since 1.6 (issue #31).","html":"<cm-resource-list resource-name=\"task\" style=\"max-width:420px\">\n <cm-resource-item value=\"t1\" actions=\"wrap\"><strong>Ravi Stores</strong><div>Called 12 Nov, no answer</div>\n <cm-button slot=\"actions\" size=\"slim\">Call</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Details</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Set date</cm-button>\n <cm-button slot=\"actions\" size=\"slim\" tone=\"critical\">Not interested</cm-button>\n </cm-resource-item>\n <cm-resource-item value=\"t2\" actions=\"wrap\"><strong>Asha Textiles</strong><div>Visited 10 Nov</div>\n <cm-button slot=\"actions\" size=\"slim\">Call</cm-button>\n </cm-resource-item>\n</cm-resource-list>"},{"title":"With column headings","description":"A `cm-table-header` in the `header` slot, `--cm-table-columns` on the list and `columns` on each row, one element per column. The list lines the headings up with the cells and puts its select-all box in the header's checkbox column. Tick a row: the selection status and bulk actions cover the column names until the selection is cleared.","html":"<cm-resource-list selectable total=\"128\" resource-name=\"lead\" style=\"--cm-table-columns: 1.6fr 1.4fr 1.8fr 1.2fr 1.1fr 1fr 110px\">\n <cm-button slot=\"bulk-actions\" size=\"slim\">Assign owner</cm-button>\n <cm-table-header slot=\"header\" sort=\"created\" direction=\"descending\">\n <option value=\"name\" sortable>Name</option>\n <option value=\"company\">Company</option>\n <option value=\"email\">Email</option>\n <option value=\"phone\">Phone</option>\n <option value=\"owner\">Owner</option>\n <option value=\"created\" sortable>Created</option>\n <option value=\"status\">Status</option>\n </cm-table-header>\n <cm-resource-item value=\"l1\" label=\"Asha Rao\" columns>\n <strong>Asha Rao</strong><span>Rao Textiles</span><span>asha@raotextiles.in</span><span>98450 12345</span><span>Rahul Kumar</span><span>16 Nov</span><span><cm-badge tone=\"information\">New</cm-badge></span>\n </cm-resource-item>\n <cm-resource-item value=\"l2\" label=\"Ben Cole\" columns>\n <strong>Ben Cole</strong><span>Cole &amp; Sons</span><span>ben@coleandsons.com</span><span>99001 55432</span><span>Meera Iyer</span><span>15 Nov</span><span><cm-badge tone=\"success\">Contacted</cm-badge></span>\n </cm-resource-item>\n <cm-resource-item value=\"l3\" label=\"Divya Menon\" columns>\n <strong>Divya Menon</strong><span>Menon Foods</span><span>divya@menonfoods.in</span><span>90080 77881</span><span>Rahul Kumar</span><span>14 Nov</span><span><cm-badge>Qualified</cm-badge></span>\n </cm-resource-item>\n</cm-resource-list>"},{"title":"Compact rows","description":"`density=\"compact\"`: 40px rows and 32px thumbnails, for long lists people scan. Set `data-cm-density=\"compact\"` on the page instead to make every list and table on it compact. On touch screens rows stay at least 44px tall.","html":"<cm-resource-list resource-name=\"product\" density=\"compact\" style=\"max-width:520px\">\n <cm-resource-item value=\"p1\" href=\"#/components/resource-list\" label=\"Ceramic mug\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Ceramic mug</cm-resource-item>\n <cm-resource-item value=\"p2\" href=\"#/components/resource-list\" label=\"Linen napkins\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Linen napkins</cm-resource-item>\n <cm-resource-item value=\"p3\" href=\"#/components/resource-list\" label=\"Canvas tote bag\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Canvas tote bag</cm-resource-item>\n</cm-resource-list>"},{"title":"Loading","html":"<cm-resource-list loading resource-name=\"order\" style=\"max-width:520px\">\n <cm-resource-item value=\"o1\">#1001 · Asha Rao</cm-resource-item>\n <cm-resource-item value=\"o2\">#1002 · Ben Cole</cm-resource-item>\n</cm-resource-list>"}],"do":["Set `resource-name` (and `resource-name-plural` for irregular nouns) so the toolbar reads \"2 orders selected\".","Set `total` to the number of matches so merchants can select all of them, and act on `detail.all` in `cm-selection-change`.","Pair it with `cm-status-tabs` above and `cm-pagination` below; put a `cm-table-header` in the `header` slot for columns.","With column headings, set `--cm-table-columns` on the list and `columns` on every row, with one element per column (wrap a badge or button in a `<span>`). The list lines the header up with the cells, checkbox column included. Laying a row out yourself works too: a grid on `var(--cm-table-columns)` with `column-gap: var(--cm-space-20)` and `min-width: 0` on the cells.","Give each row a `label` when its text is long, so the checkbox and link names stay short."],"dont":["Don't put more than one link or many buttons in a row: use the `actions` slot for one or two.","Don't squeeze many columns onto a phone: at 640px or less, show the row as text (no `columns`, no header), or set a shorter `--cm-table-columns` and leave out the cells and options that don't fit.","Don't set `selectable` on a `cm-table-header` inside a selectable list: the list already puts its select-all box in the header. With column headings, put row buttons and thumbnails in a column rather than the `actions` and `media` slots, so the cells stay under their headings.","Don't use it for settings or navigation: use cards or a nested list.","Don't show bulk actions that can't apply to every selected row."],"content":["Header row text: \"2 products selected. Select all 15,000 products\" and \"All 15,000 products selected. Clear selection\".","Bulk actions are verbs: \"Bulk orders\", \"Archive\", \"Add tags\"."],"accessibility":["The rows form a list named after the resource (\"Products\"); each checkbox is named \"Select {row name}\".","The Select box is named \"Select all 4 products on this page\" and shows a mixed state when some rows are ticked. Its menu button is named \"Selection options\" and is a standard menu button (↓ opens, arrows move, Esc closes). Over a column header it appears once rows are ticked (until then the box selects the page). Hide it with `hide-select-menu`.","Selection changes are announced through a polite status message.","Linked rows are one link each; the checkbox and actions stay separate tab stops. Clicking a plain row ticks it, but never when clicking a button or link inside.","While `loading`, the list is `aria-busy` and the spinner is named \"Loading products\".","Differs from Figma: the selection lives in the list's header row instead of a separate toolbar; rows, thumbnails (40px desktop / 32px phone and compact) and text follow the 1.5 scale and the 1.6 table standard. Any image works as a thumbnail."],"responsive":["When the window is 640px wide or less, rows have no side padding, a 20px checkbox (easier to tap) and 32px thumbnails; bulk actions wrap under the \"2 orders selected\" status when they don't fit.","Row buttons (`slot=\"actions\"`) wrap onto their own line under the content, at the start, when the content would get narrower than 12rem: on phones by default, at any width with `actions=\"wrap\"` on the `cm-resource-item`, never with `actions=\"inline\"` (since 1.6, issue #31).","On touch screens rows are at least 44px tall at either density."],"related":["table-header","pagination","status-tabs","checkbox","data-table"]},{"tag":"cm-timeline","slug":"timeline","name":"Timeline","react":"Timeline","group":"Lists","summary":"The activity on a record: emails, calls, notes, field changes and system events, newest first.","lead":"One row per event: a 32px round icon for its kind, a 14px title with an optional badge, the time at the end of the line (\"2 hours ago\"; the full date and time on hover and focus), a 12px `text-tertiary` meta line, an optional body clamped to 3 lines with Show all, and optional actions. A 2px `border-subtle` line joins the icons. \"Show more\" at the end asks for older events.","docs_url":"https://commmerce.com/commmerceui/#components--timeline","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name of the list, e.g. \"Activity for Asha Rao\". Default: the built-in string `label` (\"Activity\")."},{"attribute":"has-more","property":"hasMore","type":"boolean","default":"false","description":"There are older events: shows the \"Show more\" button, which fires `cm-load-more`."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Events are loading: the Show more button shows a spinner, or placeholder rows show when there are no items yet. Announced politely."},{"attribute":"more-label","property":"moreLabel","type":"string","description":"Text of the Show more button. Default: the built-in string `showMore` (\"Show more\")."},{"attribute":"_items","property":"_items","type":"CmTimelineItem[]","default":"[]"},{"attribute":"_empty","property":"_empty","type":"Element[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"CmTimelineItem[]","description":"The `cm-timeline-item` children, in order."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-timeline-item` elements, in the order to show them. Other children are not shown."},{"name":"empty","description":"Shown when there are no items and nothing is loading, e.g. a `cm-empty-state`."}],"events":[{"name":"cm-load-more","description":"When \"Show more\" is pressed. Fetch the next page, append the items and clear `loading`; clear `has-more` on the last page."}],"parts":[{"tag":"cm-timeline-item","react":"TimelineItem","properties":[{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon name from `@commmerce/icons` for the kind of event (\"mail\", \"note\", \"edit\", \"chat\"). Empty shows a small dot."},{"attribute":"tone","property":"tone","type":"Tone | 'neutral'","default":"'neutral'","description":"Colours the icon: `neutral` (default), `information`, `attention`, `success` or `critical`."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"What happened: \"Email sent\", \"Status changed\". Use the `heading` slot for a link."},{"attribute":"datetime","property":"datetime","type":"string","default":"''","description":"When it happened, as an ISO date-time (`2026-11-16T10:30:00+05:30`). Shown relative to now; used for `<time datetime>`."},{"attribute":"time","property":"time","type":"string","default":"''","description":"The time as shown, instead of the relative time worked out from `datetime` (which still gives the full date on hover)."},{"attribute":"meta","property":"meta","type":"string","default":"''","description":"A line under the title: \"by Rahul Kumar · sent\". Use the `meta` slot for links."},{"attribute":"lines","property":"lines","type":"number","default":"3","description":"Lines of body shown before \"Show all\". 0 shows the whole body."},{"attribute":"expanded","property":"expanded","type":"boolean","default":"false","description":"The whole body is shown (after \"Show all\")."},{"attribute":"_overflow","property":"_overflow","type":"boolean","default":"false"},{"attribute":"_body","property":"_body","type":"boolean","default":"false"},{"attribute":"_meta","property":"_meta","type":"boolean","default":"false"},{"attribute":"_actions","property":"_actions","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"date","type":"Date | undefined","description":"The `datetime` as a Date, or undefined when missing or invalid."},{"property":"relativeTime","type":"string","description":"The time as shown: `time`, or `datetime` relative to now (\"2 hours ago\"), or a date when over a week away."},{"property":"fullTime","type":"string","description":"The full date and time, for the tooltip and screen readers."}],"methods":[],"slots":[{"name":"(default)","description":"The body: an email excerpt, a note, a call summary. Clamped to `lines` lines."},{"name":"heading","description":"Rich title (e.g. with a link), instead of `heading`."},{"name":"meta","description":"Rich meta line, instead of `meta`."},{"name":"badge","description":"A `cm-badge` for the kind or state, after the title."},{"name":"actions","description":"Links or buttons under the body, e.g. \"Read email\"."}],"events":[]}],"examples":[{"title":"Record activity","description":"Emails, calls and WhatsApp messages on a lead. The badge names the kind; the action opens the full message. `has-more` adds Show more, which fires `cm-load-more`.","html":"<cm-timeline label=\"Activity for Asha Rao\" has-more style=\"max-width:720px\">\n <cm-timeline-item icon=\"mail\" tone=\"information\" heading=\"Quote for 200 cotton tote bags\" datetime=\"2026-11-24T04:11Z\" meta=\"by Rahul Kumar · sent\">\n <cm-badge slot=\"badge\" tone=\"information\">Email</cm-badge>\n Hi Asha, thanks for your time on the call. As discussed, here is the quote for 200 printed cotton tote bags with your logo on one side. Prices include GST and delivery to Bengaluru. The quote is valid for 30 days; let me know if you would like samples first.\n <cm-button slot=\"actions\" size=\"slim\" href=\"#/components/timeline\">Read email</cm-button>\n </cm-timeline-item>\n <cm-timeline-item icon=\"mail\" heading=\"Email opened\" datetime=\"2026-11-24T04:41Z\" meta=\"by Asha Rao · 2 times\"></cm-timeline-item>\n <cm-timeline-item icon=\"chat\" tone=\"success\" heading=\"Call: discussed bulk pricing\" datetime=\"2026-11-23T04:16Z\" meta=\"by Rahul Kumar · outgoing · 12 min\">\n <cm-badge slot=\"badge\" tone=\"success\">Call</cm-badge>\n Asha needs 200 bags by 5 December for a store opening. Wants a quote with printing on one side.\n </cm-timeline-item>\n <cm-timeline-item icon=\"send\" heading=\"WhatsApp message delivered\" datetime=\"2026-11-22T04:16Z\" meta=\"by Rahul Kumar · template: Introduction\">\n <cm-badge slot=\"badge\">WhatsApp</cm-badge>\n </cm-timeline-item>\n</cm-timeline>"},{"title":"Notes","description":"Long notes are clamped to `lines` lines (3 by default) with Show all. Put the author in the meta line.","html":"<cm-timeline label=\"Notes\" style=\"max-width:560px\">\n <cm-timeline-item icon=\"note\" heading=\"Note\" datetime=\"2026-11-24T05:36Z\" meta=\"by Meera Iyer\" lines=\"2\">\n Visited the Indiranagar store. They stock our mugs on the front shelf and sold out of the blue glaze last week. The owner wants to try the linen napkins next month and asked for a display stand. Follow up after Diwali with a sample set and the wholesale price list.\n </cm-timeline-item>\n <cm-timeline-item icon=\"note\" heading=\"Note\" datetime=\"2026-11-21T06:16Z\" meta=\"by Rahul Kumar\">Prefers calls after 4 pm.</cm-timeline-item>\n</cm-timeline>"},{"title":"System events and field changes","description":"Changes made by people, automations and imports. Write a field change as \"Field: old → new\" in the title; no body is needed.","html":"<cm-timeline label=\"History\" style=\"max-width:560px\">\n <cm-timeline-item icon=\"edit\" heading=\"Status: New → Contacted\" datetime=\"2026-11-24T06:01Z\" meta=\"by Rahul Kumar\"></cm-timeline-item>\n <cm-timeline-item icon=\"user\" heading=\"Owner: Meera Iyer → Rahul Kumar\" datetime=\"2026-11-24T01:16Z\" meta=\"by assignment rule · Round robin, Bengaluru\"></cm-timeline-item>\n <cm-timeline-item icon=\"tag\" heading=\"Tag added: Wholesale\" datetime=\"2026-11-24T01:14Z\" meta=\"by Meera Iyer\"></cm-timeline-item>\n <cm-timeline-item icon=\"plus\" heading=\"Lead created\" datetime=\"2026-11-02T09:30:00+05:30\" meta=\"by Website form · Contact us\">\n <cm-badge slot=\"badge\">System</cm-badge>\n </cm-timeline-item>\n</cm-timeline>"}],"do":["Show the newest event first, and page older ones with `has-more` and `cm-load-more`.","Give `datetime` as an ISO date-time with its offset, so the relative time, the full time and `<time datetime>` are right.","Pick one icon per kind and keep it: `mail` for emails, `chat` for calls, `note` for notes, `edit` for field changes, `user` for owner changes.","Name the kind in the title or a badge too: the icon is decoration and is not read out.","Filter by kind with `cm-status-tabs` above the timeline, with a count on each tab.","Set `label` when there is more than one timeline on the page, e.g. \"Notes\" and \"History\"."],"dont":["Don't put long forms or several buttons in an item: one or two actions, such as \"Read email\" or \"Open task\".","Don't use it for comments people write together on an order: use Comment.","Don't show the whole body of every email: let it clamp, and link to the full message."],"content":["Titles say what happened, briefly: \"Email sent\", \"Call: discussed bulk pricing\", \"Status: New → Contacted\".","Meta line: who, then details, joined with \" · \": \"by Rahul Kumar · sent\".","Badges are one word for the kind: Email, Call, WhatsApp, Note, System."],"accessibility":["An ordered list (`<ol>`, named \"Activity\" or `label`) with one `<li>` per event; the line between icons is decoration.","Each time is a `<time datetime>`. Screen readers hear the relative time and then the full date and time (\"2 hours ago, Monday, 16 November 2026 at 10:30\"). The time is a Tab stop so keyboard users can see the full date in its tooltip.","Show all / Show less is a button with `aria-expanded`, controlling the body. The clamped text is still read in full by screen readers.","Show more is a button; while `loading` it is busy and \"Loading activity\" is announced. When the last page arrives and the button goes away, focus moves to the list.","Screen readers read \"→\" as \"right arrow\" or \"to\", depending on the reader."],"responsive":["The time moves under the title when the row is too narrow for both; the Show more button lines up with the text on wide screens and with the icons on phones (640px or less)."],"related":["comment","status-tabs","badge","empty-state"]},{"tag":"cm-board","slug":"board","name":"Board","react":"Board","group":"Lists","summary":"Records in columns by status (Kanban), moved between columns by dragging or with the keyboard.","lead":"One column per status, with its heading and count, and one card per record: the name (a link to the record), a few 12px `text-tertiary` lines, badges and the owner's avatar. Columns are `bg-page` with a `border-subtle` line and 8px corners; cards are `bg-surface` with a `border-subtle` line. A card is moved by dragging it (press and hold on touch) or by focusing it and pressing Space, then the arrow keys. Each move fires a cancelable `cm-move` for your app to save.","docs_url":"https://commmerce.com/commmerceui/#components--board","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name of the board, e.g. \"Merchants by status\". Default: the built-in string `label` (\"Board\")."},{"attribute":"hide-empty","property":"hideEmpty","type":"boolean","default":"false","description":"Empty columns shrink to a narrow rail (heading on its side and the count). Rails still take cards: drop on them or move to them with the keyboard."},{"attribute":"controlled","property":"controlled","type":"boolean","default":"false","description":"You move the cards: the board fires `cm-move` but never moves card elements or changes `total`. Re-render the\ncard into its new column (and update totals) in your `cm-move` listener. Use it with React, Vue and other\nframeworks that render from data. `preventDefault()` still means the move was refused."},{"attribute":"dragging","property":"dragging","type":"boolean","default":"false","description":"Set while a card is being dragged with a pointer. Read it for styling; don't set it."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"columns","type":"CmBoardColumn[]","description":"The `cm-board-column` children, in order."},{"property":"heldCard","type":"CmBoardCard | null","description":"The card picked up with the keyboard, if any."},{"property":"announcement","type":"string","description":"The last message announced (for tests and logging)."}],"methods":[{"name":"column","description":"The column with this `value` (or heading)."},{"name":"card","description":"The card with this `value` (or name), in any column."},{"name":"announce","description":"Announces a message in the board's live region, e.g. after your own \"Move to\" menu."},{"name":"pickUp","description":"Picks up a card for moving with the arrow keys, as Space does: e.g. from a \"Move\" item in your own menu. Focuses the card."},{"name":"cancelMove","description":"Cancels a keyboard move or a drag in progress: the card stays where it was."},{"name":"moveCard","description":"Moves a card to a column and position (default: the end), as a drop would: fires `cm-move`, and unless it is\ncancelled (or the board is `controlled`) moves the element. Use it for your own \"Move to\" menu. Returns false\nwhen the move was cancelled or the card or column was not found."},{"name":"revert","description":"Puts a card back where it was before its last move by the board, restores the two columns' `total`, clears\n`pending` and announces it. Call it when saving the move failed (a rejected `waitUntil()` promise does this\nfor you). Does nothing with `controlled` (put it back in your data) or when the card has not moved. Returns\nwhether the card went back."}],"slots":[{"name":"(default)","description":"`cm-board-column` elements, in order."}],"events":[{"name":"cm-move","description":"Before a card moves. Cancelable: `preventDefault()` keeps it where it was. `detail: { value, card, from, to, fromColumn, toColumn, fromIndex, toIndex, source, waitUntil }` (see `BoardMoveDetail`). Pass the save request to `detail.waitUntil(promise)` to show the card as saving and put it back if the promise rejects."},{"name":"cm-load-more","description":"From a column's Load more button (bubbles from `cm-board-column`). `detail: { column, value }`."}],"parts":[{"tag":"cm-board-column","react":"BoardColumn","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the column in `cm-move` (e.g. the status id). Defaults to `heading`."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The column's name, e.g. the status \"Contacted\"."},{"attribute":"total","property":"total","type":"number | undefined","description":"How many cards the column has in all, when more than are loaded (shown as the count). Unset: the number of cards. The board keeps it in step when it moves cards."},{"attribute":"has-more","property":"hasMore","type":"boolean","default":"false","description":"Shows \"Load more\", which fires `cm-load-more`. Also shown when `total` is more than the cards loaded."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Cards are loading: Load more shows a spinner, or placeholder cards show in an empty column. Announced politely."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"3","description":"Level of the heading for screen readers (2 to 6)."},{"attribute":"_cards","property":"_cards","type":"CmBoardCard[]","default":"[]"},{"attribute":"_drop","property":"_drop"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"collapsed","type":"boolean","description":"Whether the column is shown as a narrow rail: the board has `hide-empty` and the column is empty. Also the `collapsed` attribute, for styling."},{"property":"cards","type":"CmBoardCard[]","description":"The `cm-board-card` children, in order."},{"property":"key","type":"string","description":"The column's `value`, or its heading."},{"property":"count","type":"number","description":"The number shown in the heading: `total`, or the cards loaded."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-board-card` elements, in order. Other children are not shown."},{"name":"actions","description":"A small control at the end of the heading row, e.g. an icon-only \"Add\" button."},{"name":"empty","description":"Shown in a column with no cards, instead of \"No cards\"."}],"events":[{"name":"cm-load-more","description":"When \"Load more\" is pressed. `detail: { column, value }`. Set `loading`, append the cards, then clear `loading` (and `has-more` on the last page)."}]},{"tag":"cm-board-card","react":"BoardCard","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the record in `cm-move` (e.g. its id). Defaults to the card's name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"The card's name, read by screen readers and in announcements (\"Picked up Ravi Stores\"). Defaults to `heading` or the `heading` slot's text."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The title: the record's name."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the title a link to the record. Enter on the focused card opens it too."},{"attribute":"locked","property":"locked","type":"boolean","default":"false","description":"The card can't be moved (e.g. no permission). It can still be opened."},{"attribute":"pending","property":"pending","type":"boolean","default":"false","description":"The move is being saved: the card is greyed with a spinner and can't be moved again until it is cleared. Set by `waitUntil()` in `cm-move`, or by you."},{"attribute":"moving","property":"moving","type":"boolean","default":"false","description":"Set by the board while the card is picked up or dragged; it then marks where the card came from. Read it for styling; don't set it."},{"attribute":"_badges","property":"_badges","type":"boolean","default":"false"},{"attribute":"_slottedTitle","property":"_slottedTitle","type":"string","default":"''"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"name","type":"string","description":"The card's name: `label`, `heading`, the `heading` slot's text, or its first line of text."},{"property":"key","type":"string","description":"The value used in `cm-move`: `value`, or the name."},{"property":"opener","type":"HTMLElement | null","description":"The link or button that opens the record: the `href` title, or the first link or button in the `heading` slot."}],"methods":[{"name":"focusHandle","description":"Focuses the card's handle (its single Tab stop), even when a control inside the card has focus."},{"name":"open","description":"Opens the record: clicks the `href` title or the link or button in the `heading` slot. Returns false when there is none."}],"slots":[{"name":"(default)","description":"Secondary lines under the title (owner, phone, city), one element per line."},{"name":"heading","description":"Rich title instead of `heading`, e.g. a link. A link here is a second Tab stop; prefer `href`."},{"name":"badges","description":"`cm-badge`s (grade, tags) under the lines."},{"name":"avatar","description":"A `cm-avatar` for the owner, at the end of the title line."},{"name":"actions","description":"A small control at the end of the title line, e.g. a `cm-action-menu` with \"Move to…\". Pressing it never starts a drag."}],"events":[]}],"examples":[{"title":"CRM pipeline by status","description":"Merchants by status. Drag a card to another column, or Tab to a card, press Space, use the arrow keys and press Enter. Each move fires `cm-move` with `{ value, from, to, fromIndex, toIndex }`; save it there, and pass the request to `detail.waitUntil(promise)` so the card shows as saving and goes back if it fails. `total` is the column's full count; with more than are loaded, Load more appears.","html":"<cm-board label=\"Merchants by status\" style=\"height:560px\">\n <cm-board-column value=\"new\" heading=\"New\" total=\"24\">\n <cm-board-card value=\"m101\" heading=\"Ravi Stores\" href=\"#/components/board\">\n <span>Asha Rao</span><span>+91 98450 12345 · Bengaluru</span><span>Modified 2 hours ago</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Asha Rao\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"m102\" heading=\"Lakshmi Textiles\" href=\"#/components/board\">\n <span>Rahul Kumar</span><span>+91 99000 23456 · Chennai</span><span>Modified yesterday</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Rahul Kumar\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"m103\" heading=\"Green Basket Organics\" href=\"#/components/board\">\n <span>Meera Iyer</span><span>+91 90080 34567 · Mysuru</span><span>Modified 3 days ago</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Meera Iyer\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"contacted\" heading=\"Contacted\">\n <cm-board-card value=\"m104\" heading=\"Blue Pottery House\" href=\"#/components/board\">\n <span>Asha Rao</span><span>+91 98860 45678 · Jaipur</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Asha Rao\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"m105\" heading=\"Kiran Foods\" href=\"#/components/board\">\n <span>Rahul Kumar</span><span>+91 97400 56789 · Pune</span><span>Modified 5 days ago</span>\n <cm-badge slot=\"badges\">Grade C</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Rahul Kumar\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"demo\" heading=\"Demo booked\">\n <cm-board-card value=\"m106\" heading=\"Delhi Spice Co.\" href=\"#/components/board\">\n <span>Meera Iyer</span><span>+91 98110 67890 · New Delhi</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Meera Iyer\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"won\" heading=\"Won\">\n <cm-board-card value=\"m107\" heading=\"Coastal Crafts\" href=\"#/components/board\">\n <span>Asha Rao</span><span>+91 94470 78901 · Kochi</span><span>Modified last week</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Asha Rao\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"lost\" heading=\"Lost\"></cm-board-column>\n</cm-board>"},{"title":"Load more","description":"Show the first page of each column and set `total`. Load more (also shown with `has-more`) fires `cm-load-more` with `{ column, value }`: set `loading` on the column, append the next cards, then clear `loading`. This example adds three cards after a short wait.","html":"<cm-board label=\"Tickets by status\" style=\"height:480px\">\n <cm-board-column value=\"open\" heading=\"Open\" total=\"8\">\n <cm-board-card value=\"t201\" heading=\"Refund not received\" href=\"#/components/board\">\n <span>Priya Nair</span><span>Order #10482 · Payments</span><span>Modified 1 hour ago</span>\n <cm-badge slot=\"badges\">High</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Priya Nair\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"t202\" heading=\"Wrong size delivered\" href=\"#/components/board\">\n <span>Arjun Mehta</span><span>Order #10477 · Returns</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Medium</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Arjun Mehta\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"waiting\" heading=\"Waiting on customer\" total=\"3\">\n <cm-board-card value=\"t203\" heading=\"GST invoice needed\" href=\"#/components/board\">\n <span>Priya Nair</span><span>Order #10391 · Billing</span><span>Modified yesterday</span>\n <cm-badge slot=\"badges\">Low</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Priya Nair\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"closed\" heading=\"Closed\" loading></cm-board-column>\n</cm-board>"},{"title":"Hide empty columns","description":"`hide-empty` shrinks empty columns to a 48px rail with the heading on its side and the count. Rails still take cards: drop a card on one, or move to it with the arrow keys, and it opens up again. A column with a `total` above 0 is never treated as empty.","html":"<cm-board label=\"Partners by status\" hide-empty style=\"height:420px\">\n <cm-board-column value=\"new\" heading=\"New\">\n <cm-board-card value=\"p301\" heading=\"Sharma Logistics\" href=\"#/components/board\">\n <span>Rahul Kumar</span><span>+91 98200 11122 · Mumbai</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Rahul Kumar\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"contacted\" heading=\"Contacted\"></cm-board-column>\n <cm-board-column value=\"onboarding\" heading=\"Onboarding\">\n <cm-board-card value=\"p302\" heading=\"Nair Packaging\" href=\"#/components/board\">\n <span>Meera Iyer</span><span>+91 94460 33344 · Thiruvananthapuram</span><span>Modified 2 days ago</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Meera Iyer\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"live\" heading=\"Live\"></cm-board-column>\n <cm-board-column value=\"paused\" heading=\"Paused\"></cm-board-column>\n</cm-board>"},{"title":"Keyboard instructions and a Move menu","description":"Where many people use the keyboard (a sales floor), say how moving works on the page as well; screen readers already hear it with each card. A \"Move to\" menu in the `actions` slot gives a way that needs no arrow keys: on `cm-select`, call `board.moveCard(card, value)`, or `board.pickUp(card)` for \"Move…\" (then the arrow keys). This example does both.","html":"<p id=\"board-keys\" style=\"margin:0 0 12px;font-size:14px\">To move a card: Tab to it, press Space, choose a column and position with the arrow keys, then press Enter. Escape cancels. Enter on a card opens it.</p>\n<cm-board label=\"Follow-ups by stage\" style=\"height:380px\">\n <cm-board-column value=\"today\" heading=\"Today\">\n <cm-board-card value=\"f401\" heading=\"Call Ravi Stores\" href=\"#/components/board\">\n <span>Asha Rao · 11:30 am</span>\n <cm-action-menu slot=\"actions\" icon-only align=\"end\" label=\"Move Call Ravi Stores\" data-board-move>\n <cm-menu-item value=\"pick\">Move…</cm-menu-item><hr>\n <cm-menu-item value=\"week\">Move to This week</cm-menu-item>\n <cm-menu-item value=\"later\">Move to Later</cm-menu-item>\n </cm-action-menu>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"week\" heading=\"This week\">\n <cm-board-card value=\"f402\" heading=\"Demo for Kiran Foods\" href=\"#/components/board\"><span>Rahul Kumar · Thursday</span></cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"later\" heading=\"Later\"></cm-board-column>\n</cm-board>"}],"do":["Use one column per status, in the order records move through them, and keep the same order everywhere the statuses appear.","Give every card a `value` (the record id) and every column a `value` (the status id): `cm-move` reports those.","Save the move in `cm-move` and pass the request to `detail.waitUntil()`. Cancel the event (`preventDefault()`) for moves that are never allowed, and say why nearby.","Set `total` from your API and page each column with Load more; don't load every record into a board.","Use `href` for the record link, so each card is one Tab stop and Enter opens it.","In React, Vue and other frameworks that render from data, set `controlled` and move the record in your state in the `cm-move` listener.","Offer a list view of the same records for searching, sorting and bulk actions: see Board or list.","To confirm a move first (for example into a closing stage), call `preventDefault()` in `cm-move`, ask with a Modal, and on confirm call `board.moveCard(detail.value, detail.to, detail.toIndex)`. The second move fires `cm-move` again, so let it through with a flag of your own (set `confirmed = true` just before `moveCard`, reset it after); don't rely on `source: 'api'`, which a \"Move to\" menu that calls `moveCard()` also produces."],"dont":["Don't use a board for more than about eight statuses, or for records with no status: use a Resource list or Data table.","Don't make dragging the only way to change a status: the record page should have a status field too.","Don't put more than four lines, a few badges and one small menu on a card.","Don't put form fields on cards: they can't start a drag and make the card hard to move."],"content":["Column headings are the status names merchants know (\"Demo booked\"), in sentence case, without the count (the board adds it).","Card title: the record's name. Lines: owner, then phone and city, then when it last changed (\"Modified 2 hours ago\").","Badges: one word or a grade (\"Grade A\", \"High\")."],"accessibility":["The board is a group named by `label`; each column is a region named by its heading and count (\"Contacted, 12 cards\"), with a heading (`heading-level`, 3 by default) and a list of cards. Cards are list items.","Each card has one Tab stop: a handle covering the card, a button with the role description \"movable card\", named after the card, and described by the instructions (\"Press Space to pick up. Then use the arrow keys…\"; \"Press Enter to open.\" first when the card has a link). The `aria-grabbed` and `aria-dropeffect` attributes are deprecated and not used.","Keyboard: Space picks the card up; Left and Right choose the previous or next column (in right-to-left languages they swap, so Left goes to the next column); Up and Down, Home and End choose the position; Space or Enter drops; Escape cancels, and so does Tab or moving focus away. Without a card picked up, the arrow keys move focus between cards and Enter opens the card.","Every step is announced through an assertive live region: \"Picked up Ravi Stores. Column New, position 1 of 3.\", \"Column Contacted, position 2 of 3.\", \"Moved Ravi Stores to Contacted, position 2 of 3.\", \"Move cancelled. Ravi Stores is back in New.\" Refused and failed moves are announced too. Focus stays on the card after it moves.","Screen readers in browse mode keep the arrow keys for reading, so a \"Move to\" menu (see the example) or the status field on the record page is the way for many screen-reader users. Dragging is never the only way.","Pointer: drag with a mouse after moving 4px; on touch, press and hold for 0.3 seconds, so swiping still scrolls. A copy of the card follows the pointer, a dashed outline marks where the card came from, and a dashed placeholder shows where it will land. Escape cancels a drag.","Load more is a button; while a column is `loading` its list is busy and \"Loading Contacted\" is announced. Placeholder cards are hidden from screen readers.","Not yet tested with screen readers by people (automated checks only)."],"responsive":["Columns are 272px wide (`--cm-board-column-width`) side by side, 12px apart, and the board scrolls sideways.","When the board itself is 480px wide or less (a phone, or a narrow panel), each column takes the board's width less 40px, so the next column peeks in, and the board snaps from column to column. Rails stay 48px. It works down to 320px.","Give the board a height (`style=\"height: 70vh\"` or `block-size`) and each column scrolls on its own; without one the columns grow with their cards and the page scrolls.","While a card is dragged near the board's start or end edge the board scrolls sideways; near the top or bottom of a column, the column scrolls; near the top or bottom of the window, the window scrolls."],"related":["resource-list","data-table","status-tabs","badge","avatar","action-menu"]},{"tag":"cm-calendar","slug":"calendar","name":"Calendar","react":"Calendar","group":"Lists","summary":"Events by month, week or day: calls, follow-ups and demos that move between days and times by dragging or with the keyboard.","lead":"A month grid, a week of day columns with an all-day row and an hour axis, or one day's hours, with Previous, Today and Next, the range shown and a view switch. Events are `cm-calendar-event` children, drawn as chips with a time, a title, the kind (as text, or as the icon in the month view) and a tone colour on a 3px bar. Drag a chip to another day or time, or focus it, press Space and use the arrow keys. Each move fires a cancelable `cm-move` for your app to save; each new range fires `cm-range-change` so you can load its events.","docs_url":"https://commmerce.com/commmerceui/#components--calendar","properties":[{"attribute":"view","property":"view","type":"CalendarView","default":"'month'","description":"`month`, `week` or `day`."},{"attribute":"date","property":"date","type":"string","default":"''","description":"A day in the range shown, ISO `yyyy-mm-dd`. Previous, Next and Today change it. Empty: today. On narrow screens it is also the day listed under the month."},{"attribute":"today","property":"today","type":"string","default":"''","description":"Today's date, ISO `yyyy-mm-dd`, for the Today button and the highlight. Empty: the device's date. Set it from your server, or to fix the date in tests."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the calendar, e.g. \"Outreach planner\". Default: the built-in string `label` (\"Calendar\")."},{"attribute":"step","property":"step","type":"number","default":"15","description":"Minutes events snap to when moved in the week and day views (1 to 240). Default 15."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for month and weekday names, times and the first day of the week. Empty: the same language as every other component."},{"attribute":"first-day-of-week","property":"firstDayOfWeek","type":"number | undefined","description":"First day of the week: 0 = Sunday, 1 = Monday … 6 = Saturday. Defaults to the locale's custom where the browser knows it (as in `cm-date-picker`), else Sunday."},{"attribute":"hour-cycle","property":"hourCycle","type":"'' | 'h12' | 'h23'","default":"''","description":"`h12` or `h23` to force a 12- or 24-hour clock. Empty: the locale's clock."},{"attribute":"day-start","property":"dayStart","type":"number","default":"8","description":"The hour the week and day views scroll to when they open (0 to 23). Default 8."},{"attribute":"max-events","property":"maxEvents","type":"number","default":"3","description":"Most chips in a month day; with more, the last place shows \"+N more\", which lists the whole day. Default 3."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"2","description":"Level of the range heading for screen readers (1 to 6). Default 2."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Events are loading: the grid is busy and \"Loading events\" is announced."},{"attribute":"readonly","property":"readonly","type":"boolean","default":"false","description":"No \"+\" buttons and no moving: events can only be opened."},{"attribute":"controlled","property":"controlled","type":"boolean","default":"false","description":"You move the events: the calendar fires `cm-move` but never changes `start` and `end`. Change them (or re-render\nthe event) in your `cm-move` listener. Use it with React, Vue and other frameworks that render from data."},{"attribute":"dragging","property":"dragging","type":"boolean","default":"false","description":"Set while an event is dragged with a pointer. Read it for styling; don't set it."},{"attribute":"_narrow","property":"_narrow","type":"boolean","default":"false"},{"attribute":"_more","property":"_more","type":"string","default":"''","description":"The day whose \"+N more\" list is open."},{"attribute":"_target","property":"_target","type":"{ iso: string; min?: number } | null","default":"null","description":"Where the moving event would land."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"events","type":"CmCalendarEvent[]","description":"The `cm-calendar-event` children."},{"property":"range","type":"CalendarRange","description":"The view and the first and last day shown, as in `cm-range-change`."},{"property":"heldEvent","type":"CmCalendarEvent | null","description":"The event picked up with the keyboard, if any."},{"property":"announcement","type":"string","description":"The last message announced (for tests and logging)."}],"methods":[{"name":"event","description":"The event with this `value` (or title)."},{"name":"announce","description":"Announces a message in the calendar's live region."},{"name":"scrollToHour","description":"Scrolls the week or day view so `hour` (0–23) is at the top. Useful after loading events, e.g. to open at the first one.\nDoes nothing in the month view."},{"name":"previous","description":"Shows the previous month, week (three days when narrow) or day."},{"name":"next","description":"Shows the next month, week (three days when narrow) or day."},{"name":"goToToday","description":"Shows the range with today in it."},{"name":"pickUp","description":"Picks up an event for moving with the arrow keys, as Space does: e.g. from a \"Move\" item in your own menu.\n`day` (ISO) is the day it is picked up from, for an all-day event over several days. Returns false when the\nevent is not shown, `locked`, `pending` or the calendar is `readonly`."},{"name":"cancelMove","description":"Cancels a keyboard move or a drag in progress: the event stays where it was."},{"name":"moveEvent","description":"Moves an event to a new start (local ISO; `end` defaults to keeping its length), as a drop would: fires\n`cm-move`, and unless it is cancelled (or the calendar is `controlled`) changes `start` and `end`. Returns false\nwhen the move was cancelled or the event was not found."},{"name":"revert","description":"Puts an event back where it was before its last move by the calendar, clears `pending` and announces it. Call\nit when saving the move failed (a rejected `waitUntil()` promise does this for you). Does nothing with\n`controlled` (put it back in your data) or when the event has not moved. Returns whether it went back."}],"slots":[{"name":"(default)","description":"`cm-calendar-event` elements, in any order."}],"events":[{"name":"cm-range-change","description":"When the days shown change (view, Previous/Next/Today, `date`, or the width crossing 600px), and once on first render. `detail: { view, start, end }` (ISO dates, both included). Load the events for those days."},{"name":"cm-move","description":"Before an event moves. Cancelable: `preventDefault()` keeps it where it was. `detail: { value, event, from: { start, end }, to: { start, end }, allDay, source, waitUntil }` (see `CalendarMoveDetail`)."},{"name":"cm-add","description":"From a \"+\" button or an empty hour. `detail: { start, allDay, view }`: `start` is `yyyy-mm-dd` for a day, `yyyy-mm-ddThh:mm` for an hour."},{"name":"cm-open","description":"When an event chip is activated (click or Enter). `detail: { value, event }`. Cancelable: on a chip with `href`, `preventDefault()` stops the link."}],"parts":[{"tag":"cm-calendar-event","react":"CalendarEvent","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the event in `cm-move` and `cm-open` (e.g. its id). Defaults to the title."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The title, e.g. \"Call Ravi Stores\"."},{"attribute":"label","property":"label","type":"string","default":"''","description":"The title for screen readers and announcements, when it should differ from `heading`."},{"attribute":"start","property":"start","type":"string","default":"''","description":"Local start, ISO `yyyy-mm-ddThh:mm`; for an all-day event `yyyy-mm-dd` (a date alone makes it all-day)."},{"attribute":"end","property":"end","type":"string","default":"''","description":"Local end, ISO `yyyy-mm-ddThh:mm` (default: 30 minutes after `start`); for an all-day event, its last day `yyyy-mm-dd` (default: the start day)."},{"attribute":"all-day","property":"allDay","type":"boolean","default":"false","description":"Lasts the whole day (or days): shown in the all-day row of the week and day views, and first in a month day."},{"attribute":"kind","property":"kind","type":"string","default":"''","description":"What it is, in a word or two: \"Follow-up\", \"Demo\", \"Call\". Shown on the chip and read in its name, so colour is never the only signal."},{"attribute":"tone","property":"tone","type":"CalendarEventTone","default":"'neutral'","description":"Colour of the chip, from the semantic tones. Pick one per kind and keep it."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"A `cm-icon` name shown before the title (e.g. `phone` for calls). The month view shows the icon instead of `kind`."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the chip a link to the record. Without it, activating the chip fires `cm-open`."},{"attribute":"locked","property":"locked","type":"boolean","default":"false","description":"The event can't be moved (e.g. no permission). It can still be opened."},{"attribute":"pending","property":"pending","type":"boolean","default":"false","description":"The move is being saved: the chip is greyed and can't be moved again until it is cleared. Set by `waitUntil()` in `cm-move`, or by you."},{"attribute":"moving","property":"moving","type":"boolean","default":"false","description":"Set by the calendar while the event is picked up or dragged. Read it for styling; don't set it."}],"script_properties":[{"property":"name","type":"string","description":"The event's name: `label`, `heading`, or its text."},{"property":"key","type":"string","description":"The value used in events: `value`, or the name."}],"methods":[],"slots":[{"name":"(default)","description":"The title, when `heading` is not set."}],"events":[]}],"examples":[{"title":"Outreach planner: month","description":"Everyone's calls, follow-ups, demos and meetings for November. A day with more than three events shows \"+N more\", which lists the whole day. Drag a chip to another day (the time stays), or Tab to it, press Space, use the arrow keys (Down is a week later) and press Enter. \"+\" on a day fires `cm-add` with the date; this example adds a follow-up at 10 am.","html":"<cm-calendar label=\"Outreach planner\" date=\"2026-11-18\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Week","description":"Seven day columns with an all-day row and the hours. Events sit at their time and are as tall as they last; events at the same time share the hour side by side. Drag a chip to another day or time (it snaps to `step`, 15 minutes), or press Space and use Up and Down (15 minutes), Page Up and Page Down (an hour), Left and Right (a day). Click an empty hour to add at that time.","html":"<cm-calendar label=\"Outreach planner\" view=\"week\" date=\"2026-11-18\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Day","description":"One day's hours, for a sales rep's own plan. `step=\"30\"` moves events in half hours.","html":"<cm-calendar label=\"My day\" view=\"day\" date=\"2026-11-18\" step=\"30\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Loading the range from your API","description":"Listen for `cm-range-change`: it fires on the first render and whenever the days shown change, with `{ view, start, end }` (ISO dates, both included). Set `loading` while you fetch, replace the `cm-calendar-event` children, then clear `loading`. Save moves in `cm-move` and pass the request to `detail.waitUntil(promise)`: the event shows as saving and goes back if it fails. This example shows `loading` for a moment on each new range.","html":"<cm-calendar label=\"Outreach planner\" date=\"2026-11-18\" data-calendar-load>\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Keyboard instructions","description":"Where many people use the keyboard, say how moving works on the page too; screen readers already hear it with each event.","html":"<p style=\"margin:0 0 12px;font-size:14px\">Tab into the calendar and use the arrow keys to move between days, hours and events; Page Up and Page Down show the previous or next period. To move an event: press Space, choose a day or time with the arrow keys, then press Enter. Escape cancels. Enter on an event opens it; Enter on \"+\" adds one.</p>\n<cm-calendar label=\"Follow-ups\" view=\"week\" date=\"2026-11-18\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"}],"do":["Give every event a `value` (the record id), a `kind` and a `tone`, and keep one tone per kind everywhere. Add an `icon` per kind as well: the month view shows the icon instead of the kind's name.","Load events in `cm-range-change`, for the days it reports, and set `loading` while you fetch.","Save each move in `cm-move` and pass the request to `detail.waitUntil()`. Cancel the event (`preventDefault()`) for moves that are never allowed (a past day, a holiday), and say why nearby.","Set `today` from your server when the device's clock or time zone may be wrong, and `first-day-of-week` when your users expect a different start than their language's.","In React, Vue and other frameworks that render from data, set `controlled` and change the event's `start` and `end` in your state in the `cm-move` listener.","Offer a list of the same events (a Resource list or Data table) for searching and bulk changes.","To open the week or day view at the first event after loading, set `day-start` to its hour (the view scrolls again when it changes), or call `scrollToHour(h)`."],"dont":["Don't make dragging the only way to reschedule: the record's own page should have a date and time field too (Date picker with `time`).","Don't rely on colour alone: every event needs a `kind` (or an `icon`).","Don't put long text in titles: chips are one line in the month view. Put the record's name first (\"Call Ravi Stores\").","Don't use it to pick a date: use Date picker or Date range picker."],"content":["Titles start with the action and the record: \"Call Ravi Stores\", \"Demo for Kiran Foods\".","Kinds are one or two words, in sentence case: \"Follow-up\", \"Demo\", \"Meeting\", \"Deadline\"."],"accessibility":["**Structure:** the calendar is a group named by `label`. The range (\"November 2026\") is a heading (`heading-level`, 2 by default) and a polite live region, so Previous and Next are announced. The view switch is a group of toggle buttons (`aria-pressed`).","**Month view** is a `grid` (a table) with the weekday names as column headers and one row per week. Each day cell holds its \"+\" button (\"Add on Wednesday 18 November\"), its event chips and \"+N more\" (\"2 more on Wednesday 18 November\", a button that opens a non-modal dialog listing the whole day). Today has `aria-current=\"date\"`. **Why a grid, and why focus goes to the things inside the cells:** grid semantics give screen readers the weekday and week as you move, and the arrow keys are free for moving focus, which the move model needs once an event is picked up. Focus lands on the buttons inside each cell, not on the cell, so every action is one key away.","**Week and day views** are a `grid` too: a row of day headings, an all-day row and one row per hour (the hour is the row header), with a cell per day. An empty hour is a button (\"Add at 3:00 pm, Wednesday 18 November\"); events sit in the cell of the hour they start in.","**Events** are buttons (links with `href`) named in full: \"Call Ravi Stores, Wednesday 18 November, 3:00 to 3:30 pm, Follow-up\", with the role description \"movable event\" and a description of the keys. The kind is also written on the chip (or shown as its icon), so colour is never the only signal.","**Keyboard, moving focus:** the grid is one Tab stop. In the month view, Left and Right go to the previous or next day (keeping the position in the day), Up and Down through a day's \"+\", events and \"+N more\" and on to the week above or below, Home and End to the start or end of the week. In the week and day views, Up and Down go through a day's all-day row and hours, Left and Right to the same hour in the next day, Home and End to the first or last day. Page Up and Page Down show the previous or next period everywhere. In right-to-left languages Left and Right swap.","**Keyboard, moving an event** (the shared move model of Board): Space picks it up. In the month view Left and Right choose the previous or next day and Up and Down the same day a week before or after; in the week and day views Up and Down move it by `step` (15 minutes), Page Up and Page Down by an hour, Home and End to the start or end of the day, and Left and Right to another day. Space or Enter drops, Escape cancels, and so does Tab or moving focus away. Moves stay inside the days shown. Focus stays on the event after it moves.","Every step is announced through an assertive live region: \"Picked up Call Ravi Stores. Wednesday 18 November, 3:00 to 3:30 pm.\", \"Thursday 19 November, 3:00 to 3:30 pm.\", \"Moved Call Ravi Stores to Thursday 19 November, 3:00 to 3:30 pm.\", \"Move cancelled. Call Ravi Stores is back on Wednesday 18 November.\" Refused and failed moves are announced too.","Pointer: drag with a mouse after moving 4px; on touch, press and hold for 0.3 seconds, so swiping still scrolls. The event stays where it was with a dashed outline and a dashed placeholder shows where it will land; in the week and day views the time grid scrolls when you drag near its top or bottom. Escape cancels a drag.","Narrow month view: the days are buttons named with their date and count (\"Tuesday 24 November, 4 events\"); the chosen day has `aria-selected`, and its list follows the grid under a heading.","Screen readers in browse mode keep the arrow keys for reading, so the record page's date field (or your own \"Move to\" menu calling `moveEvent()` or `pickUp()`) is the way for many screen-reader users. Dragging is never the only way.","Not yet tested with screen readers by people (automated checks only)."],"responsive":["Follows the calendar's own width, not the window. From 600px wide: a month grid with chips in each day, a week of seven day columns, or one day.","Narrower than 600px (phones, side panels), the month view becomes a compact grid of day buttons with a dot per event (up to three, in the events' colours), and the chosen day's events are listed under it with an Add button. Tapping a day chooses it. The week view shows three days from `date` instead of seven, and Previous and Next move three days; `cm-range-change` reports those three days. Three days keep the hours readable at 320px, where seven columns would be under 40px wide.","The week and day views scroll inside the calendar (at most 600px tall, `--cm-calendar-time-height`) with the day headings and the all-day row kept in view, and open scrolled to `day-start` (8 am). An hour is 48px (`--cm-calendar-hour-height`).","The header wraps: the navigation, then the range, then the view switch, on as many lines as it needs. It works down to 320px."],"related":["board","date-picker","date-range-picker","resource-list","badge"]},{"tag":"cm-nested-list","slug":"nested-list","name":"Nested list","react":"NestedList","group":"Lists","summary":"Rows that nest inside each other, such as menu links or sub-categories, with reordering.","lead":"A grey bar at least 64px tall with a 20px semibold title and actions, then 48px bordered rows of 14px text indented 48px per level. With `sortable`, each row starts with a drag handle; with `collapsible`, a round black button shows and hides the rows.","docs_url":"https://commmerce.com/commmerceui/#components--nested-list","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Title in the grey bar, e.g. \"Header\" or \"Clothing & accessories\"."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"2","description":"Heading level for the title (1–6)."},{"attribute":"sortable","property":"sortable","type":"boolean","default":"false","description":"Rows get drag handles and can be reordered among their siblings."},{"attribute":"collapsible","property":"collapsible","type":"boolean","default":"false","description":"Adds a show/hide button to the heading bar."},{"attribute":"open","property":"open","type":"boolean","default":"true","description":"Whether the rows are shown when `collapsible`."},{"attribute":"group","property":"group","type":"string","default":"''","description":"Name shared by sortable lists that accept each other's top-level rows (since 1.3), e.g. every section of a\nform layout. Rows then move between them by drag and drop (mouse or touch) and from the keyboard: ↑ on the\nfirst row or ↓ on the last moves it into the list before or after. The component moves the element and fires\na cancelable `cm-move`. An empty list in a group shows a drop area."},{"attribute":"_msg","property":"_msg","type":"string","default":"''"},{"attribute":"_empty","property":"_empty","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"CmNestedItem[]","description":"The top-level `cm-nested-item` rows, in order."}],"methods":[{"name":"announce","description":"Reads a message to screen readers, e.g. after a move."}],"slots":[{"name":"(default)","description":"`cm-nested-item` rows."},{"name":"actions","description":"Controls in the heading bar, e.g. an \"Add links\" button or a toggle."}],"events":[{"name":"cm-toggle","description":"`detail: { open }` when a collapsible list is shown or hidden."},{"name":"cm-reorder","description":"When a row is moved. See `cm-nested-item`."},{"name":"cm-move","description":"When a row moves into another list with the same `group`. Fired on the row before it moves, so it bubbles through the list it leaves. See `cm-nested-item`."}],"parts":[{"tag":"cm-nested-item","react":"NestedItem","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Row text, e.g. a menu link or category name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the item in `cm-reorder` handlers."},{"attribute":"sortable","property":"sortable","type":"boolean","default":"false","description":"Shows the drag handle. Set by the parent list from its own `sortable`."},{"attribute":"_hasChildren","property":"_hasChildren","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"list","type":"CmNestedList | null","description":"The `cm-nested-list` this item is a top-level row of, or null when it is nested in another item."},{"property":"siblings","type":"CmNestedItem[]","description":"Sibling `cm-nested-item`s, including this one."}],"methods":[{"name":"moveToList","description":"Moves this top-level row into another `cm-nested-list` with the same `group`, at position `to` (default: the\nend), firing a cancelable `cm-move` first. With its own list it is the same as `moveTo(to)`. Use it for a\n\"Move to…\" menu. Returns false if nothing moved. Since 1.3."},{"name":"moveTo","description":"Moves this item to a position among its siblings, firing a cancelable `cm-reorder` first.\nReturns false if nothing moved."}],"slots":[{"name":"(default)","description":"Child `cm-nested-item`s."},{"name":"actions","description":"Controls at the end of the row: a badge, a toggle, edit and delete buttons."}],"events":[{"name":"cm-move","description":"Bubbles from the item before it moves into another list with the same `group` (since 1.3): `detail: { item, from, to, fromList, toList }`, where `from` is its position in `fromList` and `to` its position in `toList` after the move. Cancelable: the component moves the element unless you call `preventDefault()`."},{"name":"cm-reorder","description":"Bubbles from the moved item: `detail: { item, from, to }` (positions among its siblings). Cancelable."}]}],"examples":[{"title":"Categories, sortable","html":"<cm-nested-list heading=\"Clothing & accessories\" sortable>\n <cm-toggle slot=\"actions\" checked aria-label=\"Show Clothing & accessories\"></cm-toggle>\n <cm-nested-item label=\"Footwear and shoes\"><cm-toggle slot=\"actions\" aria-label=\"Show Footwear and shoes\"></cm-toggle></cm-nested-item>\n <cm-nested-item label=\"Games & toys\"><cm-toggle slot=\"actions\" aria-label=\"Show Games & toys\"></cm-toggle></cm-nested-item>\n <cm-nested-item label=\"Pet items\">\n <cm-toggle slot=\"actions\" checked aria-label=\"Show Pet items\"></cm-toggle>\n <cm-nested-item label=\"Accessories\"><cm-toggle slot=\"actions\" checked aria-label=\"Show Accessories\"></cm-toggle></cm-nested-item>\n <cm-nested-item label=\"Exclusive items\">\n <cm-toggle slot=\"actions\" checked aria-label=\"Show Exclusive items\"></cm-toggle>\n <cm-nested-item label=\"Limited editions\"><cm-toggle slot=\"actions\" checked aria-label=\"Show Limited editions\"></cm-toggle></cm-nested-item>\n </cm-nested-item>\n </cm-nested-item>\n</cm-nested-list>"},{"title":"Navigation menu, collapsible","html":"<cm-nested-list heading=\"Header\" collapsible sortable>\n <cm-button slot=\"actions\" variant=\"primary\" size=\"large\">Add links</cm-button>\n <cm-nested-item label=\"Home\">\n <cm-badge slot=\"actions\" tone=\"success\">Accepted</cm-badge>\n <cm-button slot=\"actions\" size=\"slim\">Edit</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Delete</cm-button>\n </cm-nested-item>\n</cm-nested-list>"},{"title":"Move rows between lists","description":"Since 1.3. Give sortable lists the same `group` and their top-level rows move between them: drag a handle onto another list (mouse or touch), or focus a handle and press ↓ on the last row (↑ on the first) to move it into the next (previous) list. The component moves the element and fires a cancelable `cm-move` on the row, with `detail: { item, from, to, fromList, toList }`; it bubbles through the list the row leaves, so listen on a common container or `document`. Moves inside one list still fire `cm-reorder`. For a \"Move to…\" menu, call `item.moveToList(list, index)`. An empty list in a group shows a drop area.","html":"<div class=\"stack\">\n<cm-nested-list heading=\"Lead details\" group=\"layout\" sortable heading-level=\"3\">\n <cm-nested-item label=\"Lead name\" value=\"name\"></cm-nested-item>\n <cm-nested-item label=\"Company\" value=\"company\"></cm-nested-item>\n <cm-nested-item label=\"Phone\" value=\"phone\"></cm-nested-item>\n</cm-nested-list>\n<cm-nested-list heading=\"Contact details\" group=\"layout\" sortable heading-level=\"3\">\n <cm-nested-item label=\"Email\" value=\"email\"></cm-nested-item>\n <cm-nested-item label=\"City\" value=\"city\"></cm-nested-item>\n</cm-nested-list>\n<cm-nested-list heading=\"Hidden fields\" group=\"layout\" sortable heading-level=\"3\"></cm-nested-list>\n</div>"}],"do":["Listen for `cm-reorder` to save the new order; call `preventDefault()` to refuse a move.","Between lists with a `group`, listen for `cm-move` (on `document` or a container of all the lists) to save which list each row is in; `preventDefault()` refuses the move, and the row stays where it was.","Give icon-only controls in a row a name that includes the row: \"Edit Home\", \"Delete Home\".","Keep nesting to three levels or fewer."],"dont":["Don't use it for long lists of products or orders: use a resource list.","Don't rely on drag and drop alone to explain reordering: the handles also move with ↑/↓."],"content":["Row labels are the names merchants gave the links or categories.","Heading is the menu or parent category name."],"accessibility":["The rows are nested lists (`list`/`listitem`), so screen readers announce the level and position.","Drag handles are buttons named \"Reorder {label}\": ↑/↓ move the row among its siblings, Home/End to the ends. The new position is announced.","In lists with a `group` (since 1.3), ↓ on the last row moves it to the top of the next list in the group and ↑ on the first row to the end of the previous one (lists that are collapsed, not sortable or in another group are skipped). Focus stays on the handle, and the target list announces \"Phone moved to Contact details, position 1 of 3.\"; the handle's hint says the arrows cross lists.","Touch: the handle drags with pointer events (and doesn't scroll the page); the row moves when the finger lifts. Mouse drags use HTML drag and drop.","Only top-level rows move between lists; nested rows move among their siblings. To change a row's parent item, edit it.","The collapse button has `aria-expanded` and is named \"Hide {heading}\" / \"Show {heading}\".","The heading is 20px semibold (16px on phones); drag handles use the `drag` icon; row actions come from your own components (toggle, buttons, badge)."],"responsive":["When the window is 640px wide or less, rows keep their 48px height with 8px side padding; child rows are indented 20px instead of 48px, and the list header is at least 56px tall with a 16px title."],"related":["accordion","toggle","resource-list"]},{"tag":"cm-report-tiles","slug":"report-tile","name":"Report tile","react":"ReportTiles","group":"Lists","summary":"Square tiles that open reports, grouped under a title such as \"Sales\".","lead":"146 × 120px tiles with a `border-subtle` edge, a 40px icon and a 14px medium name, 12px apart. Pinned tiles show a pin in the corner. On phones tiles are 104px high, three to a row, with a 32px icon.","docs_url":"https://commmerce.com/commmerceui/#components--report-tile","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Group title, e.g. \"Sales\"."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"2","description":"Heading level for the title (1–6)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"`cm-report-tile` elements."}],"events":[],"parts":[{"tag":"cm-report-tile","react":"ReportTile","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Report name, two or three words."},{"attribute":"icon","property":"icon","type":"IconName","default":"'chart'","description":"System icon shown above the name."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Opens the report page."},{"attribute":"pinned","property":"pinned","type":"boolean","default":"false","description":"Shows a pin: the report is pinned to the dashboard."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"icon","description":"Your own 40px illustration, used instead of `icon`."}],"events":[{"name":"click","description":"When a tile without `href` is chosen."}]}],"examples":[{"title":"Sales reports","html":"<cm-report-tiles heading=\"Sales\">\n <cm-report-tile label=\"Hourly sales\" icon=\"clock\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Daily sales\" icon=\"calendar\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Monthly sales\" icon=\"chart\" href=\"#/components/report-tile\" pinned></cm-report-tile>\n <cm-report-tile label=\"Sales by product\" icon=\"box\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Sales by payment\" icon=\"cart\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Customers\" icon=\"users\" href=\"#/components/report-tile\"></cm-report-tile>\n</cm-report-tiles>"}],"do":["Group tiles by subject (\"Sales\", \"Customers\", \"Inventory\") with one `cm-report-tiles` each.","Use `href` so tiles open in a new tab with a middle click.","Pin the reports merchants use most; pinned tiles also appear on the dashboard."],"dont":["Don't put numbers or charts in a tile: tiles only open reports. To show a total, use a Metric.","Don't use long names that wrap to three lines."],"content":["Names are two or three words in sentence case: \"Hourly sales\", \"Sales by payment\".","Group titles are one word where possible: \"Sales\"."],"accessibility":["Tiles form a list named by the group heading; each tile is one link (or button) named by its label.","A pinned tile adds \", pinned\" to its name; the pin icon itself is hidden.","Icons are decorative and hidden from screen readers.","Tiles use the line icons (`clock`, `calendar`, `chart`, …); pass your own artwork in the `icon` slot. Tiles stretch to fill the row on phones."],"responsive":["When the window is wider than 640px, tiles are 146px wide and each row holds as many as fit.","At 640px or less, each row holds exactly three tiles, which share the width; tiles are 104px tall with 32px icons and 13px names."],"related":["card","smart-tip","nested-list"]},{"tag":"cm-sparkline","slug":"sparkline","name":"Sparkline","react":"Sparkline","group":"Lists","summary":"A word-sized chart of one series over time, beside the figure it explains: visits in the last 30 days, orders this week.","lead":"Since 1.10.0. Bars (the default) for counts per day or week, a line (`type=\"line\"`) for a level that moves. No axes or numbers of its own: put the figure next to it. Neutral bars are grey with the latest one in the text colour; `tone=\"information\"` or `\"success\"` colours them. Time runs left to right in every language. Screen readers hear one sentence: the total, the peak (and when, with `labels`) and the latest value.","docs_url":"https://commmerce.com/commmerceui/#components--sparkline","properties":[{"attribute":"values","property":"values","type":"number[]","default":"[]","description":"The points, oldest first. In HTML: `values=\"[0,2,1,4]\"` or `values=\"0,2,1,4\"`."},{"attribute":"labels","property":"labels","type":"string[]","default":"[]","description":"Optional name of each point, oldest first (\"12 Nov\"), for the summary and the hover text."},{"attribute":"label","property":"label","type":"string","default":"''","description":"What the series is, e.g. \"Visits, last 30 days\". Used in the accessible summary."},{"attribute":"type","property":"type","type":"SparklineType","default":"'bars'","description":"`bars` (default) for counts; `line` for a level."},{"attribute":"tone","property":"tone","type":"SparklineTone","default":"'neutral'","description":"Colour: `neutral` (default, the text colour at 60%), `information` or `success`."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"summary","type":"string","description":"The sentence screen readers hear."}],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Visits on a record","description":"With `labels`, pointing at a bar shows its day and count.","html":"<cm-info-panel heading=\"Website visit summary\" style=\"max-width:360px\">\n <cm-info-item half label=\"Visits\">14</cm-info-item>\n <cm-info-item half label=\"Last visit\">Today, 10:42</cm-info-item>\n <cm-info-item label=\"Visits, last 14 days\">\n <cm-sparkline label=\"Visits, last 14 days\" values=\"[0,1,0,0,2,1,0,3,0,1,2,0,1,3]\"\n labels='[\"4 Nov\",\"5 Nov\",\"6 Nov\",\"7 Nov\",\"8 Nov\",\"9 Nov\",\"10 Nov\",\"11 Nov\",\"12 Nov\",\"13 Nov\",\"14 Nov\",\"15 Nov\",\"16 Nov\",\"17 Nov\"]'></cm-sparkline>\n </cm-info-item>\n</cm-info-panel>"},{"title":"Line and tones","html":"<div style=\"display:grid;gap:16px;max-width:240px\">\n <cm-sparkline type=\"line\" label=\"Visitor score, last 8 weeks\" values=\"[12,18,15,22,30,28,35,41]\"></cm-sparkline>\n <cm-sparkline tone=\"information\" label=\"Leads per day\" values=\"4,6,3,8,5,9,7\"></cm-sparkline>\n <cm-sparkline tone=\"success\" label=\"Orders per day\" values=\"2,3,5,4,6,8,9\"></cm-sparkline>\n</div>"}],"do":["Say what it covers in the label next to it (\"Visits, last 14 days\") and give the same words to `label`.","Use bars for counts and a line for levels."],"dont":["Don't use it where people need exact values or comparisons between series: use a table or a full chart.","Don't put more than about 60 points in it."],"content":["The label names the series and the period: \"Visits, last 14 days\"."],"accessibility":["One `role=\"img\"` with a sentence: \"Visits, last 14 days: 14 in all, peak 3 on 11 Nov, latest 3\". The words are built-in strings (`sparkline.*`), numbers follow the locale.","The hover text per bar is for mouse users only; everything in it is also in the sentence or the figure beside the chart."],"responsive":["32px tall by default (`--cm-sparkline-height`); as wide as its container, at most `--cm-sparkline-width`."],"related":["metric","info-panel","report-tile"]},{"tag":"cm-metric","slug":"metric","name":"Metric","react":"Metric","group":"Lists","summary":"One number with its name, such as a report total or KPI, optionally linking to the list behind it.","lead":"A card-like tile: a 14px medium label, a 24px semibold figure in tabular numerals (`type-heading-lg`), then an optional change (\"+12%\" with an arrow) and a quieter hint line. A number in `value` is formatted for the page language (\"1,240\"; lakh grouping \"12,40,000\" in `en-IN`); any other text is shown as given. With `href` the whole tile is one link. For a row of totals use Grid: there is no separate container.","docs_url":"https://commmerce.com/commmerceui/#components--metric","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"What is counted, e.g. \"SMB leads\". Two to four words."},{"attribute":"value","property":"value","type":"number | string","default":"''","description":"The figure. A number (or a plain number in the attribute, `value=\"1240\"`) is formatted for the locale:\n\"1,240\", and lakh grouping \"12,40,000\" in `en-IN`. Any other text (\"Rs. 2.4 L\", \"3 of 5\") is shown as given."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"One line under the figure in a quieter colour, e.g. \"2 past demos need a result\"."},{"attribute":"change","property":"change","type":"string","default":"''","description":"The change to show, written as you want it read, e.g. \"+12%\" or \"-3 vs last week\"."},{"attribute":"trend","property":"trend","type":"MetricTrend | undefined","description":"Direction of `change`: `up`, `down` or `flat`. Adds an arrow and says the direction to screen readers."},{"attribute":"trend-sentiment","property":"trendSentiment","type":"MetricSentiment","default":"'auto'","description":"Whether the change is good news. `auto` (default): up is positive (green), down is negative (red), flat is\nneutral. Set `negative` when up is bad (more refunds, more overdue tasks), `positive` when down is good."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the whole tile one link, named by the label and figure, e.g. to the list behind the number."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a placeholder instead of the figure and announces \"Loading <label>\" politely."},{"attribute":"_hasHint","property":"_hasHint","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"hint","description":"A hint with markup (e.g. a bold count), used instead of `hint`. No links or buttons: with `href` the whole tile is already one link."}],"events":[],"parts":[],"examples":[{"title":"Report totals with hints","description":"The CRM Reports row: each total opens its list. `cm-grid min-column-width` fits as many tiles as there is room for; resize the example to see the row wrap.","html":"<cm-grid min-column-width=\"260px\" gap=\"16\" lang=\"en-IN\">\n <cm-metric label=\"SMB leads\" value=\"1240\" href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Enterprise leads\" value=\"86\" href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Demos in the next 7 days\" value=\"3\" hint=\"2 past demos need a result\" href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Pipeline value\" value=\"Rs. 12,40,000\" hint=\"Open deals only\" href=\"#/components/metric\"></cm-metric>\n</cm-grid>"},{"title":"With a change","description":"`change` is the text to show, `trend` its direction. Up is good news and down bad by default; set `trend-sentiment=\"negative\"` when a rise is bad (more overdue tasks, more refunds) or `positive` when a fall is good. The arrow and the words read to screen readers carry the meaning, not only the colour.","html":"<cm-grid min-column-width=\"200px\" gap=\"16\" lang=\"en-IN\">\n <cm-metric label=\"Won deals\" value=\"48\" change=\"+12%\" trend=\"up\" hint=\"vs last month\"></cm-metric>\n <cm-metric label=\"New leads\" value=\"1240\" change=\"-5%\" trend=\"down\" hint=\"vs last month\"></cm-metric>\n <cm-metric label=\"Overdue tasks\" value=\"9\" change=\"+3\" trend=\"up\" trend-sentiment=\"negative\" hint=\"since yesterday\"></cm-metric>\n <cm-metric label=\"Average reply time\" value=\"2 h\" change=\"0%\" trend=\"flat\" hint=\"vs last week\"></cm-metric>\n</cm-grid>"},{"title":"Loading","description":"While the totals are fetched, set `loading`: a placeholder takes the figure's place, the tile is `aria-busy` and \"Loading <label>\" is announced politely. Keep the label visible so the row doesn't jump.","html":"<cm-grid min-column-width=\"200px\" gap=\"16\">\n <cm-metric label=\"SMB leads\" loading href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Demos in the next 7 days\" loading href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Pipeline value\" loading href=\"#/components/metric\"></cm-metric>\n</cm-grid>"},{"title":"A single metric","description":"A hint with markup goes in the `hint` slot. Without `href` the tile is plain text: nothing to focus.","html":"<cm-metric label=\"Tickets waiting\" value=\"17\" style=\"max-width:260px\">\n <span slot=\"hint\"><strong>4</strong> older than a day</span>\n</cm-metric>"}],"do":["Pass numbers as numbers (`value=\"1240\"`, or `value={1240}` in React) so they are grouped for the page language; pass text only when it is already formatted, such as money with a currency (\"Rs. 12,40,000\").","Link each total to the list behind it with `href`, filtered to the same records the number counts.","Put a row of metrics in `cm-grid` with `min-column-width` (about 200px) so it wraps on narrow screens.","Say what the change compares with in the hint: \"vs last month\".","Set `trend-sentiment` whenever up is not good news."],"dont":["Don't use it to open a report that has no single number: use a Report tile.","Don't rely on colour for good or bad: always set `trend`, so there is an arrow and the direction is read out.","Don't put buttons or other links inside a linked metric: the whole tile is one link.","Don't show more than one figure in a tile: split it into two metrics."],"content":["Labels name what is counted, in two to four words and sentence case: \"SMB leads\", \"Demos in the next 7 days\".","Hints are one short line, no full stop: \"2 past demos need a result\".","Write the change as it should read, with its sign: \"+12%\", \"-3\"."],"accessibility":["With `href` the tile is a single link whose accessible name is the label and the figure (\"SMB leads 1,240\"); the change and hint are its description. Without `href` nothing in it takes focus.","The change arrow is decorative; screen readers hear the direction and whether it is good news in words (\"Up +12%, good\"). Wording is in the `metric` strings (`up`, `down`, `flat`, `good`, `bad`).","While `loading`, the figure is replaced by a hidden placeholder, the tile has `aria-busy=\"true\"` and \"Loading <label>\" is announced through a polite status region (key `loadingValue`).","Colours meet WCAG AA on `bg-surface` in light and dark: label and figure `text-default`, hint and flat change `text-tertiary`, good `text-success`, bad `text-critical`. These pairs are in the token contrast check.","Arrows follow the reading direction: in right-to-left text up points up-left and down points down-left.","The figure uses the `type-heading-lg` token: 24px semibold (20px on phones)."],"responsive":["Fills the width it is given; put a row of metrics in a `cm-grid` with `min-column-width`, which drops to fewer columns, and to one on phones, as the space shrinks.","When the window is 640px wide or less, the tile padding is 12px instead of 20px and the figure is 20px instead of 24px. Long figures and labels wrap instead of overflowing.","In a grid row, every metric stretches to the height of the tallest, so tiles with and without a hint line up."],"related":["grid","report-tile","card"]},{"tag":"cm-app-frame","slug":"app-frame","name":"App frame","react":"AppFrame","group":"Navigation","summary":"The admin's frame: header bar, side or bottom navigation, mobile menu and the page, in their places.","lead":"One element that puts the parts of the admin together: the Header bar across the top, the Side navigation down the start side, the page next to it, and on phones and small tablets the Bottom navigation with the Mobile menu instead. Every Commmerce product gets the same grid without writing its own CSS. See Admin frame for the whole thing at desktop and phone widths. Add `panel` for the merchant dashboard look: a white header on the grey page, the side navigation as an inset card, and the page in a white panel with 12px corners and a 1px `border-subtle` edge, `space-20` from the navigation and the window edges (`--cm-app-frame-gutter` changes it). A `cm-page` inside drops its grey background. On phones the panel runs edge to edge.","docs_url":"https://commmerce.com/commmerceui/#components--app-frame","properties":[{"attribute":"menu-open","property":"menuOpen","type":"boolean","default":"false","description":"Shows the mobile menu (on narrow frames). Set it yourself, or let `menu-item` do it."},{"attribute":"menu-item","property":"menuItem","type":"string","default":"''","description":"Value of the bottom navigation item that opens and closes the mobile menu, e.g. `more` for\n`<cm-nav-item label=\"More\" value=\"more\">`. When set, choosing it toggles `menu-open`, Escape closes the\nmenu, and choosing a row in the menu closes it. Empty: you wire the menu yourself."},{"attribute":"panel","property":"panel","type":"boolean","default":"false","description":"Shows the page in a white rounded panel beside the side navigation, with a gutter around it, on the grey page:\nthe merchant dashboard frame. A `cm-page` inside gets a transparent background. Phones: the panel is edge to edge."},{"attribute":"_wide","property":"_wide","type":"boolean","default":"false"}],"script_properties":[{"property":"wide","description":"True while the frame is 1024px wide or more and shows the side navigation instead of the bottom navigation."}],"methods":[{"name":"openMenu","description":"Opens the mobile menu and moves focus into it."},{"name":"closeMenu","description":"Closes the mobile menu and returns focus to where it was before the menu opened."},{"name":"toggleMenu","description":"Opens the mobile menu if it is closed, closes it if it is open."}],"slots":[{"name":"header","description":"A `cm-header-bar`."},{"name":"navigation","description":"A `cm-side-navigation`. Shown when the frame is 1024px wide or more. Collapse it with its `collapsed` attribute; the frame follows its width."},{"name":"(default)","description":"The page, usually a `cm-page`. Wrapped in the frame's `main` landmark."},{"name":"bottom-navigation","description":"A `cm-bottom-navigation`. Shown, fixed to the bottom of the window, when the frame is narrower than 1024px. No need to set its `fixed` attribute."},{"name":"mobile-menu","description":"A `cm-mobile-menu`. Shown over the page while `menu-open` is set and the frame is narrower than 1024px."}],"events":[{"name":"cm-menu-toggle","description":"When the frame opens or closes the mobile menu itself: from the `menu-item` in the bottom navigation, Escape, or a choice in the menu. `detail: { open }`. Not fired when you set `menu-open` yourself. With `panel` the frame takes the merchant dashboard's look: the page sits in a white rounded panel (`bg-surface`, `radius-lg`, a 1px `border-subtle`) with a `space-20` gutter beside and below the side navigation card, on the grey `bg-page` under the white header. A `cm-page` inside drops its own grey background. Narrower than 1024px (bottom navigation) the panel runs edge to edge, white, without a gutter or corners, so phones keep every pixel of width."}],"parts":[],"examples":[{"title":"Desktop, with panel","description":"`panel`: the page in a white rounded panel beside the side navigation card, on the grey page under the white header. The frame is 1100px wide here (scroll sideways in a narrow preview), so it shows the desktop layout.","html":"<div style=\"height:520px;overflow:auto;border-radius:12px;--cm-app-frame-height:520px\">\n<div style=\"width:1100px;transform:translateZ(0)\">\n<cm-app-frame panel>\n <cm-header-bar slot=\"header\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"152\" height=\"11\">\n </cm-header-bar>\n <cm-side-navigation slot=\"navigation\">\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#/components/app-frame\" current badge=\"12\"></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#/components/app-frame\"></cm-nav-item>\n </cm-side-navigation>\n <cm-page>\n <cm-page-header slot=\"header\" heading=\"Orders\"><cm-button slot=\"actions\" variant=\"primary\">Create order</cm-button></cm-page-header>\n <cm-card heading=\"Today\">12 orders · Rs. 18,400</cm-card>\n </cm-page>\n</cm-app-frame>\n</div>\n</div>"},{"title":"Phone: bottom navigation and menu","description":"The preview is narrower than 1024px, so it shows the phone layout. Press More to open the Mobile menu, and again (or Esc) to close it. The two outer divs only keep the example in its box: in your app, `cm-app-frame` is the top element of the page. The desktop layout is on the Admin frame page.","html":"<div style=\"height:560px;transform:translateZ(0);overflow:hidden;border-radius:12px;--cm-app-frame-height:560px\">\n<div style=\"height:100%;overflow:auto\">\n<cm-app-frame panel menu-item=\"more\">\n <cm-header-bar slot=\"header\" store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n </cm-header-bar>\n <cm-side-navigation slot=\"navigation\" collapsible>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#/components/app-frame\" current badge=\"12\"></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#/components/app-frame\"></cm-nav-item>\n </cm-side-navigation>\n <cm-page>\n <cm-page-header slot=\"header\" heading=\"Orders\"></cm-page-header>\n <cm-card heading=\"Today\">12 orders · Rs. 18,400</cm-card>\n </cm-page>\n <cm-bottom-navigation slot=\"bottom-navigation\">\n <cm-nav-item label=\"Home\" icon=\"home\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#/components/app-frame\" current></cm-nav-item>\n <cm-nav-item label=\"Quick add\" icon=\"plus\" primary></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"More\" icon=\"more\" value=\"more\"></cm-nav-item>\n </cm-bottom-navigation>\n <cm-mobile-menu slot=\"mobile-menu\" store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <cm-nav-item label=\"Panels\">\n <cm-nav-item label=\"Customers\" icon=\"users\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Reports\" icon=\"chart\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\" href=\"#/components/app-frame\"></cm-nav-item>\n </cm-nav-item>\n </cm-mobile-menu>\n</cm-app-frame>\n</div>\n</div>"}],"do":["Make it the top element of every page of a Commmerce product, with the same navigation items on every page.","Use `panel` for products built on the merchant dashboard frame (the admin, CRM). It replaces hand-written margins and corners around the page: delete those when you add it.","Set `menu-item=\"more\"` and give the bottom navigation's More item `value=\"more\"`, unless you need to open the menu yourself.","Remember the merchant's collapsed side navigation: listen for `cm-collapse` and set `collapsed` from what you stored."],"dont":["Don't use it inside an app: the admin already draws this frame around apps.","Don't put another `main`, `header` or `nav` around its parts: the frame and the parts bring their own landmarks.","Don't set `fixed` on the bottom navigation or position the parts yourself: the frame does it."],"content":["The frame has no text of its own. Words come from the parts."],"accessibility":["Adds one landmark, `main`, around the page. The header bar is the `banner` and each navigation is a `nav`; only the one that fits the width is shown, so screen readers find a single main menu.","While the mobile menu is open, the header and page behind it are inert, so Tab and screen readers stay in the menu and the bottom navigation.","With `menu-item`, opening the menu moves focus to its first row; Esc or More closes it and focus goes back to More. Choosing a row closes it.","Logical CSS: in right-to-left languages the side navigation is on the right.","The bottom navigation's More button does not say whether the menu is open (no `aria-expanded`): it is a navigation item, like the other tabs."],"responsive":["Follows the frame's own width (normally the window's): at 1024px and wider the side navigation sits on the start side under the header; narrower, the side navigation is hidden and the bottom navigation is fixed to the bottom of the window, with the page padded so nothing hides behind it.","With `panel`, at 1024px and wider the page sits in a white rounded panel with a `space-20` gutter; narrower, the panel is edge to edge without corners.","The header sticks to the top, below the device's notch or status bar (`env(safe-area-inset-top)`). The side navigation sticks under the header and scrolls on its own when it is taller than the window. The page scrolls with the window.","The mobile menu, while `menu-open` is set and the frame is narrower than 1024px, covers the window above the page and header and below the bottom navigation."],"related":["side-navigation","header-bar","bottom-navigation","mobile-menu","page"]},{"tag":"cm-side-navigation","slug":"side-navigation","name":"Side navigation","react":"SideNavigation","group":"Navigation","summary":"The admin's main menu down the left of the page, with sections that open.","lead":"A 220px black panel (owner standard, 1.6; was 250px) with 12px corners, inset 20px from the page edges. Each 36px row (44px on touch screens), padded 12px at the sides, has a 20px line icon and a 14px label (sub-items 32px); badges are small sentence-case pills; sections end in a chevron and open to show their sub-items. The current page is white and bold, the rest light grey. Items come from `cm-nav-item` children or a JSON `items` property, so every Commmerce product can fill it with its own destinations.","docs_url":"https://commmerce.com/commmerceui/#components--side-navigation","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Items as data. Used instead of `cm-nav-item` children when set."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Default: the built-in string `label` (\"Main\")."},{"attribute":"collapsed","property":"collapsed","type":"boolean","default":"false","description":"Shows only the icons, in a narrow rail. Labels become tooltips and stay the items' accessible names; sub-items are hidden."},{"attribute":"collapsible","property":"collapsible","type":"boolean","default":"false","description":"Adds a button at the bottom that collapses the menu to icons and expands it again, firing `cm-collapse`."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"_open","property":"_open","default":"new Set<string>()"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"navItems","type":"NavItem[]","description":"The items in use."}],"methods":[{"name":"toggle","description":"Opens or closes the section at `index`."}],"slots":[{"name":"(default)","description":"`cm-nav-item` elements (nest them for sub-items)."},{"name":"header","description":"Optional content above the items, such as a store switcher on narrow layouts."},{"name":"footer","description":"Optional content below the items."}],"events":[{"name":"cm-expand","description":"When a section opens or closes. `detail: { item, expanded }`."},{"name":"cm-collapse","description":"When the merchant collapses the menu to icons or expands it again: from the built-in button (`collapsible`), or by choosing a section while collapsed (that expands the menu and opens the section). `detail: { collapsed }`. Cancelable: call `preventDefault()` to keep the current state. Not fired when you set `collapsed` yourself."},{"name":"cm-navigate","description":"When an item is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app instead of following the link."}],"parts":[{"tag":"cm-nav-item","react":"NavItemElement","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Where the item goes. Leave empty on a parent that only opens its sub-items."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the item in `cm-navigate` handlers."},{"attribute":"current","property":"current","type":"boolean","default":"false","description":"The page the merchant is on."},{"attribute":"badge","property":"badge","type":"string","default":"''","description":"Short text after the label, e.g. \"New\"."},{"attribute":"expanded","property":"expanded","type":"boolean","default":"false","description":"Sub-items start open."},{"attribute":"primary","property":"primary","type":"boolean","default":"false","description":"Bottom navigation only: the one main action, drawn as a black square (Quick add)."}],"script_properties":[],"methods":[{"name":"toItem","description":"This item and its sub-items as plain data."}],"slots":[{"name":"(default)","description":"Child `cm-nav-item`s (sub-items)."}],"events":[]}],"examples":[{"title":"Commmerce admin","description":"The items of the live admin. A section that holds the current page opens on its own.","html":"<cm-side-navigation>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#dashboard\" current></cm-nav-item>\n <cm-nav-item label=\"Catalog\" icon=\"box\">\n <cm-nav-item label=\"Products\" href=\"#products\"></cm-nav-item>\n <cm-nav-item label=\"Categories\" href=\"#categories\"></cm-nav-item>\n <cm-nav-item label=\"Inventory\" href=\"#inventory\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\">\n <cm-nav-item label=\"All orders\" href=\"#orders\"></cm-nav-item>\n <cm-nav-item label=\"Abandoned carts\" href=\"#abandoned\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"WebPOS\" icon=\"pos\" href=\"#webpos\"></cm-nav-item>\n <cm-nav-item label=\"Customers\" icon=\"users\">\n <cm-nav-item label=\"All customers\" href=\"#customers\"></cm-nav-item>\n <cm-nav-item label=\"Customer groups\" href=\"#customer-groups\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Subscriptions\" icon=\"repeat\" href=\"#subscriptions\"></cm-nav-item>\n <cm-nav-item label=\"Website\" icon=\"website\">\n <cm-nav-item label=\"Themes\" href=\"#themes\"></cm-nav-item>\n <cm-nav-item label=\"Pages\" href=\"#pages\"></cm-nav-item>\n <cm-nav-item label=\"Menus\" href=\"#menus\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Apps\" icon=\"apps\" href=\"#apps\"></cm-nav-item>\n <cm-nav-item label=\"Reports\" icon=\"chart\" href=\"#reports\"></cm-nav-item>\n <cm-nav-item label=\"Marketing\" icon=\"megaphone\">\n <cm-nav-item label=\"Discounts\" href=\"#discounts\"></cm-nav-item>\n <cm-nav-item label=\"Campaigns\" href=\"#campaigns\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Staff\" icon=\"staff\">\n <cm-nav-item label=\"Team members\" href=\"#staff\"></cm-nav-item>\n <cm-nav-item label=\"Roles\" href=\"#roles\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\">\n <cm-nav-item label=\"Store details\" href=\"#store\"></cm-nav-item>\n <cm-nav-item label=\"Payments\" href=\"#payments\"></cm-nav-item>\n <cm-nav-item label=\"Shipping\" href=\"#shipping\"></cm-nav-item>\n </cm-nav-item>\n</cm-side-navigation>"},{"title":"Inside a sub-section","description":"Mark the sub-item as `current`; its section opens and its label turns white.","html":"<cm-side-navigation>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#dashboard\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\">\n <cm-nav-item label=\"All orders\" href=\"#orders\" current></cm-nav-item>\n <cm-nav-item label=\"Abandoned carts\" href=\"#abandoned\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Apps\" icon=\"apps\" href=\"#apps\" badge=\"New\"></cm-nav-item>\n</cm-side-navigation>"},{"title":"Collapsed to icons","description":"`collapsed` shows a 72px rail. Hover or focus an item to see its label; a numeric badge stays as a small count, any other badge as a dot. `collapsible` adds the button at the bottom, which fires `cm-collapse` so your app can remember the choice. Choosing a section in the rail expands the menu and opens the section.","html":"<cm-side-navigation collapsed collapsible>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#dashboard\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#orders\" current badge=\"12\"></cm-nav-item>\n <cm-nav-item label=\"Customers\" icon=\"users\" href=\"#customers\"></cm-nav-item>\n <cm-nav-item label=\"Apps\" icon=\"apps\" href=\"#apps\" badge=\"New\"></cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\">\n <cm-nav-item label=\"Store details\" href=\"#store\"></cm-nav-item>\n <cm-nav-item label=\"Payments\" href=\"#payments\"></cm-nav-item>\n </cm-nav-item>\n</cm-side-navigation>"}],"do":["Use one side navigation per product, on every page, with the same items in the same order.","Mark exactly one item `current`.","Use the `cm-navigate` event (and `preventDefault()`) when your app routes on the client.","Below 1024px, hide it and show a Bottom navigation with a Mobile menu instead. The App frame does this for you.","To let merchants collapse it, add `collapsible` (or your own button that sets `collapsed`), listen for `cm-collapse` and store the choice, so the menu stays collapsed on the next page.","Give every item an icon if the menu can be collapsed: without one, the rail shows the label's first letter."],"dont":["Don't use it inside an app: apps run inside the admin, which already has this menu.","Don't nest more than one level: deeper items are listed under their section, indented.","Don't put actions (\"Add product\") in the menu: it only goes to places."],"content":["One or two words per item, naming a place: \"Orders\", \"Staff\". Keep each label to about 18 characters so it fits the 220px menu on one line; a longer label wraps and crowds its row.","Keep the order merchants know: Dashboard first, Settings last."],"accessibility":["A `nav` landmark named \"Main\" (set `label` to change it). Items are links; the current one has `aria-current=\"page\"`.","Sections are buttons with `aria-expanded` and `aria-controls`. Enter or Space opens and closes them; → opens, ← closes or goes back to the section from a sub-item.","↑/↓ move between visible items, Home/End jump to the first and last. Tab still moves through every item.","Collapsed: each item keeps its label as its accessible name (visually hidden, with the badge in brackets) and shows it in a tooltip on hover and keyboard focus. The tooltip only repeats the name, so it is not added as a description. Sub-items are hidden; a section is a button that expands the menu and opens it. ← and → do nothing in the rail. The built-in button is named \"Collapse menu\" or \"Expand menu\" (translatable: `collapse`, `expand`).","Unselected items use the new `text-on-dark-secondary` token (#B5B5B5, 10:1 on black, AA on the hover fill); icons are decorative.","Differs from the live admin screenshot: icons are our line icons (the admin uses filled glyphs); new icons drawn for this: `pos`, `repeat`, `website`, `apps`, `megaphone`, `staff`. The source of truth is the admin screenshot, not the older Figma \"Dashboard\" page."],"related":["app-frame","header-bar","bottom-navigation","mobile-menu","tooltip"]},{"tag":"cm-header-bar","slug":"header-bar","name":"Header bar","react":"HeaderBar","group":"Navigation","summary":"The white bar across the top of the admin: logo, store switcher, account actions and the user.","lead":"A 56px white bar with 14px text. The logo sits on the left, then the store switcher (with a chevron). On the right: your action buttons, the wallet balance in an outlined 36px pill and the user in a 36px rounded pill with the name and a 28px avatar. It fits its own width: under 900px the action buttons hide, and under 640px only the logo, the store and the avatar remain (put the rest in the Mobile menu). A product-wide search goes in the `search` slot: inline after the store switcher on wide bars, and behind a search button that opens it full screen at 900px or narrower.","docs_url":"https://commmerce.com/commmerceui/#components--header-bar","properties":[{"attribute":"store","property":"store","type":"string","default":"''","description":"Current store's address or name, shown as the store switcher (\"preprod.commmerce.com\"). Empty hides it."},{"attribute":"balance","property":"balance","type":"string","default":"''","description":"Wallet balance, already formatted (\"₹ 2,312\"). Empty hides the pill."},{"attribute":"user-name","property":"userName","type":"string","default":"''","description":"Signed-in user's name. Empty hides the user pill."},{"attribute":"avatar-src","property":"avatarSrc","type":"string","default":"''","description":"Avatar image URL. Without it, the initials of `user-name` are shown."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the header's toolbar region. Default: the built-in string `label` (\"Admin\")."},{"attribute":"search-label","property":"searchLabel","type":"string","description":"Accessible name of the search button on narrow bars and of the search layer. Default: the built-in string `search` (\"Search\")."},{"attribute":"_narrow","property":"_narrow","type":"boolean","default":"false"},{"attribute":"_hasSearch","property":"_hasSearch","type":"boolean","default":"false"},{"attribute":"_searchOpen","property":"_searchOpen","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"searchOpen","type":"boolean","description":"True while the full-screen search layer is open."}],"methods":[{"name":"openSearch","description":"Brings up the search: focuses it on wide bars, or opens the full-screen layer on narrow ones."},{"name":"closeSearch","description":"Closes the full-screen search layer, and returns focus to the search button."}],"slots":[{"name":"logo","description":"The product logo (an `<img>` or `<svg>`), linked to the dashboard if you wrap it in `<a>`."},{"name":"actions","description":"Buttons such as \"Hire an Expert\" (secondary) and \"My Subscription\" (primary)."},{"name":"end","description":"Controls before the signed-in person, in this order: refresh, then notifications (1.9.2: the user comes last)."},{"name":"account","description":"The signed-in person's menu, last in the bar: a `cm-account-menu` (since 1.9.2). Use it instead of `user-name`."},{"name":"search","description":"One search box for the whole product, usually `cm-global-search`. Inline on wide bars; behind a search button that opens a full-screen layer at 900px or narrower."}],"events":[{"name":"name"},{"name":"cm-store-switch","description":"When the store switcher is pressed. Open your store list in response."},{"name":"cm-wallet","description":"When the wallet balance is pressed."},{"name":"cm-account","description":"When the user pill is pressed. Open the account menu in response."},{"name":"cm-search-toggle","description":"When the full-screen search layer opens or closes (narrow bars), with `detail: { open }`."}],"parts":[],"examples":[{"title":"Commmerce admin","html":"<cm-header-bar store=\"preprod.commmerce.com\" balance=\"₹ 2,312\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n <cm-button slot=\"actions\" size=\"large\">Hire an Expert</cm-button>\n <cm-button slot=\"actions\" variant=\"primary\" size=\"large\">My Subscription</cm-button>\n</cm-header-bar>"},{"title":"With global search","description":"Put a Global search in the `search` slot. This preview is narrower than 900px, so the bar shows the search button: press it to open the search full screen (Escape, the close button or choosing a result closes it). In a full-width admin the box sits inline after the store switcher.","html":"<cm-header-bar store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder-mark.svg\" alt=\"Store logo\" width=\"24\" height=\"24\">\n <cm-global-search slot=\"search\" label=\"Search the CRM\" placeholder=\"Search leads, deals, contacts\" shortcut=\"/\"\n results='[{\"label\": \"Leads\", \"items\": [{\"title\": \"Ravi Stores\", \"description\": \"Lead · Mumbai\", \"href\": \"#lead-ravi-stores\"}]}]'></cm-global-search>\n</cm-header-bar>"},{"title":"Logo and user only","description":"Products without stores or a wallet leave those attributes out.","html":"<cm-header-bar user-name=\"Asha Rao\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n</cm-header-bar>"},{"title":"Notifications bell","description":"Put an icon-only Button in the `end` slot with the unread count, and open the Notification panel when it is pressed (here with `data-opens`; in your product, call the panel's `show()` in a click listener). Keep `count` in step with the unread items. The bar has no notifications API of its own: the button and the panel are yours to wire.","html":"<cm-header-bar user-name=\"Asha Rao\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n <cm-button slot=\"end\" icon-only icon=\"bell\" label=\"Notifications\" count=\"2\" size=\"large\" data-opens=\"header-notes\"></cm-button>\n</cm-header-bar>\n<cm-notification-panel id=\"header-notes\" more-href=\"#notifications\">\n <cm-notification-item time=\"1 min ago\" href=\"#order-1042\" unread>New order received</cm-notification-item>\n <cm-notification-item time=\"12 mins ago\" tone=\"attention\" href=\"#stock\" unread>Product low stock</cm-notification-item>\n <cm-notification-item time=\"1 hr ago\" tone=\"success\" href=\"#order-1041\">Payment received</cm-notification-item>\n</cm-notification-panel>"}],"do":["Show it on every admin page, above the Side navigation.","Put one product-wide search in the `search` slot, not in `actions` (actions hide on narrow bars; the search slot collapses to a button instead).","Keep to two action buttons, with at most one primary.","Open a store list on `cm-store-switch` and an account menu on `cm-account` (menus arrive with batch 4)."],"dont":["Don't use it inside an app: the admin already shows it above the app.","Don't put page actions (\"Save\", \"Add product\") here; they belong in the Page header.","Don't format the balance in the component: pass the text the merchant should see."],"content":["Show the store's address or name exactly as the merchant set it.","Buttons are short and in title case as in the live admin: \"Hire an Expert\", \"My Subscription\"."],"accessibility":["A `banner` landmark. The store switcher, balance and user pill are buttons named \"Store: … Switch store\", \"Wallet balance …\" and \"Account: …\", which include their visible text.","On narrow bars the search button is named \"Search\" (`search-label`) with `aria-haspopup=\"dialog\"` and `aria-expanded`. It opens a full-screen modal `<dialog>` with the same name: focus moves into the search box, the page behind is inert and does not scroll, Escape (once the results are closed) or the close button closes it, and focus returns to the button.","The store and user buttons say they open a menu (`aria-haspopup`).","The logo needs its own `alt` text that names it: the store, product or app.","Differs from the live admin screenshot: the avatar is a person line icon on `bg-input-filled` when there is no photo; the examples show a placeholder logo, since the `logo` slot takes your product's or app's own logo; the 18px store text shrinks to 16px when the bar is under 1100px wide."],"responsive":["Follows the bar's own width, not the window: at 900px or narrower the `actions` slot is hidden and the `search` slot moves behind a search button that opens it full screen; at 640px or narrower the wallet balance is hidden too and the user pill shrinks to the avatar (the name is still read by screen readers). On touch screens every control in the bar is at least 44 × 44px."],"related":["side-navigation","mobile-menu","button"]},{"tag":"cm-bottom-navigation","slug":"bottom-navigation","name":"Bottom navigation","react":"BottomNavigation","group":"Navigation","summary":"The admin's tab bar on phones: five destinations along the bottom of the screen.","lead":"A white bar with 12px top corners and a hairline along its top. Each item is a 20px line icon over a 12px label in sentence case. The current item is black, the others grey; the main action (`primary`, Quick add) is a black square with a white plus. The last item, \"More\", opens the Mobile menu.","docs_url":"https://commmerce.com/commmerceui/#components--bottom-navigation","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Items as data. Used instead of `cm-nav-item` children when set."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Default: the built-in string `label` (\"Main\")."},{"attribute":"fixed","property":"fixed","type":"boolean","default":"false","description":"Pins the bar to the bottom of the viewport, above the device's home indicator."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"navItems","type":"NavItem[]","description":"The items in use."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-nav-item` elements (no nesting)."}],"events":[{"name":"cm-navigate","description":"When an item is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app. Items without `href` only fire this event (e.g. \"More\" opens the Mobile menu)."}],"parts":[],"examples":[{"title":"Commmerce admin on a phone","html":"<div style=\"max-width:414px\">\n<cm-bottom-navigation>\n <cm-nav-item label=\"Home\" icon=\"home\" href=\"#home\" current></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#products\"></cm-nav-item>\n <cm-nav-item label=\"Quick add\" icon=\"plus\" primary></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#orders\"></cm-nav-item>\n <cm-nav-item label=\"More\" icon=\"more\" value=\"more\"></cm-nav-item>\n</cm-bottom-navigation>\n</div>"}],"do":["Show it below 1024px instead of the Side navigation, pinned with `fixed`, or put it in the App frame's `bottom-navigation` slot, which pins it and pads the page for you.","Keep to five items; the fifth is \"More\" and opens the Mobile menu (listen for `cm-navigate` with `value` \"more\").","Leave space at the bottom of the page so the bar never covers content.","`fixed` pins the bar with `position: fixed` on the element itself, so a `position` you set on `cm-bottom-navigation` in your own CSS (for example `position: relative` from a reset or a utility class) wins and the bar stops being pinned. Don't set `position` on a fixed bar, or wrap it in your own fixed container. The App frame handles this for you: in its `bottom-navigation` slot the bar is pinned by the frame's own container, whatever position the element has."],"dont":["Don't use it inside an app.","Don't mark more than one item `primary`.","Don't use labels longer than one word: they are truncated."],"content":["One word per item: \"Home\", \"Products\", \"Orders\", \"More\". Write them in sentence case; they are shown as written."],"accessibility":["A `nav` landmark named \"Main\". Items are links (current one with `aria-current=\"page\"`) or buttons for actions such as Quick add and More.","Targets are at least 48px tall and a fifth of the width.","Labels are 12px, the smallest text in the system; unselected items are `text-tertiary` grey. With `fixed`, the bar pads for the device's home indicator."],"related":["app-frame","mobile-menu","side-navigation"]},{"tag":"cm-mobile-menu","slug":"mobile-menu","name":"Mobile menu","react":"MobileMenu","group":"Navigation","summary":"The admin's full menu on phones, opened from \"More\": store, user and every section.","lead":"A grey page of white cards with 12px corners. The Profile card shows the store (\"Logged in to store\") and the signed-in user. Then come labelled sections (13px grey headings in sentence case) of 48px rows with 16px text, a grey 20px icon and a chevron. Rows with sub-items open them on a second screen with a back arrow. A section can end with a centred action such as \"Add channel\".","docs_url":"https://commmerce.com/commmerceui/#components--mobile-menu","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Sections as data: `[{ label: 'Panels', items: [{ label: 'Reports', icon: 'chart', href }] }]`. Used instead of children when set."},{"attribute":"store","property":"store","type":"string","default":"''","description":"Store the merchant is signed in to. Empty hides the store row."},{"attribute":"user-name","property":"userName","type":"string","default":"''","description":"Signed-in user's name. Empty hides the user row."},{"attribute":"user-email","property":"userEmail","type":"string","default":"''","description":"Signed-in user's email, under the name."},{"attribute":"avatar-src","property":"avatarSrc","type":"string","default":"''","description":"Avatar image URL. Without it, the first letter of the name is shown."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Default: the built-in string `label` (\"Menu\")."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"_page","property":"_page","type":"[number, number] | null","default":"null","description":"Path of the open sub-page as [section, row], or null on the main page."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"sections","type":"NavItem[]","description":"The sections in use."}],"methods":[{"name":"back","description":"Returns to the main page from a sub-page."}],"slots":[{"name":"(default)","description":"`cm-nav-item` sections, each holding row items."}],"events":[{"name":"name"},{"name":"cm-navigate","description":"When a row is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app."},{"name":"cm-store-switch","description":"When the store card is pressed."},{"name":"cm-account","description":"When the user row is pressed."}],"parts":[],"examples":[{"title":"Commmerce admin","html":"<div style=\"max-width:414px\">\n<cm-mobile-menu store=\"Obiroye Garments Zix\" user-name=\"Robinson Jain\" user-email=\"robinson@example.com\">\n <cm-nav-item label=\"Channels\">\n <cm-nav-item label=\"Online Store\" icon=\"store\" href=\"#online-store\"></cm-nav-item>\n <cm-nav-item label=\"Point of sale\" icon=\"pos\" href=\"#pos\"></cm-nav-item>\n <cm-nav-item label=\"ONDC\" icon=\"globe\" href=\"#ondc\"></cm-nav-item>\n <cm-nav-item label=\"Add channel\" primary value=\"add-channel\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Panels\">\n <cm-nav-item label=\"Customers\" icon=\"users\" href=\"#customers\"></cm-nav-item>\n <cm-nav-item label=\"Reports\" icon=\"chart\" href=\"#reports\"></cm-nav-item>\n <cm-nav-item label=\"Marketing\" icon=\"megaphone\" href=\"#marketing\"></cm-nav-item>\n <cm-nav-item label=\"Application\" icon=\"apps\" href=\"#apps\" badge=\"3 apps active\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Support\">\n <cm-nav-item label=\"Hire an Expert\" icon=\"user\" href=\"#expert\" badge=\"New\"></cm-nav-item>\n <cm-nav-item label=\"Help Centre\" icon=\"help\" href=\"#help\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Subscription\">\n <cm-nav-item label=\"Subscription\" icon=\"repeat\" href=\"#subscription\"></cm-nav-item>\n <cm-nav-item label=\"Refer and Earn\" icon=\"gift\" href=\"#refer\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\">\n <cm-nav-item label=\"Shipping\" href=\"#shipping\"></cm-nav-item>\n <cm-nav-item label=\"Packaging Material\" href=\"#packaging\"></cm-nav-item>\n <cm-nav-item label=\"Tax\" href=\"#tax\"></cm-nav-item>\n <cm-nav-item label=\"Domain Setup\" href=\"#domain\"></cm-nav-item>\n <cm-nav-item label=\"Password Protection\" href=\"#password\"></cm-nav-item>\n <cm-nav-item label=\"Staff Management\" href=\"#staff\"></cm-nav-item>\n <cm-nav-item label=\"Configuration\" href=\"#configuration\"></cm-nav-item>\n </cm-nav-item>\n </cm-nav-item>\n</cm-mobile-menu>\n</div>"}],"do":["Open it from \"More\" in the Bottom navigation and keep the Bottom navigation visible under it.","Group rows the way merchants think: channels, panels, support, subscription, settings.","Put what the Header bar hides on phones (store, account, Hire an Expert, subscription) in here."],"dont":["Don't use it inside an app.","Don't nest deeper than one sub-screen.","Don't put more than one action per section."],"content":["Section headings are one word: \"Channels\", \"Support\".","Badges are two or three words: \"3 apps active\", \"New\"."],"accessibility":["A `nav` landmark named \"Menu\"; each section is a region named by its heading, and rows are links or buttons.","Opening a row with sub-items shows a second screen and moves focus to its back button (named after the section); Back or Escape returns focus to the row.","Icons are decorative; the avatar letter is hidden and the row is named by the user's name.","Icons are line icons in `icon-responsive-menu` grey; badges use `nav-badge` blue with white 12px text (AA)."],"related":["app-frame","bottom-navigation","side-navigation","header-bar"]},{"tag":"cm-flash-offer-bar","slug":"flash-offer-bar","name":"Flash offer bar","react":"FlashOfferBar","group":"Navigation","summary":"A dark strip across the top of the page with one short offer and a green link.","lead":"A 48px `bg-flash-bar` strip with a green send icon and one centred 14px line of white text. The link inside it is green and medium weight. On phones the text starts at the left.","docs_url":"https://commmerce.com/commmerceui/#components--flash-offer-bar","properties":[{"attribute":"icon","property":"icon","type":"string","default":"'send'","description":"Leading icon from"},{"attribute":"dismissible","property":"dismissible","type":"boolean","default":"false","description":"Shows a close button."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the bar's region. Default: the built-in string `label` (\"Offer\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The message. Put one `<a>` inside it for the action."},{"name":"icon","description":"Replaces the leading icon."}],"events":[{"name":"cm-dismiss","description":"When the close button is pressed (with `dismissible`). The bar hides itself unless the event is cancelled."}],"parts":[],"examples":[{"title":"Plan offer","html":"<cm-flash-offer-bar>\n Publish your store with a Commmerce plan - <a href=\"#plans\">Click here</a> to pick a plan\n</cm-flash-offer-bar>"},{"title":"Dismissible","description":"The bar hides itself on close; remember the choice so it doesn't come back on every page.","html":"<cm-flash-offer-bar dismissible icon=\"percent\">\n Festive sale: 20% off annual plans until 30 November. <a href=\"#plans\">See plans</a>\n</cm-flash-offer-bar>"}],"do":["Use it for one time-limited offer or a setup step that blocks selling (publishing the store).","Keep it to one line on desktop.","Let merchants dismiss offers that are not required."],"dont":["Don't use it for errors or warnings: use a Banner.","Don't stack two bars.","Don't put more than one link in it."],"content":["Lead with the benefit, then the action: \"Publish your store with a Commmerce plan - Click here to pick a plan\".","The link text says what happens: \"See plans\", not just \"Click here\", where you can."],"accessibility":["A region named \"Offer\" (set `label` to change it), so screen-reader users can find or skip it.","The link is a normal link inside the text; the green (`text-speciality-on-dark`) is 6.3:1 on the bar.","The close button is named \"Dismiss offer\".","The icon is the line `send` icon; the bar fills its container."],"responsive":["When the window is 640px wide or less, the text starts at the left instead of the centre, and the bar is at least 44px tall."],"related":["banner","header-bar"]},{"tag":"cm-link-tabs","slug":"link-tabs","name":"Link tabs","react":"LinkTabs","group":"Navigation","summary":"Links between sibling pages, such as the sections of Settings.","lead":"A row of 14px medium links over a thin rule, 24px apart. The page you are on is black with a underline (black, or Commmerce blue in the refined look); the others are grey. Each tab is its own page with its own address, so it can be bookmarked and opened in a new tab. To filter one list in place, use Status tabs.","docs_url":"https://commmerce.com/commmerceui/#components--link-tabs","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Tabs as data (`{ label, href, current }`). Used instead of `cm-nav-item` children when set."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation, e.g. \"Settings sections\". Default: the built-in string `label` (\"Sections\")."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"_more","property":"_more","type":"string","default":"''"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"tabs","type":"NavItem[]","description":"The tabs in use."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-nav-item` elements with `href`; mark the page you are on `current`."}],"events":[{"name":"cm-navigate","description":"When a tab is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app."}],"parts":[],"examples":[{"title":"Settings sections","html":"<cm-link-tabs label=\"Settings sections\">\n <cm-nav-item label=\"General\" href=\"#general\" current></cm-nav-item>\n <cm-nav-item label=\"Payments\" href=\"#payments\"></cm-nav-item>\n <cm-nav-item label=\"Shipping\" href=\"#shipping\"></cm-nav-item>\n <cm-nav-item label=\"Tax\" href=\"#tax\"></cm-nav-item>\n <cm-nav-item label=\"Domains\" href=\"#domains\"></cm-nav-item>\n <cm-nav-item label=\"Notifications\" href=\"#notifications\"></cm-nav-item>\n</cm-link-tabs>"},{"title":"Parts of a product, with counts","html":"<cm-link-tabs label=\"Product sections\">\n <cm-nav-item label=\"Details\" href=\"#details\"></cm-nav-item>\n <cm-nav-item label=\"Variants\" href=\"#variants\" badge=\"12\" current></cm-nav-item>\n <cm-nav-item label=\"Inventory\" href=\"#inventory\"></cm-nav-item>\n <cm-nav-item label=\"Reviews\" href=\"#reviews\" badge=\"233\"></cm-nav-item>\n</cm-link-tabs>"}],"do":["Put it under the Page header, above the page content.","Give each tab its own URL and mark the page you are on `current`.","Name it with `label` (\"Settings sections\")."],"dont":["Don't use it to filter a list: use Status tabs.","Don't use it for steps in a sequence.","Don't use more than about seven tabs."],"content":["One or two words per tab, in sentence case.","Counts (`badge`) are whole numbers."],"accessibility":["A `nav` landmark of links, not ARIA tabs: each tab loads a page, so links and `aria-current=\"page\"` are the right semantics. Tab moves between them.","The current page is marked with `aria-current`, not only colour and underline.","Link tabs share the Status tabs styling, with 14px labels."],"responsive":["Tabs stay on one line; when they don't fit the component's width, the row scrolls sideways.","When the window is 640px wide or less, tabs are 16px apart instead of 24px."],"related":["status-tabs","page-header","side-navigation"]},{"tag":"cm-app-card","slug":"app-card","name":"App card","react":"AppCard","group":"Marketplace","summary":"One app in the Commmerce app marketplace: logo, name, rating, pricing, offer and actions.","lead":"A white card with a `border-subtle` edge and 8px corners. A 128×56 logo tile leads, then the 16px semibold app name, \"By\" and the developer, a gold star with the rating and an underlined reviews link, the pricing line, an optional offer on a pale blue line, and the actions: Sign Up (primary), Contact (secondary) and an underlined View Details link. In narrow columns the padding and logo tile shrink.","docs_url":"https://commmerce.com/commmerceui/#components--app-card","properties":[{"attribute":"name","property":"name","type":"string","default":"''","description":"App name, the card's heading."},{"attribute":"developer","property":"developer","type":"string","default":"''","description":"Who made the app, shown as \"By …\"."},{"attribute":"rating","property":"rating","type":"number | undefined","description":"Average rating out of 5. Leave unset for apps without reviews."},{"attribute":"reviews","property":"reviews","type":"number | undefined","description":"Number of reviews."},{"attribute":"reviews-href","property":"reviewsHref","type":"string","default":"''","description":"Link for the reviews count."},{"attribute":"pricing","property":"pricing","type":"string","default":"''","description":"Pricing summary: \"Free plan available. 7-day free trial.\""},{"attribute":"offer","property":"offer","type":"string","default":"''","description":"Optional offer, shown on a pale blue line with a percent icon."},{"attribute":"href","property":"href","type":"string","default":"''","description":"App details page. Shows a \"View Details\" link."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"3","description":"Heading level of the app name (2–6), to fit the page outline."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"logo","description":"The app's logo, an `<img>` with `alt` set to the app name. Shown in a 130×54 tile."},{"name":"actions","description":"Buttons, e.g. `<cm-button variant=\"primary\">Sign Up</cm-button>` and `<cm-button>Contact</cm-button>`."},{"name":"status","description":"Top-right corner, e.g. a `cm-toggle` that turns an installed app on and off."}],"events":[],"parts":[],"examples":[{"title":"Marketplace grid","html":"<div style=\"display:grid;gap:var(--cm-space-24);grid-template-columns:repeat(auto-fill,minmax(300px,1fr))\">\n <cm-app-card name=\"Paywise Payments\" developer=\"Appsell\" rating=\"4.3\" reviews=\"902\" reviews-href=\"#reviews\"\n pricing=\"Free plan available. 7-day free trial.\" offer=\"Bundle products and kits with Bundle Manager: 20% off\" href=\"#paywise\">\n <cm-icon slot=\"logo\" name=\"wallet\" size=\"32\" label=\"Paywise Payments\"></cm-icon>\n <cm-button slot=\"actions\" variant=\"primary\">Sign Up</cm-button>\n <cm-button slot=\"actions\">Contact</cm-button>\n </cm-app-card>\n <cm-app-card name=\"ShipQuick\" developer=\"Lumen Labs\" rating=\"4.1\" reviews=\"318\" reviews-href=\"#reviews\"\n pricing=\"From ₹ 499 a month.\" href=\"#shipquick\">\n <cm-icon slot=\"logo\" name=\"send\" size=\"32\" label=\"ShipQuick\"></cm-icon>\n <cm-button slot=\"actions\" variant=\"primary\">Sign Up</cm-button>\n <cm-button slot=\"actions\">Contact</cm-button>\n </cm-app-card>\n</div>"},{"title":"Installed, with an on/off switch","description":"The `status` slot sits in the top-right corner.","html":"<div style=\"max-width:410px\">\n<cm-app-card name=\"Paywise Payments\" developer=\"Appsell\" rating=\"4.3\" reviews=\"902\" pricing=\"Free plan available. 7-day free trial.\" href=\"#paywise\">\n <cm-icon slot=\"logo\" name=\"wallet\" size=\"32\" label=\"Paywise Payments\"></cm-icon>\n <cm-toggle slot=\"status\" checked aria-label=\"Paywise Payments on\"></cm-toggle>\n <cm-button slot=\"actions\">Settings</cm-button>\n</cm-app-card>\n</div>"}],"do":["Show cards in a grid of equal columns (about 300–410px each); they stretch to the same height.","Use the app's real logo image with `alt` set to the app name.","Set `heading-level` to fit the page: 2 under the page title, 3 under a section heading."],"dont":["Don't tint the logo tile with the app's brand colour: the admin uses Commmerce's palette only.","Don't put more than two buttons in `actions`.","Don't round ratings to whole stars; show one decimal."],"content":["Pricing is one sentence: \"Free plan available. 7-day free trial.\"","Offers are short and specific: what, how much, until when.","Keep the standard button words: \"Sign Up\", \"Contact\", \"View Details\"."],"accessibility":["An `article` named by the app name, which is a heading (level 3 by default).","The rating is read as \"Rated 4.3 out of 5\"; the star is decorative. The reviews count is a link when `reviews-href` is set.","View Details is named \"View details of <app>\", so a page of cards doesn't have ten identical links.","The logo tile is neutral `bg-inset`, not a brand tint (owner decision: Commmerce palette only); the offer text is 12px; the star and discount icons are the `star` and `percent` line icons; cards fill their grid column."],"responsive":["Follows the card's own width, not the window: at 380px or narrower, the padding drops from 20px to 8px, the logo box shrinks from 128 × 56px to 100 × 40px, and the details link moves to the end of the actions row."],"related":["card","button","toggle"]},{"tag":"cm-modal","slug":"modal","name":"Modal","react":"Modal","group":"Overlays","summary":"A dialog over the page for a short task or a decision that has to be made before going on.","lead":"A white panel with 12px corners over a dimmed page: a black header with the 14px title and a close button, the content with 20px padding, and the actions in a footer, right-aligned. Three widths: `small` (400px) for confirmations, `medium` (620px) and `large` (900px) for lists. It is a native modal `<dialog>`: the page behind is inert, Esc and the backdrop ask to close, the page stops scrolling, and focus returns to the button that opened it. Open it with `show()` or the `open` attribute.","docs_url":"https://commmerce.com/commmerceui/#components--modal","properties":[{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"Width: `small` (400px, confirmations), `medium` (620px, default) or `large` (900px, lists and tables). Never wider than the screen."},{"attribute":"_hasFooter","property":"_hasFooter","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"The content."},{"name":"footer","description":"Actions, right-aligned: the main action last. Usually `cm-button`s."}],"events":[{"name":"cm-open","description":"After the modal opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable: call `preventDefault()` to keep it open (e.g. unsaved changes)."},{"name":"cm-closed","description":"After it has closed and focus has gone back."}],"parts":[],"examples":[{"title":"Confirm before deleting","description":"Press the button to open it. In your app, call `show()` or set `open`.","html":"<cm-button data-opens=\"del\">Delete product</cm-button>\n<cm-modal id=\"del\" heading=\"Delete “Linen shirt”?\" size=\"small\">\n <p style=\"margin:0\">The product and its 4 variants will be deleted. This can't be undone.</p>\n <cm-button slot=\"footer\">Cancel</cm-button>\n <cm-button slot=\"footer\" variant=\"primary\">Delete product</cm-button>\n</cm-modal>"},{"title":"A short form","description":"Put `autofocus` on the field the merchant will fill first.","html":"<cm-button data-opens=\"track\">Change tracking info</cm-button>\n<cm-modal id=\"track\" heading=\"Change tracking info\">\n <div style=\"display:grid;gap:var(--cm-space-16)\">\n <cm-text-field label=\"Tracking number\" autofocus></cm-text-field>\n <cm-select label=\"Carrier\"><option>Delhivery</option><option>Blue Dart</option><option>Other</option></cm-select>\n </div>\n <cm-button slot=\"footer\">Cancel</cm-button>\n <cm-button slot=\"footer\" variant=\"primary\">Save</cm-button>\n</cm-modal>"}],"do":["Use it for one short task the merchant must finish or cancel before going on.","Name the main action with a verb that says what happens: \"Delete product\", not \"OK\".","Cancel `cm-close` when closing would lose typed changes, and ask first.","Close it yourself (`close()`) after the main action succeeds."],"dont":["Don't open a modal from a modal.","Don't use it for long forms or pages of content: use a page or a Side panel.","Don't use it for messages that don't need an answer: use a Banner."],"content":["The title is a question or a task: \"Delete “Linen shirt”?\", \"Change tracking info\".","Say what will happen and whether it can be undone, in one or two sentences.","Put the main action last; Cancel first."],"accessibility":["A native modal `<dialog>` named by its heading; the rest of the page is inert, so Tab stays inside (it can still reach the browser's own controls, as with every native dialog).","Opening focuses the child with `autofocus`, otherwise the panel itself so its title is read. Closing returns focus to the element that opened it.","Esc, the close button (\"Close\", `close-label`) and a click on the backdrop fire a cancelable `cm-close` with `detail.reason`.","Page scrolling is locked while it is open.","Corners are 12px (`radius-lg`), with a large shadow (`shadow-lg`); widths are three fixed sizes."],"responsive":["Never wider than the window minus 32px (`small` 400px, `medium` 620px, `large` 900px otherwise)."],"related":["side-panel","banner","button"]},{"tag":"cm-side-panel","slug":"side-panel","name":"Side panel","react":"SidePanel","group":"Overlays","summary":"A panel over the right edge of the page with the details of one item, without leaving the list.","lead":"A full-height white panel on the right (450px; `small` 380px, `large` 720px) over a dimmed page: a black header with the 14px title and a close button, the content with 20px padding, and an optional footer. On phones it becomes a card inset 16px from the screen edges. Like Modal it is a native modal `<dialog>`: Esc and the backdrop ask to close, the page stops scrolling, and focus returns to the opener.","docs_url":"https://commmerce.com/commmerceui/#components--side-panel","properties":[{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"Width on larger screens: `small` (380px), `medium` (450px, default) or `large` (720px)."},{"attribute":"_hasFooter","property":"_hasFooter","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"The content."},{"name":"footer","description":"Actions at the bottom, right-aligned."}],"events":[{"name":"cm-open","description":"After the panel opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed and focus has gone back."}],"parts":[],"examples":[{"title":"Enquiry details","description":"Press the button to open it. In your app, call `show()` or set `open`.","html":"<cm-button data-opens=\"inq\">View enquiry</cm-button>\n<cm-side-panel id=\"inq\" heading=\"Inquiry\">\n <cm-info-panel>\n <cm-info-item label=\"Date added\">Mar 29, 2026 3:45 AM</cm-info-item>\n <cm-info-item label=\"Name\">Robinson Painatillo</cm-info-item>\n <cm-info-item label=\"Email\"><a href=\"mailto:robinson@example.com\">robinson@example.com</a></cm-info-item>\n <cm-info-item label=\"Message\">Do you ship to Pune? I'd like 20 shirts for a team event.</cm-info-item>\n </cm-info-panel>\n <cm-accordion heading=\"Email and phone were found in 2 orders\" style=\"margin-top:var(--cm-space-20)\">\n <p style=\"margin:0\"><a href=\"#order\">#NAY0D0736</a>, 20-12-2025</p>\n </cm-accordion>\n <cm-button slot=\"footer\" variant=\"primary\">Reply</cm-button>\n</cm-side-panel>"}],"do":["Use it to look at or lightly edit one item from a list, keeping the list in place behind.","Keep the title to what the item is: \"Inquiry\", \"Order #1042\"."],"dont":["Don't use it for a task that needs the whole page: open the item's page instead.","Don't stack a Modal on top of it."],"content":["Show the most useful facts first; group the rest in Accordions."],"accessibility":["A native modal `<dialog>` named by its heading; the page behind is inert.","Opening focuses an `autofocus` child, otherwise the panel. Esc, the close button and the backdrop fire a cancelable `cm-close`; focus returns to the opener.","Square corners on desktop, with three widths; on phones a card inset 16px with 12px corners."],"responsive":["Never wider than the window (`small` 380px, `medium` 450px, `large` 720px otherwise).","When the window is narrower than 600px, the panel becomes a card inset 16px from every edge of the screen."],"related":["modal","filter-panel","info-panel","accordion"]},{"tag":"cm-filter-panel","slug":"filter-panel","name":"Filter panel","react":"FilterPanel","group":"Overlays","summary":"\"Search and Filter\": a Side panel with a search field, the fields that narrow a list, and Reset and Search.","lead":"A Side panel titled \"Search and Filter\". With `search` it starts with a search field (\"Search anything\"); then your fields in a `<form>`, 12px apart; then Reset and Search, centred at the bottom. Search fires `cm-filter-apply` with the form's values and the query, then closes. Reset puts the form back to its first values. Open it from the filter button of a Search field (`cm-filter`).","docs_url":"https://commmerce.com/commmerceui/#components--filter-panel","properties":[{"attribute":"search","property":"search","type":"boolean","default":"false","description":"Shows a search field above the filters."},{"attribute":"query","property":"query","type":"string","default":"''","description":"Text in the search field."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Default: the built-in string `heading` (\"Search and Filter\")."},{"attribute":"search-label","property":"searchLabel","type":"string","description":"Accessible name of the search field. Default: the built-in string `searchLabel` (\"Search\")."},{"attribute":"search-placeholder","property":"searchPlaceholder","type":"string","description":"Placeholder of the search field. Default: the built-in string `searchPlaceholder` (\"Search anything\")."},{"attribute":"apply-label","property":"applyLabel","type":"string","description":"Text of the main button. Default: the built-in string `apply` (\"Search\")."},{"attribute":"reset-label","property":"resetLabel","type":"string","description":"Text of the reset button. Default: the built-in string `reset` (\"Reset\")."},{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"Width on larger screens: `small` (380px), `medium` (450px, default) or `large` (720px)."},{"attribute":"_hasFooter","property":"_hasFooter","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"form","type":"HTMLFormElement | null","description":"The `<form>` holding the fields: a direct child, or the first one inside the panel."},{"property":"values","type":"FilterValues","description":"The current filter values, keyed by field name. Empty values are left out."}],"methods":[{"name":"reset","description":"Puts every field back to its first value and clears the search."},{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"A `<form>` with the filter fields."},{"name":"footer","description":"Actions at the bottom, right-aligned."}],"events":[{"name":"cm-filter-apply","description":"When Search is pressed (or Enter in the search field). `detail: { values, query }`. Cancelable: call `preventDefault()` to keep the panel open (e.g. an invalid date range)."},{"name":"cm-filter-reset","description":"When Reset is pressed, after the fields went back to their first values."},{"name":"cm-open","description":"After the panel opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed."}],"parts":[],"examples":[{"title":"Filter products","description":"Press the filter button in the search field. In your app, listen for `cm-filter` and call `show()`.","html":"<cm-search label=\"Search products\" filter data-opens=\"filters\"></cm-search>\n<cm-filter-panel id=\"filters\" search>\n <form>\n <cm-text-field label=\"Product name\" name=\"name\"></cm-text-field>\n <cm-select label=\"Product status\" name=\"status\"><option value=\"\">Any</option><option value=\"active\">Active</option><option value=\"inactive\">Inactive</option></cm-select>\n <cm-select label=\"Product type\" name=\"type\"><option value=\"\">Any</option><option>Clothing</option><option>Accessories</option></cm-select>\n <div style=\"display:grid;grid-template-columns:1fr 1fr;gap:var(--cm-space-12)\">\n <cm-text-field label=\"From\" name=\"from\" type=\"date\"></cm-text-field>\n <cm-text-field label=\"To\" name=\"to\" type=\"date\"></cm-text-field>\n </div>\n <cm-text-field label=\"Tags\" name=\"tags\"></cm-text-field>\n </form>\n</cm-filter-panel>"}],"do":["Give every field a `name`: it becomes the key in `detail.values`.","Start every field empty or at \"Any\", so Reset means \"no filters\".","Show the number of active filters on the search field (`filter-count`)."],"dont":["Don't apply filters while the merchant is still choosing: apply on Search.","Don't put more than about eight fields here; offer the rarely used ones as a saved view instead."],"content":["Field labels name what is filtered: \"Product status\", not \"Choose status\".","Keep the button words \"Reset\" and \"Search\" unless the list is not searched."],"accessibility":["A Side panel: a native modal `<dialog>` named \"Search and Filter\", inert page behind, Esc closes, focus returns to the filter button.","Enter in the search field applies, like Search. Pressing Search with the form invalid can be stopped by cancelling `cm-filter-apply`.","Empty values are left out of `detail.values`; a name used by several checked boxes gives an array."],"responsive":["The same as Side panel: never wider than the window, and below 600px of window width it becomes a card inset 16px from every edge of the screen."],"related":["side-panel","search","select","resource-list"]},{"tag":"cm-account-menu","slug":"account-menu","name":"Account menu","react":"AccountMenu","group":"Navigation","summary":"The signed-in person's menu, last in a Commmerce product's header bar: who is signed in, the business they work in, then Settings, Lock screen and Log out.","lead":"Since 1.9.2. A round 36px avatar with a ring, always the last control in `cm-header-bar` (its `account` slot, after refresh and notifications). It opens a 320px panel aligned to its end edge: the person (40px avatar with a ring, name 16px, role and place 13px grey), a line, the business (40px round logo, name, kind) with its plan beside a green check, a line, then the `cm-menu-item` choices. With `profile-href` or `org-href` a row is a link with a chevron. Keyboard, outside click and Escape behave like the Action menu. For Commmerce products only, not for apps.","docs_url":"https://commmerce.com/commmerceui/#components--account-menu","properties":[{"attribute":"name","property":"name","type":"string","default":"''","description":"The signed-in person's name. Their initials show when there is no `avatar-src`."},{"attribute":"avatar-src","property":"avatarSrc","type":"string","default":"''","description":"Their photo."},{"attribute":"meta","property":"meta","type":"string","default":"''","description":"One line under the name: role and place (\"Owner · Bangalore\")."},{"attribute":"profile-href","property":"profileHref","type":"string","default":"''","description":"Their profile page; makes the row a link with a chevron."},{"attribute":"org-name","property":"orgName","type":"string","default":"''","description":"The business or store they're working in (\"Bangalore\"). Empty hides the business row."},{"attribute":"org-meta","property":"orgMeta","type":"string","default":"''","description":"One line under it (\"POS store\")."},{"attribute":"org-href","property":"orgHref","type":"string","default":"''","description":"The business's page or switcher; makes the row a link with a chevron."},{"attribute":"plan","property":"plan","type":"string","default":"''","description":"The plan, shown under the business with a check (\"POS Standard\")."},{"attribute":"items","property":"items","type":"MenuItem[]","default":"[]","description":"Choices as data, used instead of children when set: `[{ label: 'Add product', value: 'product' }, { divider: true }, …]`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the menu."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the menu. Also the trigger's name when it is icon-only. Default: the built-in string `label` (\"Actions\")."},{"attribute":"trigger-label","property":"triggerLabel","type":"string","default":"''","description":"Text of the built-in trigger. Empty uses `label`."},{"attribute":"icon-only","property":"iconOnly","type":"boolean","default":"false","description":"The built-in trigger is a \"more\" (⋮) icon button, e.g. for table rows."},{"attribute":"icon","property":"icon","type":"string","default":"'more'","description":"Icon of the icon-only trigger. Default `more` (⋮); `chevron-down` for a menu attached to another control."},{"attribute":"align","property":"align","type":"'start' | 'end'","default":"'start'","description":"Which trigger edge the menu lines up with: `start` (default) or `end` (for triggers at the right edge)."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Bold line above the choices, e.g. the merchant's name in the account menu."},{"attribute":"subheading","property":"subheading","type":"string","default":"''","description":"Smaller line under the heading, e.g. the email."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height: `comfortable` 36px rows (the default) or `compact` 32px rows for dense tables and toolbars. Since 1.6."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner row instead of the choices while you load them (the menu is `aria-busy`). Since 1.6."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"The built-in trigger can't be used (it is a disabled button); a slotted trigger is yours to disable. Since 1.6."},{"attribute":"_slotted","property":"_slotted","type":"MenuItem[]","default":"[]"},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_custom","property":"_custom","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"menuItems","type":"MenuItem[]","description":"The choices in use."}],"methods":[{"name":"show","description":"Opens the menu and highlights the first (or last) choice."},{"name":"hide","description":"Closes the menu. With `returnFocus`, focus goes back to the trigger."}],"slots":[{"name":"(default)","description":"`cm-menu-item` elements, with `<hr>` between groups (as in `cm-action-menu`)."},{"name":"org-logo","description":"The business's logo (an `<img>`, 40px round). Without it, a store icon on the brand tone is shown."},{"name":"trigger","description":"Your own trigger button (optional). The menu sets its ARIA state."}],"events":[{"name":"cm-select","description":"When a choice is picked (as on `cm-action-menu`)."},{"name":"cm-toggle","description":"When the menu opens or closes. `detail: { open }`."}],"parts":[{"tag":"cm-menu-item","react":"MenuItemElement","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the choice in `cm-select`. Defaults to the text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the choice a link."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Can't be chosen right now."},{"attribute":"critical","property":"critical","type":"boolean","default":"false","description":"A destructive choice, shown in the critical colour."},{"attribute":"heading","property":"heading","type":"boolean","default":"false","description":"Makes this a section heading (its text, 12px) instead of a choice. Since 1.6."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"Keyboard shortcut shown at the end of the row (\"Ctrl+E\"). Since 1.6."}],"script_properties":[],"methods":[{"name":"toItem","description":"The item as data."}],"slots":[],"events":[]}],"examples":[{"title":"In the header bar","description":"Refresh, notifications, then the person, left to right. Select the avatar to open the panel.","html":"<div style=\"min-height:420px\"><cm-header-bar>\n <cm-button slot=\"end\" icon-only icon=\"refresh\" label=\"Refresh\"></cm-button>\n <cm-button slot=\"end\" icon-only icon=\"bell\" label=\"Notifications\" count=\"4\"></cm-button>\n <cm-account-menu slot=\"account\" name=\"Asha Rao\" meta=\"Owner · Bangalore\" profile-href=\"#profile\"\n org-name=\"Bangalore\" org-meta=\"POS store\" org-href=\"#store\" plan=\"POS Standard\">\n <cm-menu-item icon=\"settings\" href=\"#settings\">Settings</cm-menu-item>\n <cm-menu-item value=\"lock\">Lock screen</cm-menu-item>\n <cm-menu-item icon=\"log-out\" value=\"log-out\">Log out</cm-menu-item>\n </cm-account-menu>\n</cm-header-bar></div>"}],"do":["Put it in the header bar's `account` slot so it is always last.","Show the business the person is working in, and its plan, so switching stores is one click away (`org-href`)."],"dont":["Don't use it in apps built by other developers: the account belongs to the Commmerce product.","Don't put more than about five choices in it; settings pages hold the rest."],"content":["Choices in sentence case: \"Lock screen\", \"Log out\".","The meta line is the role and the place: \"Owner · Bangalore\"."],"accessibility":["The avatar button is named \"Account: {name}\" and says it opens a menu; the panel is the Action menu's, with the arrow keys, Home, End, Escape and type-ahead.","The person and business rows are links when they have an href, reached with Tab."],"responsive":["The avatar is 36px (40px with a 44px hit area on touch screens). The panel is 320px wide, never wider than the window minus 32px."],"related":["header-bar","action-menu","avatar"]},{"tag":"cm-action-menu","slug":"action-menu","name":"Action menu","react":"ActionMenu","group":"Overlays","summary":"A button that opens a short list of actions: row actions, \"Add…\" menus, or the account menu.","lead":"A white list with 8px corners and a soft shadow (`shadow-md`), 4px under its trigger. Each choice is a 36px row (owner standard, 1.6; `density=\"compact\"` 32px, 44px on touch screens) with 12px side padding, 14px text, an optional 16px icon and an optional `shortcut` hint in 12px grey at the end; the highlighted one is black with white text, a destructive (`critical`) one red on light red. `<cm-menu-item heading>` starts a section with a 12px grey heading (since 1.6). The same rows as the options of Select and Combobox. `<hr>` between `cm-menu-item`s draws a line between groups, and `heading` / `subheading` put a name and email on top (the account menu). The built-in trigger is a button with the label and a chevron, or a ⋮ icon button with `icon-only`; or bring your own with `slot=\"trigger\"`.","docs_url":"https://commmerce.com/commmerceui/#components--action-menu","properties":[{"attribute":"items","property":"items","type":"MenuItem[]","default":"[]","description":"Choices as data, used instead of children when set: `[{ label: 'Add product', value: 'product' }, { divider: true }, …]`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the menu."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the menu. Also the trigger's name when it is icon-only. Default: the built-in string `label` (\"Actions\")."},{"attribute":"trigger-label","property":"triggerLabel","type":"string","default":"''","description":"Text of the built-in trigger. Empty uses `label`."},{"attribute":"icon-only","property":"iconOnly","type":"boolean","default":"false","description":"The built-in trigger is a \"more\" (⋮) icon button, e.g. for table rows."},{"attribute":"icon","property":"icon","type":"string","default":"'more'","description":"Icon of the icon-only trigger. Default `more` (⋮); `chevron-down` for a menu attached to another control."},{"attribute":"align","property":"align","type":"'start' | 'end'","default":"'start'","description":"Which trigger edge the menu lines up with: `start` (default) or `end` (for triggers at the right edge)."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Bold line above the choices, e.g. the merchant's name in the account menu."},{"attribute":"subheading","property":"subheading","type":"string","default":"''","description":"Smaller line under the heading, e.g. the email."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height: `comfortable` 36px rows (the default) or `compact` 32px rows for dense tables and toolbars. Since 1.6."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner row instead of the choices while you load them (the menu is `aria-busy`). Since 1.6."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"The built-in trigger can't be used (it is a disabled button); a slotted trigger is yours to disable. Since 1.6."},{"attribute":"_slotted","property":"_slotted","type":"MenuItem[]","default":"[]"},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_custom","property":"_custom","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"menuItems","type":"MenuItem[]","description":"The choices in use."}],"methods":[{"name":"show","description":"Opens the menu and highlights the first (or last) choice."},{"name":"hide","description":"Closes the menu. With `returnFocus`, focus goes back to the trigger."}],"slots":[{"name":"(default)","description":"`cm-menu-item`s, with `<hr>` between groups."},{"name":"trigger","description":"Your own trigger button (optional). The menu sets its ARIA state."}],"events":[{"name":"cm-toggle","description":"When the menu opens or closes. `detail: { open }`."},{"name":"cm-select","description":"When a choice is made. `detail: { value, item }`. Cancelable: for link items, `preventDefault()` stops the navigation."}],"parts":[{"tag":"cm-menu-item","react":"MenuItemElement","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the choice in `cm-select`. Defaults to the text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the choice a link."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Can't be chosen right now."},{"attribute":"critical","property":"critical","type":"boolean","default":"false","description":"A destructive choice, shown in the critical colour."},{"attribute":"heading","property":"heading","type":"boolean","default":"false","description":"Makes this a section heading (its text, 12px) instead of a choice. Since 1.6."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"Keyboard shortcut shown at the end of the row (\"Ctrl+E\"). Since 1.6."}],"script_properties":[],"methods":[{"name":"toItem","description":"The item as data."}],"slots":[],"events":[]}],"examples":[{"title":"Row actions","html":"<div style=\"display:flex;align-items:center;justify-content:space-between;gap:12px;width:min(100%,440px);padding:8px 8px 8px 16px;background:var(--cm-bg-surface);border:1px solid var(--cm-border-subtle);border-radius:8px\">\n <span><strong>#1042</strong> · Priya Sharma · Rs. 2,340</span>\n <cm-action-menu icon-only label=\"Order #1042 actions\">\n <cm-menu-item value=\"cancel\">Cancel shipment</cm-menu-item>\n <cm-menu-item value=\"tracking\">Change tracking info</cm-menu-item>\n </cm-action-menu>\n</div>"},{"title":"Add menu","html":"<cm-action-menu trigger-label=\"Add\">\n <cm-menu-item icon=\"box\" value=\"product\">Add product</cm-menu-item>\n <cm-menu-item icon=\"menu\" value=\"category\">Add category</cm-menu-item>\n <cm-menu-item icon=\"users\" value=\"customer\">Add customer</cm-menu-item>\n <cm-menu-item icon=\"cart\" value=\"order\">Add order</cm-menu-item>\n</cm-action-menu>"},{"title":"Sections and shortcuts","description":"Since 1.6. `<cm-menu-item heading>` names the choices after it (up to the next heading or `<hr>`); `shortcut` shows a key hint at the end of the row and sets `aria-keyshortcuts`. Wire the shortcut itself in your app. The destructive choice is `critical`.","html":"<div style=\"min-height:300px\"><cm-action-menu trigger-label=\"Order\">\n <cm-menu-item heading>Order</cm-menu-item>\n <cm-menu-item icon=\"edit\" value=\"edit\" shortcut=\"E\">Edit order</cm-menu-item>\n <cm-menu-item icon=\"copy\" value=\"duplicate\" shortcut=\"Ctrl+D\">Duplicate</cm-menu-item>\n <cm-menu-item icon=\"download\" value=\"invoice\" disabled>Download invoice</cm-menu-item>\n <hr>\n <cm-menu-item heading>Danger zone</cm-menu-item>\n <cm-menu-item icon=\"trash\" value=\"delete\" critical shortcut=\"Del\">Delete order</cm-menu-item>\n</cm-action-menu></div>"},{"title":"Compact","description":"Since 1.6. `density=\"compact\"` makes the rows 32px, for menus in dense tables and toolbars. Rows stay 44px on touch screens.","html":"<div style=\"min-height:160px\"><cm-action-menu icon-only density=\"compact\" label=\"Product actions\">\n <cm-menu-item value=\"duplicate\">Duplicate</cm-menu-item>\n <cm-menu-item value=\"archive\">Archive</cm-menu-item>\n <cm-menu-item value=\"delete\" critical>Delete</cm-menu-item>\n</cm-action-menu></div>"},{"title":"Account menu","description":"Groups split by `<hr>`; the destructive choice is `critical`. `align=\"end\"` lines the menu up with the right edge of a trigger at the right of the page.","html":"<div style=\"display:flex;justify-content:flex-end\">\n<cm-action-menu trigger-label=\"Robinson\" heading=\"Robinson Jain\" subheading=\"robinson@example.com\" align=\"end\">\n <cm-menu-item href=\"#profile\">My profile</cm-menu-item>\n <cm-menu-item href=\"#subscription\">Subscription</cm-menu-item>\n <cm-menu-item href=\"#support\">Support</cm-menu-item>\n <cm-menu-item href=\"#refer\">Refer and earn</cm-menu-item>\n <hr>\n <cm-menu-item value=\"switch\">Switch store</cm-menu-item>\n <cm-menu-item value=\"new-store\">Create new store</cm-menu-item>\n <hr>\n <cm-menu-item value=\"sign-out\">Sign out</cm-menu-item>\n</cm-action-menu>\n</div>"}],"do":["Use it for actions, not for choosing a value in a form: that is Select.","Keep it to about eight choices, grouped with `<hr>`.","Give icon-only menus a `label` that names the thing acted on: \"Order #1042 actions\"."],"dont":["Don't hide the one main action of a page in a menu: show it as a Button.","Don't put a menu inside a menu."],"content":["Start each choice with a verb: \"Cancel shipment\", \"Add product\".","Use sentence case."],"accessibility":["The WAI-ARIA menu button pattern: the trigger has `aria-haspopup=\"menu\"` and `aria-expanded`; the list is `role=\"menu\"` with `menuitem`s and `separator`s.","↓/↑ on the trigger open the menu on the first/last choice. In the menu: ↓/↑ (wrapping), Home/End and typing the first letters move; Enter/Space choose; Esc closes and returns focus to the trigger; Tab closes. Disabled choices and section headings are skipped.","A section heading (`heading`) names a `role=\"group\"` of the choices after it (`aria-labelledby`); it is not a menu item. A `shortcut` is shown visually (hidden from screen readers) and exposed as `aria-keyshortcuts` on the item.","A custom trigger gets the ARIA attributes set on it, so make it a native `<button>`.","The highlight follows the keyboard and the pointer; the list has 4px inner padding and 8px corners, and rows 6px corners."],"responsive":["The menu is at most 320px wide, and never wider than the window minus 32px."],"related":["button","bottom-sheet","select"]},{"tag":"cm-bottom-sheet","slug":"bottom-sheet","name":"Bottom sheet","react":"BottomSheet","group":"Overlays","summary":"A sheet that rises from the bottom of a phone screen with a few actions or shortcuts.","lead":"White, with 12px top corners and a round 36px black close button on its top edge, over a dimmed page; at most 600px wide on larger screens. Rows are 44px, split by thin lines. Rows without icons are centred (actions, \"Mark as paid order\"); rows with icons line up left and end in a chevron (shortcuts, \"Orders\"). It is the phone version of Action menu and uses the same `cm-menu-item`s. A native modal `<dialog>`, like Modal.","docs_url":"https://commmerce.com/commmerceui/#components--bottom-sheet","properties":[{"attribute":"items","property":"items","type":"MenuItem[]","default":"[]","description":"Rows as data, used instead of `cm-menu-item` children when set."},{"attribute":"_slotted","property":"_slotted","type":"MenuItem[]","default":"[]"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"sheetItems","type":"MenuItem[]","description":"The rows in use."}],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"`cm-menu-item`s, or your own content."}],"events":[{"name":"cm-select","description":"When a row is chosen. `detail: { value, item }`. Cancelable: `preventDefault()` keeps the sheet open (and stops a link)."},{"name":"cm-open","description":"After the sheet opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed."}],"parts":[{"tag":"cm-menu-item","react":"MenuItemElement","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the choice in `cm-select`. Defaults to the text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the choice a link."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Can't be chosen right now."},{"attribute":"critical","property":"critical","type":"boolean","default":"false","description":"A destructive choice, shown in the critical colour."},{"attribute":"heading","property":"heading","type":"boolean","default":"false","description":"Makes this a section heading (its text, 12px) instead of a choice. Since 1.6."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"Keyboard shortcut shown at the end of the row (\"Ctrl+E\"). Since 1.6."}],"script_properties":[],"methods":[{"name":"toItem","description":"The item as data."}],"slots":[],"events":[]}],"examples":[{"title":"Order actions","description":"Press the button to open it. In your app, call `show()` or set `open`.","html":"<cm-button data-opens=\"acts\">More actions</cm-button>\n<cm-bottom-sheet id=\"acts\" heading=\"Order actions\">\n <cm-menu-item value=\"paid\">Mark as paid order</cm-menu-item>\n <cm-menu-item value=\"invoice\">Generate invoice</cm-menu-item>\n <cm-menu-item value=\"cancel\" critical>Cancel order</cm-menu-item>\n</cm-bottom-sheet>"},{"title":"Shortcuts with icons","html":"<cm-button data-opens=\"quick\">Quick add</cm-button>\n<cm-bottom-sheet id=\"quick\" heading=\"Shortcuts\">\n <cm-menu-item icon=\"bag\" href=\"#orders\">Orders</cm-menu-item>\n <cm-menu-item icon=\"box\" href=\"#add-order\">Add orders</cm-menu-item>\n <cm-menu-item icon=\"cart\" href=\"#abandoned\">Abandoned cart</cm-menu-item>\n <cm-menu-item icon=\"help\" href=\"#enquiries\">Contact enquiries</cm-menu-item>\n</cm-bottom-sheet>"}],"do":["Use it on phones in place of an Action menu or a small Modal.","Keep it to five rows or fewer.","Set `heading` (it is not shown) so screen readers announce what the sheet is for."],"dont":["Don't mix rows with and without icons in one sheet.","Don't put a long form in a sheet: open a page."],"content":["Start actions with a verb: \"Generate invoice\". Shortcuts are the page name: \"Orders\"."],"accessibility":["A native modal `<dialog>` named by the hidden `heading` (or `label`); the page behind is inert.","The close button is named \"Close\" (`close-label`). Esc and the backdrop fire a cancelable `cm-close`; focus returns to the opener.","Choosing a row fires a cancelable `cm-select`, then closes with reason `action`.","The close button is 36px and rows are 44px tall, so both are easy touch targets."],"responsive":["Full width up to 600px, then 600px wide and centred at the bottom of the window."],"related":["action-menu","modal","bottom-navigation"]},{"tag":"cm-notification-panel","slug":"notification-panel","name":"Notification panel","react":"NotificationPanel","group":"Overlays","summary":"Recent notifications, opened from the bell in the header bar. For Commmerce products only, not for apps.","lead":"A 380px panel under the top-right corner of the page (on phones, the screen width less 8px each side) over a dimmed page. A black \"Notifications\" header with a close button, then one 40px row per notification, alternately white and light grey: a small coloured icon for its kind (`information`, `attention`, `success`, `critical`), what happened, and when. Unread ones are bold. \"See more notifications\" links to the full list. Move it with `--cm-notification-panel-top` and `--cm-notification-panel-end`. It belongs to the admin: apps can't add to it (App Bridge has toasts, not notifications).","docs_url":"https://commmerce.com/commmerceui/#components--notification-panel","properties":[{"attribute":"items","property":"items","type":"NotificationItem[]","default":"[]","description":"Notifications as data, used instead of children when set."},{"attribute":"more-href","property":"moreHref","type":"string","default":"''","description":"Link to all notifications. Empty hides it."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Default: the built-in string `heading` (\"Notifications\")."},{"attribute":"more-label","property":"moreLabel","type":"string","description":"Text of that link. Default: the built-in string `more` (\"See more notifications\")."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown when there are no notifications. Default: the built-in string `empty` (\"No notifications yet.\")."},{"attribute":"mark-all-read","property":"markAllRead","type":"boolean","default":"false","description":"Shows a \"Mark all read\" button in the header while at least one notification is unread. Pressing it fires `cm-mark-all-read`."},{"attribute":"mark-all-label","property":"markAllLabel","type":"string","description":"Text of that button. Default: the built-in string `markAllRead` (\"Mark all read\")."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows placeholder rows while you fetch the notifications, and announces \"Loading\" politely."},{"attribute":"_slotted","property":"_slotted","type":"NotificationItem[]","default":"[]"},{"attribute":"_footer","property":"_footer","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"notifications","type":"NotificationItem[]","description":"The notifications in use."}],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"`cm-notification-item`s."},{"name":"footer","description":"A control under the list, such as a toggle for push notifications on this device."}],"events":[{"name":"cm-select","description":"When a notification is chosen. `detail: { value, item }`. Cancelable: `preventDefault()` stops a link, to route in your app."},{"name":"cm-mark-all-read","description":"When \"Mark all read\" is pressed (`mark-all-read`). Clear `unread` on your notifications in response; the button hides when none are unread."},{"name":"cm-open","description":"After the panel opens."},{"name":"cm-close","description":"Before it closes. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed."}],"parts":[{"tag":"cm-notification-item","react":"NotificationItemElement","properties":[{"attribute":"time","property":"time","type":"string","default":"''","description":"When, as shown: \"1 min ago\"."},{"attribute":"tone","property":"tone","type":"Tone","default":"'information'","description":"`information` (default), `attention`, `success` or `critical`."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Where the notification leads."},{"attribute":"unread","property":"unread","type":"boolean","default":"false","description":"Not read yet."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies it in `cm-select`."},{"attribute":"description","property":"description","type":"string","default":"''","description":"A second line under the label, in smaller grey text: \"Follow-up due at 4 pm\"."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon name from `@commmerce/icons` for the kind (\"user\", \"clock\"), shown in the tone's colours instead of the tone's icon."}],"script_properties":[],"methods":[],"slots":[],"events":[]}],"examples":[{"title":"From the header bell","description":"Press the button to open it. In your app, open it from the header bar's bell.","html":"<cm-button data-opens=\"notes\">Notifications</cm-button>\n<cm-notification-panel id=\"notes\" more-href=\"#notifications\">\n <cm-notification-item time=\"1 min ago\" href=\"#order-1042\" unread>New order received</cm-notification-item>\n <cm-notification-item time=\"12 mins ago\" tone=\"attention\" href=\"#stock\" unread>Product low stock</cm-notification-item>\n <cm-notification-item time=\"1 hr ago\" tone=\"success\" href=\"#order-1041\">Payment received</cm-notification-item>\n <cm-notification-item time=\"3 hrs ago\" tone=\"attention\" href=\"#variants\">Product variant out of stock</cm-notification-item>\n <cm-notification-item time=\"1 day ago\" tone=\"critical\" href=\"#order-1037\">Order cancelled</cm-notification-item>\n</cm-notification-panel>"},{"title":"Mark all read, second lines, icons and a footer control","description":"`mark-all-read` shows \"Mark all read\" in the header while any notification is unread; it fires `cm-mark-all-read` and you clear `unread`. `description` adds a second line, `icon` picks an icon for the kind (in the tone's colours), and the `footer` slot holds a control such as a push-notifications toggle.","html":"<cm-button data-opens=\"notes-crm\">Notifications</cm-button>\n<cm-notification-panel id=\"notes-crm\" mark-all-read more-href=\"#notifications\">\n <cm-notification-item time=\"2 mins ago\" icon=\"clock\" tone=\"attention\" description=\"Follow-up due at 4 pm\" href=\"#task-81\" unread>Call Ravi Stores</cm-notification-item>\n <cm-notification-item time=\"20 mins ago\" icon=\"user\" description=\"From the website form\" href=\"#lead-311\" unread>New lead: Asha Textiles</cm-notification-item>\n <cm-notification-item time=\"1 hr ago\" icon=\"send\" tone=\"success\" description=\"Quote #Q-1043\" href=\"#email-17\">Email opened by Kiran Rao</cm-notification-item>\n <cm-notification-item time=\"3 hrs ago\" icon=\"help\" description=\"Ticket #5531\" href=\"#ticket-5531\">Customer replied</cm-notification-item>\n <cm-toggle slot=\"footer\" label=\"Push notifications on this device\"></cm-toggle>\n</cm-notification-panel>"}],"do":["Show the newest first, and at most about ten; link the rest with `more-href`.","Link every notification to the thing it is about.","Mark notifications read when the merchant opens them; offer `mark-all-read` and clear `unread` on `cm-mark-all-read`.","Set `loading` while the list is fetched instead of a fake \"Loading\" item.","Keep the second line short (`description`): who or when, \"Follow-up due at 4 pm\"."],"dont":["Don't use it for messages that need an answer now: show a Banner on the page.","Don't use it in apps: it is admin chrome."],"content":["Say what happened in a few words: \"New order received\", \"Product low stock\".","Times are relative and short: \"1 min ago\", \"3 hrs ago\", \"1 day ago\"."],"accessibility":["A native modal `<dialog>` named \"Notifications\"; the page behind is inert. Esc, the close button and the backdrop fire a cancelable `cm-close`; focus returns to the bell.","Unread notifications start with \"Unread:\" for screen readers, not only bold text. The kind icon is decorative; the words say what happened. A second line is read after the label, separated by a comma.","\"Mark all read\" is a real button in the header. When it disappears (nothing unread any more), focus moves to the panel instead of being lost.","While `loading`, the placeholder rows are hidden from screen readers and \"Loading\" is announced through a polite status region.","Choosing a notification fires a cancelable `cm-select` (cancel it to route in a single-page app), then closes.","Kind icons are line icons in the tone colours on 24px tiles; rows are at least 40px tall with 13px text and 12px times in tabular numbers."],"responsive":["At most 380px wide, and never wider than the window minus 32px.","When the window is narrower than 600px, the panel spans the screen with 8px on each side."],"related":["header-bar","banner","badge"]}]}
1
+ {"version":"1.21.1","components":[{"tag":"cm-button","slug":"button","name":"Button","react":"Button","group":"Actions","summary":"Triggers an action or moves the merchant to the next step.","lead":"Buttons make the main action on a screen obvious. Black is the primary action; everything else is secondary: white with a grey outline, like a field.","docs_url":"https://commmerce.com/commmerceui/#components--button","properties":[{"attribute":"variant","property":"variant","type":"'primary' | 'secondary' | 'tertiary'","default":"'secondary'","description":"`primary` = black fill (one per group); `secondary` = white fill with a grey outline, like a field (since 1.5; was a black outline);\n`tertiary` (since 1.19) = no fill and no outline until hovered, for icon buttons in a header bar or a column heading."},{"attribute":"size","property":"size","type":"'large' | 'medium' | 'slim'","default":"'medium'","description":"`large` 40px (save bars, page actions), `medium` 36px (default), `slim` 32px (toolbars, table rows). Text is 14px (13px on slim).\nOn touch screens (`pointer: coarse`) every size is drawn at least 40px tall (icon-only: 40 x 40) and its hit area reaches\n44px. Owner standard since 1.6 (1.5 drew 44px on touch screens; sizes before 1.5 were 46, 32 and 24px)."},{"attribute":"type","property":"type","type":"'button' | 'submit' | 'reset'","default":"'button'","description":"Form behaviour when inside a `<form>`: `submit` submits it, `reset` resets it."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks clicks and dims the button. Prefer explaining why nearby."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner and blocks clicks while an action runs."},{"attribute":"href","property":"href","type":"string | undefined","description":"Renders a link styled as a button."},{"attribute":"target","property":"target","type":"string | undefined","description":"Link target when `href` is set. `_blank` adds `rel=\"noopener noreferrer\"`."},{"attribute":"icon-only","property":"iconOnly","type":"boolean","default":"false","description":"Square button that shows only its icon (from `icon` or the `icon` slot). Give it a `label`."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Name of a"},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of an `icon-only` button (\"Notifications\", \"Refresh\"). Required with `icon-only`; ignored otherwise, so the visible text stays the name."},{"attribute":"count","property":"count","type":"number","default":"0","description":"Small counter on the button, e.g. unread notifications. Hidden at 0; over 99 shows \"99+\". Screen readers hear the exact number (\"Notifications, 3 unread\")."},{"attribute":"tone","property":"tone","type":"'critical' | 'success' | undefined","description":"Colours the button by meaning: `critical` (red: delete, \"Not interested\") or `success` (green: \"Sale closed\").\nSecondary: tone text, icon and outline on a white fill. Primary: filled in the tone. Leave unset for the\nstandard black and white. Colour is never the only signal: the label must say what happens. Since 1.2."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Label. Visually hidden when `icon-only` (it still names the button if `label` is empty)."},{"name":"icon","description":"Optional leading icon. Overrides the `icon` attribute."}],"events":[{"name":"click","description":"Native click; suppressed while disabled or loading."}],"parts":[],"examples":[{"title":"Primary and secondary","description":"The save bar pattern: secondary on the left, primary on the right. One primary button per group.","html":"<div class=\"row\">\n <cm-button size=\"large\">Cancel</cm-button>\n <cm-button variant=\"primary\" size=\"large\">Save</cm-button>\n</div>"},{"title":"Sizes","description":"`large` (40px) for save bars, empty states and page actions, `medium` (36px, the default) for card and form actions, `slim` (32px) for toolbars, filter rows, dense rows and table cells. Text is 14px (13px on slim) and icons 16px at every size. On touch screens every size is drawn at least 40px tall, with a hit area that reaches 44px (owner standard, 1.6; 1.5 drew 44px). Since 1.5 (the sizes were 46, 32 and 24px).","html":"<div class=\"row\">\n <cm-button variant=\"primary\" size=\"large\">Large</cm-button>\n <cm-button variant=\"primary\" size=\"medium\">Medium</cm-button>\n <cm-button variant=\"primary\" size=\"slim\">Slim</cm-button>\n</div>"},{"title":"With icon","description":"Put an icon in the `icon` slot when it makes the action faster to recognise. Keep the label.","html":"<div class=\"row\">\n <cm-button><cm-icon slot=\"icon\" name=\"plus\" size=\"16\"></cm-icon>Add product</cm-button>\n <cm-button><cm-icon slot=\"icon\" name=\"upload\" size=\"16\"></cm-icon>Import</cm-button>\n <cm-button><cm-icon slot=\"icon\" name=\"external\" size=\"16\"></cm-icon>View store</cm-button>\n</div>"},{"title":"Icon only","description":"For well-known actions where space is tight: the header bar (notifications, refresh, search) and table rows. `icon-only` makes a square of the size's height (40, 36 or 32px; 40 × 40 on touch screens, with a 44px hit area). `label` is required: it is the name screen readers announce. Set `icon` to an icon name, or put a `cm-icon` in the `icon` slot.","html":"<div class=\"row\">\n <cm-button icon-only icon=\"refresh\" label=\"Refresh\"></cm-button>\n <cm-button icon-only icon=\"search\" label=\"Search\"></cm-button>\n <cm-button icon-only icon=\"edit\" label=\"Edit product\" size=\"slim\"></cm-button>\n <cm-button icon-only icon=\"bell\" label=\"Notifications\" size=\"large\"></cm-button>\n</div>"},{"title":"Tertiary","description":"`variant=\"tertiary\"` (since 1.19) has no fill and no outline until hovered. Use it for icon buttons in the header bar (refresh, notifications) and in a board column heading, where a row of outlined boxes looks heavy, above all on phones. Not for the main action of a page or a form.","html":"<div class=\"row\">\n <cm-button variant=\"tertiary\" icon-only icon=\"refresh\" label=\"Refresh this page\"></cm-button>\n <cm-button variant=\"tertiary\" icon-only icon=\"bell\" label=\"Notifications\" count=\"3\"></cm-button>\n <cm-button variant=\"tertiary\" icon-only icon=\"plus\" label=\"Add lead\" size=\"slim\"></cm-button>\n</div>"},{"title":"Count","description":"`count` adds a small counter, e.g. unread notifications. It is hidden at 0 and shows \"99+\" above 99. Screen readers hear the exact number as part of the name: \"Notifications, 3 unread\". When the count is not \"unread\" (tasks due, items waiting), change the wording with `strings` (keys `labelWithCount` for icon-only, `count` for text buttons) or `setStrings()`.","html":"<div class=\"row\">\n <cm-button icon-only icon=\"bell\" label=\"Notifications\" count=\"3\" size=\"large\"></cm-button>\n <cm-button icon-only icon=\"mail\" label=\"Mail\" count=\"120\" size=\"large\"></cm-button>\n <cm-button icon=\"inbox\" count=\"7\">Inbox</cm-button>\n <cm-button icon=\"tasks\" count=\"2\" strings='{\"count\":\"{count} due today\"}'>Tasks</cm-button>\n</div>"},{"title":"Tones","description":"`tone=\"critical\"` or `tone=\"success\"` colours a button by the outcome it records, so a row of choices scans quickly. Secondary buttons take the tone in their text, icon and outline; primary buttons are filled in it. Leave `tone` off for everything else: most buttons are black and white. Hover, focus, disabled and loading work as on the other buttons. Since 1.2.","html":"<div class=\"stack\">\n <div class=\"row\">\n <cm-button size=\"slim\" icon=\"phone\">Spoke to them</cm-button>\n <cm-button size=\"slim\" icon=\"repeat\">No answer, reschedule</cm-button>\n <cm-button size=\"slim\" tone=\"critical\" icon=\"x-circle\">Not interested</cm-button>\n <cm-button size=\"slim\" tone=\"success\" icon=\"check-circle\">Sale closed</cm-button>\n </div>\n <div class=\"row\">\n <cm-button>Cancel</cm-button>\n <cm-button variant=\"primary\" tone=\"critical\" icon=\"trash\">Delete customer</cm-button>\n </div>\n <div class=\"row\">\n <cm-button variant=\"primary\" tone=\"success\" icon=\"check\">Mark as won</cm-button>\n </div>\n</div>"},{"title":"A row of outcome choices","description":"When closing a task asks \"what happened?\" and there are 3 to 5 answers that each finish the task at once, show them as a row of slim secondary buttons, the most common first, and tone only the answers that are clearly good (`success`) or clearly bad (`critical`); neutral ones such as \"Reschedule\" stay untoned. Use an option group instead when the choice is a setting the merchant picks and then confirms with a separate Save, and an action menu when there are more than 5 answers or they are rarely used. Colour is never the only signal: the label says the outcome (\"Not interested\", not \"No\"), an icon may support it, and the row still reads correctly in greyscale.","html":"<div class=\"row\" role=\"group\" aria-label=\"Call outcome\">\n <cm-button size=\"slim\">Spoke to them</cm-button>\n <cm-button size=\"slim\">No answer, reschedule</cm-button>\n <cm-button size=\"slim\" tone=\"critical\">Not interested</cm-button>\n <cm-button size=\"slim\" tone=\"success\">Sale closed</cm-button>\n</div>"},{"title":"Loading","description":"Shows a spinner and blocks repeat clicks while a request runs. Screen readers hear that the button is busy.","html":"<cm-button variant=\"primary\" loading>Saving</cm-button>"},{"title":"Disabled","description":"Use sparingly. If an action is unavailable, say why nearby, or let the merchant press it and explain what is missing.","html":"<div class=\"row\">\n <cm-button disabled>Duplicate</cm-button>\n <cm-button variant=\"primary\" disabled>Publish</cm-button>\n</div>"},{"title":"Link","description":"With `href` the button renders a real link, so it opens in a new tab, can be bookmarked and is announced as a link.","html":"<cm-button href=\"#/components\" >Browse components</cm-button>"},{"title":"Inside a form","description":"`type=\"submit\"` and `type=\"reset\"` work with a native form, exactly like `<button>`.","html":"<form class=\"stack\" onsubmit=\"event.preventDefault(); this.querySelector('output').textContent = 'Submitted: ' + new FormData(this).get('code')\">\n <cm-text-field name=\"code\" label=\"Discount code\" value=\"DIWALI25\"></cm-text-field>\n <div class=\"row\">\n <cm-button type=\"reset\">Reset</cm-button>\n <cm-button type=\"submit\" variant=\"primary\">Create discount</cm-button>\n </div>\n <output></output>\n</form>"}],"do":["Write labels as a verb plus a noun: \"Save\", \"Add product\", \"Send preview\".","Use one primary button per section or save bar.","Put the primary button on the right of a group, secondary on its left, `space-8` apart."],"dont":["Don't use two primary buttons side by side.","Don't use `tone` for decoration or emphasis, and don't let the colour carry meaning the label doesn't: \"Not interested\", not a red \"No\".","Don't use a button to navigate when a text link would do inside a sentence.","Don't write \"Click here\", \"OK\" or \"Submit\": say what happens."],"content":["Title case for button labels, short and specific.","Keep the same verb across the flow: if the button says \"Archive\", the confirmation says \"Archive\", not \"Remove\"."],"accessibility":["Renders a native `<button>` (or `<a>` with `href`) inside the shadow root, so it is focusable and announced correctly.","Focus ring: 2px `border-strong` outline with 2px offset.","While `loading`, the inner button has `aria-busy=\"true\"` and ignores clicks.","An icon-only button must have a name: set `label` (it becomes the button's `aria-label`). Buttons made before 1.1 with a labelled `cm-icon` in the `icon` slot still work. Without either, the button warns in the console.","On touch screens (`pointer: coarse`) every button is drawn at least 40px tall (icon-only 40 × 40) whatever its `size`, and an invisible margin makes the hit area 44px (WCAG 2.5.5). States: hover, pressed, focus ring, disabled and loading.","Tones meet WCAG AA in light and dark themes: label 4.5:1 or more on the button's fill (secondary: text-critical / text-success on bg-surface, and on the soft hover fills; primary: action-primary-text on text-critical / text-success), outline 3:1 or more on bg-surface and bg-page. The pairs are checked on every token build. Colour is not announced, so the label must carry the meaning.","The visible count is hidden from screen readers; the exact number is read instead, in the name of an icon-only button (\"Notifications, 3 unread\") or after the text of a text button (\"Inbox 7 unread\"). The count is not announced when it changes: if a new notification needs announcing, use a Toast."],"related":["banner","card","icon"]},{"tag":"cm-button-group","slug":"button-group","name":"Button group","react":"ButtonGroup","group":"Actions","summary":"A row of buttons that wraps, or keeps one line and moves the buttons that don't fit into a More menu.","lead":"Buttons 8px apart, in reading order. By default the row wraps onto more lines. With `overflow=\"menu\"` it stays on one line: the buttons that don't fit move into a trailing **More** menu, measured from the group's own width (so it works in cards and side panels as well as on phones), and come back when there is room. Choosing a menu item clicks the original button, so your click handlers keep working. Since 1.7.","docs_url":"https://commmerce.com/commmerceui/#components--button-group","properties":[{"attribute":"overflow","property":"overflow","type":"'wrap' | 'menu'","default":"'wrap'","description":"`wrap` (default): buttons wrap onto more lines. `menu`: one line; the buttons that don't fit move into a More menu at the end."},{"attribute":"more-label","property":"moreLabel","type":"string","description":"Text of the More trigger, and its accessible name with `more-icon`. Default: the built-in string `more` (\"More\")."},{"attribute":"more-icon","property":"moreIcon","type":"string | null | undefined","description":"Makes the More trigger a square icon button named by `more-label`. The value is the icon: empty (just the attribute)\nis `more` (⋮). Use it when even \"More\" is too wide, e.g. in table rows."},{"attribute":"size","property":"size","type":"'large' | 'medium' | 'slim' | undefined","description":"Size of the More trigger: `large` 40, `medium` 36, `slim` 32 (40 on touch screens). Default: the first button's `size`. Give every button the same size."},{"attribute":"align","property":"align","type":"'start' | 'end'","default":"'start'","description":"`start` (default) lines the buttons up at the start edge; `end` at the end edge (dialog and card footers)."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of the group, e.g. \"Call outcome\"."},{"attribute":"_items","property":"_items","type":"MenuItem[]","default":"[]"},{"attribute":"_size","property":"_size","type":"'large' | 'medium' | 'slim'","default":"'medium'"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"overflowing","type":"HTMLElement[]","description":"The buttons currently moved into the More menu, in reading order."}],"methods":[{"name":"relayout","description":"Measures again and moves buttons into or out of the More menu. Runs by itself on resize and on changes to the buttons."}],"slots":[{"name":"(default)","description":"`cm-button`s, in reading order. Put `data-priority=\"high\"` on a button to keep it visible longest and `data-priority=\"low\"` to move it into the menu first; a `variant=\"primary\"` button stays visible if it fits at all."}],"events":[{"name":"cm-overflow-change","description":"When the set of buttons in the More menu changes. `detail: { hidden: HTMLElement[] }`."}],"parts":[],"examples":[{"title":"Task outcomes on a desktop","description":"The CRM's \"what happened?\" buttons on a task. With room, every outcome is a button in one line. `data-priority=\"high\"` keeps \"Spoke to them\" visible longest; the primary button stays visible if it fits at all.","html":"<cm-button-group overflow=\"menu\" label=\"Call outcome\">\n <cm-button icon=\"phone\" data-priority=\"high\">Spoke to them</cm-button>\n <cm-button>No answer, reschedule</cm-button>\n <cm-button tone=\"critical\">Not interested</cm-button>\n <cm-button variant=\"primary\">Done</cm-button>\n <cm-button tone=\"success\">Renewed</cm-button>\n <cm-button>Will renew: call back</cm-button>\n</cm-button-group>"},{"title":"The same outcomes on a 390px phone","description":"The same markup in a 390px box: \"Spoke to them\" and \"Done\" stay, the other four move into More, in their reading order. \"Not interested\" is red in the menu (`tone=\"critical\"`), and a disabled or loading button is a disabled item. Choosing an item clicks the hidden button, and focus goes back to More.","html":"<div style=\"max-width:390px;min-height:240px\">\n<cm-button-group overflow=\"menu\" label=\"Call outcome\">\n <cm-button icon=\"phone\" data-priority=\"high\">Spoke to them</cm-button>\n <cm-button>No answer, reschedule</cm-button>\n <cm-button tone=\"critical\">Not interested</cm-button>\n <cm-button variant=\"primary\">Done</cm-button>\n <cm-button tone=\"success\">Renewed</cm-button>\n <cm-button>Will renew: call back</cm-button>\n</cm-button-group>\n</div>"},{"title":"Icon-only More","description":"`more-icon` makes the trigger a square ⋮ button, named by `more-label` (\"More\" by default). Use it where even the word \"More\" is too wide, such as table rows and narrow cards. Slim buttons get a slim (32px) trigger.","html":"<div style=\"max-width:300px;min-height:200px\">\n<cm-button-group overflow=\"menu\" more-icon more-label=\"More actions\">\n <cm-button size=\"slim\" icon=\"edit\">Edit</cm-button>\n <cm-button size=\"slim\" icon=\"copy\">Duplicate</cm-button>\n <cm-button size=\"slim\" icon=\"download\">Download</cm-button>\n <cm-button size=\"slim\" tone=\"critical\" icon=\"trash\">Delete</cm-button>\n</cm-button-group>\n</div>"},{"title":"Wrap (default)","description":"Without `overflow`, the buttons wrap onto more lines, 8px apart. `align=\"end\"` lines them up at the end edge, for card and dialog footers.","html":"<div style=\"max-width:390px\">\n<cm-button-group align=\"end\">\n <cm-button>Cancel</cm-button>\n <cm-button>Save as draft</cm-button>\n <cm-button variant=\"primary\">Send quote</cm-button>\n</cm-button-group>\n</div>"},{"title":"Click handlers keep working","description":"Listen on the buttons as usual. When a button is in the More menu, choosing its item fires the button's own `click` (and follows its `href`, or submits its form with `type=\"submit\"`).","html":"<div class=\"stack\" style=\"max-width:300px;min-height:200px\">\n<cm-button-group overflow=\"menu\" label=\"Call outcome\">\n <cm-button onclick=\"this.closest('.stack').querySelector('output').textContent = 'Recorded: ' + this.textContent\">Spoke to them</cm-button>\n <cm-button onclick=\"this.closest('.stack').querySelector('output').textContent = 'Recorded: ' + this.textContent\">No answer</cm-button>\n <cm-button onclick=\"this.closest('.stack').querySelector('output').textContent = 'Recorded: ' + this.textContent\">Not interested</cm-button>\n</cm-button-group>\n<output>Choose an outcome</output>\n</div>"}],"do":["Use `overflow=\"menu\"` for rows of outcomes or actions that must stay on one line, such as a task's outcomes on a phone.","Put the most used choice first and give it `data-priority=\"high\"`; mark rarely used ones `data-priority=\"low\"`.","Give the group a `label` that names the choice (\"Call outcome\") when the buttons are answers to a question.","Give every button the same `size`."],"dont":["Don't put the single main action of a page in a group with `overflow=\"menu\"` if it could end up in the menu: give it room, or use `variant=\"primary\"` so it stays visible.","Don't put menus, fields or links that aren't `cm-button`s in a group with `overflow=\"menu\"`: they never move into More.","Don't hide buttons with CSS: use `hidden`, which the group respects."],"content":["Write each label so it still makes sense as a menu item: \"Not interested\", not \"No\".","Keep labels short: shorter labels mean more of them stay visible."],"accessibility":["The row is a `role=\"group\"`, named by `label`.","Buttons that move into More get `hidden`: they leave the layout, the tab order and the accessibility tree, and come back when there is room. Tab goes through the visible buttons, then More.","More is a WAI-ARIA menu button (Action menu): `aria-haspopup=\"menu\"`, `aria-expanded`, ↓/↑, Home/End and first letters move, Enter/Space choose, Esc closes and returns focus to More. With `more-icon` it is named by `more-label`.","Each menu item mirrors its button: the same text (an icon-only button's `label`), icon and disabled state; `tone=\"critical\"` makes it a destructive item. Choosing it clicks the original button; focus returns to More, or to the last visible button if More went away.","The More trigger is the size of the buttons; on touch screens it is drawn 40px with a 44px hit area, like the buttons."],"responsive":["With `overflow=\"menu\"`, the group measures its own width whenever it, a button or the More trigger changes size: the buttons that don't fit move into More, the least important first, and come back when there is room. At 390px the CRM outcomes below show two buttons and More; at 320px, one button and More.","The More trigger is the size of the buttons (36px, slim 32, large 40; 40px drawn with a 44px hit area on touch screens) and sits at the end of the row: on the right, on the left in right-to-left pages. Its menu lines up with its end edge and is at most 320px wide (the window less 32px on phones).","With the default `overflow=\"wrap\"`, buttons wrap onto more lines 8px apart. Use it when every choice must stay visible."],"related":["button","action-menu","action-bar"]},{"tag":"cm-text-field","slug":"text-field","name":"Text field","react":"TextField","group":"Forms","summary":"Lets merchants enter or edit text, numbers, dates and times.","lead":"The base of every form. A 13px medium label above, a 40px box (44px on touch screens; owner standard, 1.6), and room underneath for 12px help text or an error. The outline darkens on hover and gets a 2px ring on focus.","docs_url":"https://commmerce.com/commmerceui/#components--text-field","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the field has an aria-label."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Lowercase bracketed note after the label, e.g. \"points earned per rupee spent\"."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Current value. Updated on every keystroke."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Example input, shown in text-tertiary. Never a substitute for the label."},{"attribute":"type","property":"type","type":"'text' | 'email' | 'number' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'time' | 'datetime-local'","default":"'text'","description":"Native input type. Ignored when `multiline`. `time` and `datetime-local` (since 1.2) give the browser's time and\ndate-and-time pickers; their value is local time without a time zone, `hh:mm` and `yyyy-mm-ddThh:mm`."},{"attribute":"multiline","property":"multiline","type":"boolean","default":"false","description":"Renders a resizable textarea."},{"attribute":"rows","property":"rows","type":"number","default":"4","description":"Visible rows when `multiline`."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Shows a red asterisk and blocks form submission while empty."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"readonly","property":"readonly","type":"boolean","default":"false","description":"Shows the value on the filled background; the value is still submitted."},{"attribute":"autocomplete","property":"autocomplete","type":"string | undefined","description":"Native autocomplete hint, e.g. `email`, `postal-code`."},{"attribute":"inputmode","property":"inputMode","type":"string","default":"''","description":"Which on-screen keyboard phones open: `email`, `url`, `tel`, `numeric`, `decimal`, `search` or `text`, passed to the\ninner input. Use it with `type=\"text\"` when your own check replaces the browser's (for example an email rule that\nmatches your server), so the box still opens the right keyboard. Since 1.15."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch screens both are 44px."},{"attribute":"min","property":"min","type":"string | undefined","description":"Lowest allowed value for `number`, `date`, `time` and `datetime-local`, in the value's format (`2026-11-16T15:30`\nfor `datetime-local`). The browser's picker doesn't offer earlier dates; an earlier value makes the field invalid."},{"attribute":"max","property":"max","type":"string | undefined","description":"Highest allowed value for `number`, `date`, `time` and `datetime-local`, in the value's format."},{"attribute":"step","property":"step","type":"string | undefined","description":"Allowed steps from `min`, as on a native input: a number for `number`, days for `date`, seconds for `time` and\n`datetime-local` (`900` = 15 minutes; under 60 shows seconds). `any` allows every value."},{"attribute":"pattern","property":"pattern","type":"string | undefined","description":"A regular expression the whole value must match, as on a native input (`[0-9]{6}` for a 6-digit PIN). An empty\nvalue is left to `required`. Say what's expected in `pattern-message`. Since 1.14."},{"attribute":"pattern-message","property":"patternMessage","type":"string","default":"''","description":"The message when the value doesn't match `pattern`, e.g. \"Enter the 6-digit PIN.\". Since 1.14."},{"attribute":"minlength","property":"minLength","type":"number | undefined","description":"Fewest characters allowed (an empty value is left to `required`). Since 1.14."},{"attribute":"maxlength","property":"maxLength","type":"number | undefined","description":"Most characters allowed: typing stops there, and a longer value set by code is invalid. Since 1.14."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"change","description":"When the value is committed."},{"name":"input","description":"On every keystroke (bubbles, composed)."}],"parts":[],"examples":[{"title":"Default","html":"<cm-text-field label=\"Store name\" placeholder=\"Anika's Boutique\"></cm-text-field>"},{"title":"With hint","description":"A bracketed, lowercase note after the label explains a unit or rule without adding a line.","html":"<cm-text-field label=\"Ordered\" hint=\"points earned per rupee (rs. 1) spent\" type=\"number\" value=\"1\"></cm-text-field>"},{"title":"Help text","html":"<cm-text-field label=\"Phone\" type=\"tel\" autocomplete=\"tel\" help-text=\"Phone otp is only for Indian numbers\"></cm-text-field>"},{"title":"Error","description":"Say what is wrong and how to fix it. The border turns critical and the message is announced.","html":"<cm-text-field label=\"SKU\" value=\"TS-0042\" error=\"This SKU is already used by another product\"></cm-text-field>"},{"title":"Multiline","html":"<cm-text-field label=\"Description\" multiline rows=\"4\" help-text=\"Plain text, up to 500 characters\"></cm-text-field>"},{"title":"Date and time (browser picker)","description":"`type=\"datetime-local\"` and `type=\"time\"` (since 1.2) use the browser's own picker. The value is local time with no time zone: `2026-11-20T16:00` and `16:00`. `min`, `max` and `step` (seconds: `900` is 15 minutes) work as on a native input, and a value outside them is invalid with a message in the page language. The box shows the date and time in the browser's language, not the page's, so an `en-IN` page may show a 24-hour clock in an English (UK) browser. For a picker that follows the page language and matches the date picker, use Date picker with `time`. For \"no past times\", set `min` from JavaScript: `field.min = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString().slice(0, 16)`.","html":"<div class=\"stack\">\n <cm-text-field label=\"Follow up on\" type=\"datetime-local\" name=\"follow_up\" min=\"2026-11-16T09:00\" step=\"900\"></cm-text-field>\n <cm-text-field label=\"Call at\" type=\"time\" name=\"call_at\" min=\"09:00\" max=\"18:00\" help-text=\"Between 9 am and 6 pm\"></cm-text-field>\n</div>"},{"title":"Required","description":"Marked with a red asterisk. The form will not submit while it is empty: a failed save shows \"Please fill in this field.\" under it and moves focus to it (since 1.14). Tabbing past it shows nothing.","html":"<cm-text-field label=\"Product title\" required></cm-text-field>"},{"title":"Pattern","description":"`pattern` (since 1.14) is a regular expression the whole value must match, as on a native input. Say what is expected in `pattern-message`; without it the field says \"Enter a value in the requested format.\". Type something else and leave the field to see it. An empty value is left to `required`.","html":"<cm-text-field label=\"PIN code\" pattern=\"[0-9]{6}\" pattern-message=\"Enter the 6-digit PIN code.\" help-text=\"6 digits, like 560001\"></cm-text-field>"},{"title":"Length","description":"`minlength` and `maxlength` (since 1.14). Too short shows \"Enter at least 8 characters.\" when the merchant leaves the field. Typing stops at `maxlength`; a longer value set by code is invalid and says \"Enter 20 characters or fewer.\". Works with `multiline` too.","html":"<div class=\"stack\">\n <cm-text-field label=\"Password\" type=\"password\" minlength=\"8\" autocomplete=\"new-password\"></cm-text-field>\n <cm-text-field label=\"SKU\" maxlength=\"20\"></cm-text-field>\n</div>"},{"title":"Format checks","description":"`type=\"email\"`, `\"url\"` and `\"number\"` check what is typed (since 1.13.1): \"Enter an email address like name@example.com.\", \"Enter a web address like https://example.com.\", \"Enter a number.\". The message shows when the merchant leaves the field (since 1.14).","html":"<cm-text-field label=\"Email\" type=\"email\" autocomplete=\"email\"></cm-text-field>"},{"title":"Read-only","description":"For values the merchant can see and copy but not change here.","html":"<cm-text-field label=\"Order ID\" value=\"#1042\" readonly></cm-text-field>"},{"title":"Small","description":"`size=\"small\"` makes the box 32px (default: 40px since 1.6, owner standard; was 36px), the height of slim buttons, for toolbars, filter rows and filter panels. Labels are 13px at both sizes. On touch screens both sizes are 44px. The value text is 14px, and 16px on touch screens so phones don't zoom in.","html":"<div class=\"row\">\n <cm-text-field size=\"small\" label=\"Min price\" type=\"number\" placeholder=\"0\"></cm-text-field>\n <cm-text-field size=\"small\" label=\"Max price\" type=\"number\" placeholder=\"5000\"></cm-text-field>\n</div>"}],"do":["Always show a visible label.","Use `hint` for units and rules, `help-text` for one sentence of guidance.","Space fields `space-16` apart in a form, `space-24` between groups of fields.","Set `type` and `autocomplete` so phones show the right keyboard and browsers can fill it in.","`type=\"email\"` uses the browser's email rule: it accepts `a@b` and refuses some international addresses such as `x@пример.рф`. If your server's rule differs, use `type=\"text\"` with `inputmode=\"email\"` (the email keyboard on phones) and show your own check with `error` (since 1.15)."],"dont":["Don't use the placeholder as the label: it disappears as soon as the merchant types.","Don't show an error before the merchant has finished with the field. The field's own messages wait until they leave it or save (since 1.14).","Don't disable a field to show a value: use `readonly`.","Don't rely on these checks alone: anyone can get round checks in the browser, so check every value again on your server."],"content":["Labels are nouns: \"Name\", \"Subject\", \"Redeemed\".","Errors say what to do: \"Enter a price above 0\", not \"Invalid input\".","Help text is one sentence; no full stop needed."],"accessibility":["The label is a real `<label>` tied to the input.","Errors and help text are linked with `aria-describedby`; errors use `role=\"alert\"` and set `aria-invalid`.","Form-associated: the value is submitted with the form, `required` blocks submission, and `form.reset()` restores the initial value.","Validation (since 1.14): the field's own message shows under it when the merchant leaves a changed field with a format, range or length problem, and on every invalid field when a save fails, with focus moved to the first. It uses the same `role=\"alert\"`, `aria-invalid` and `aria-describedby` as `error`; the app's `error` always wins. See Validation.","With `min`, `max` or `step`, a value outside them blocks submission (`validity.rangeUnderflow`, `rangeOverflow`, `stepMismatch`) with a message in the page language that names the limit; a half-typed time or date-and-time is `badInput` (\"Enter a complete time.\").","`date`, `time` and `datetime-local` are native inputs: each part (day, month, hour, minute, am/pm) is edited with the number keys and Up/Down, and the browser names the parts for screen readers. How the box and picker look is up to the browser: Chromium's picker shows a calendar and time columns, while Safari and Firefox edit the time in the box. Not tested with screen readers yet.","Input borders are `border-input` (3.4:1), meeting the 3:1 contrast required for form controls."],"related":["checkbox","button"]},{"tag":"cm-checkbox","slug":"checkbox","name":"Checkbox","react":"Checkbox","group":"Forms","summary":"Turns a setting on or off, or picks several items from a list.","lead":"A 16px box (18px on touch screens; owner standard, 1.6) with a 14px label and optional 12px help text, for settings and multi-select lists. Without a label it is 24px tall with the box centred, so it lines up in rows. Hover tints the box; focus draws a 2px ring.","docs_url":"https://commmerce.com/commmerceui/#components--checkbox","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label. Capitalised automatically in the original design; write it in sentence case."},{"attribute":"description","property":"description","type":"string","default":"''","description":"Help text under the label, linked for screen readers."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"'on'","description":"Submitted value when checked."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Whether the box is ticked. Reflects to the attribute."},{"attribute":"indeterminate","property":"indeterminate","type":"boolean","default":"false","description":"Mixed state, for a \"select all\" box when only some rows are selected."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Form will not submit until ticked."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Rich label content, used instead of `label`."}],"events":[{"name":"change","description":"When toggled by the user."}],"parts":[],"examples":[{"title":"Default","html":"<cm-checkbox label=\"Track quantity\" checked></cm-checkbox>"},{"title":"With description","html":"<cm-checkbox label=\"Charge tax on this product\" description=\"Uses the GST rate in your tax settings\"></cm-checkbox>"},{"title":"Group","description":"Rows are `space-12` apart. Wrap related options in a fieldset with a legend.","html":"<fieldset class=\"stack\" style=\"border:0;margin:0;padding:0;gap:var(--cm-space-12)\">\n <legend style=\"font-size:14px;font-weight:500;margin-bottom:var(--cm-space-8)\">Notify customers by</legend>\n <cm-checkbox name=\"notify\" value=\"email\" label=\"Email\" checked></cm-checkbox>\n <cm-checkbox name=\"notify\" value=\"sms\" label=\"SMS\" description=\"Phone otp is only for Indian numbers\"></cm-checkbox>\n <cm-checkbox name=\"notify\" value=\"whatsapp\" label=\"WhatsApp\"></cm-checkbox>\n</fieldset>"},{"title":"Indeterminate","description":"For a \"select all\" box when only some rows are selected.","html":"<cm-checkbox label=\"Select all products\" indeterminate></cm-checkbox>"},{"title":"Disabled","html":"<cm-checkbox label=\"Allow cash on delivery\" description=\"Set up a payment provider first\" disabled></cm-checkbox>"}],"do":["Write labels so that ticked means \"yes\": \"Track quantity\", not \"Don't track quantity\".","Use a checkbox for settings that save with the form; use a toggle for settings that apply straight away."],"dont":["Don't use checkboxes for choices that exclude each other: use radio buttons.","Don't write long labels: move detail into `description`."],"content":["Sentence case labels, no full stop.","Descriptions explain the consequence, in one line."],"accessibility":["A native checkbox inside a `<label>`; the whole row is clickable.","The description is linked with `aria-describedby`.","Space toggles it; focus shows a 2px ring around the box.","Form-associated: submits `value` when checked."],"related":["text-field","card"]},{"tag":"cm-radio-group","slug":"radio","name":"Radio button","react":"RadioGroup","group":"Forms","summary":"Picks exactly one option from a short list.","lead":"A group of 16px round buttons with 14px labels and optional help text. The group holds the value, the keyboard behaviour and the form submission.","docs_url":"https://commmerce.com/commmerceui/#components--radio","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Question above the options. Required for accessibility unless the group has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the label in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; announced and linked to the group."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the selected option; empty when nothing is selected."},{"attribute":"orientation","property":"orientation","type":"'vertical' | 'horizontal'","default":"'vertical'","description":"`vertical` stacks options `space-20` apart; `horizontal` puts them in a row `space-30` apart."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks every option. Also set by a disabled `<fieldset>`."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"focus","description":"Focuses the selected option, or the first one."}],"slots":[{"name":"(default)","description":"The `<cm-radio>` options."},{"name":"label","description":"Rich label content, used instead of `label`."}],"events":[{"name":"input","description":"Same moment as `change`, for frameworks that listen to `input`."},{"name":"change","description":"When the merchant picks a different option."}],"parts":[{"tag":"cm-radio","react":"Radio","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label. Write it in sentence case."},{"attribute":"description","property":"description","type":"string","default":"''","description":"Help text under the label, linked for screen readers."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The group's value when this option is selected."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Selected. Set by the group; set it in markup to choose the initial option."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"This option can't be chosen. Arrow keys skip it."},{"attribute":"group-disabled","property":"groupDisabled","type":"boolean"},{"attribute":"_tabbable","property":"_tabbable"}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Rich label content, used instead of `label`."}],"events":[]}],"examples":[{"title":"Default","html":"<cm-radio-group name=\"inventory\" label=\"Inventory\" help-text=\"Inventory tracking condition\">\n <cm-radio value=\"track\" label=\"Track quantity\" checked></cm-radio>\n <cm-radio value=\"untracked\" label=\"Don't track quantity\"></cm-radio>\n</cm-radio-group>"},{"title":"Horizontal","description":"For two or three short options, such as a status. Options sit `space-24` apart.","html":"<cm-radio-group name=\"status\" label=\"Status of the product\" orientation=\"horizontal\">\n <cm-radio value=\"active\" label=\"Active\"></cm-radio>\n <cm-radio value=\"inactive\" label=\"Inactive\" checked></cm-radio>\n</cm-radio-group>"},{"title":"With descriptions","html":"<cm-radio-group name=\"checkout\" label=\"Customer accounts\">\n <cm-radio value=\"optional\" label=\"Accounts are optional\" description=\"Customers can check out as a guest\" checked></cm-radio>\n <cm-radio value=\"required\" label=\"Accounts are required\" description=\"User has to create an account to checkout\"></cm-radio>\n</cm-radio-group>"},{"title":"Required with error","description":"The form will not submit until an option is chosen.","html":"<cm-radio-group name=\"ship\" label=\"Shipping method\" required error=\"Choose a shipping method\">\n <cm-radio value=\"standard\" label=\"Standard\"></cm-radio>\n <cm-radio value=\"express\" label=\"Express\"></cm-radio>\n</cm-radio-group>"},{"title":"Disabled option","html":"<cm-radio-group name=\"pay\" label=\"Payment\">\n <cm-radio value=\"prepaid\" label=\"Prepaid\" checked></cm-radio>\n <cm-radio value=\"cod\" label=\"Cash on delivery\" description=\"Set up a payment provider first\" disabled></cm-radio>\n</cm-radio-group>"}],"do":["Use radios when the options exclude each other and the merchant should see them all at once.","Pre-select the safest or most common option when there is one.","Keep to about five options; use a select for longer lists."],"dont":["Don't use a single radio on its own: use a checkbox.","Don't use radios for settings that apply straight away: use a toggle.","Don't put `<cm-radio>` outside a `<cm-radio-group>`: the group owns the value."],"content":["The group label asks the question: \"Status of the product\".","Option labels are short and parallel: \"Active\", \"Inactive\".","Descriptions explain the consequence in one line."],"accessibility":["The group is a `radiogroup` named by its label; each option is a `radio` with `aria-checked`.","One tab stop: Tab reaches the selected option (or the first one), arrow keys move and select, skipping disabled options and wrapping at the ends, and Space selects.","Form-associated: submits the selected `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice.","Errors use `role=\"alert\"` and are linked with `aria-describedby`."],"related":["checkbox","option-group","select"]},{"tag":"cm-toggle","slug":"toggle","name":"Toggle","react":"Toggle","group":"Forms","summary":"Turns a setting on or off straight away.","lead":"A 36×20 switch for settings that take effect immediately, such as showing a product on the store. Lists often show it without a visible label.","docs_url":"https://commmerce.com/commmerceui/#components--toggle","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label after the switch. Without one, give the element an `aria-label`."},{"attribute":"description","property":"description","type":"string","default":"''","description":"Help text under the label, linked for screen readers."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"'on'","description":"Submitted value when on."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Whether the switch is on. Reflects to the attribute."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Rich label content, used instead of `label`."}],"events":[{"name":"change","description":"When switched by the user."}],"parts":[],"examples":[{"title":"In a list row","description":"With no visible label, name it with `aria-label`.","html":"<div class=\"row\">\n <cm-toggle aria-label=\"Show Cotton kurta on store\" checked></cm-toggle>\n <cm-toggle aria-label=\"Show Linen shirt on store\"></cm-toggle>\n</div>"},{"title":"With label","html":"<cm-toggle label=\"Show on store\" checked></cm-toggle>"},{"title":"With description","html":"<cm-toggle label=\"Accept orders\" description=\"Turn off to pause checkout for maintenance\"></cm-toggle>"},{"title":"Disabled","html":"<cm-toggle label=\"Cash on delivery\" description=\"Set up a payment provider first\" disabled></cm-toggle>"}],"do":["Use a toggle when the change applies at once, with no Save button.","Write the label as the thing that is on: \"Show on store\".","Confirm the change, for example with a toast, when it affects customers."],"dont":["Don't use a toggle inside a form that needs saving: use a checkbox.","Don't change the label when the state changes; the switch shows the state.","Don't leave it unnamed: set `label` or `aria-label`."],"content":["Labels are short noun or verb phrases in sentence case.","Don't add \"On\" or \"Off\" text next to the switch."],"accessibility":["A native checkbox with `role=\"switch\"`, so screen readers say \"switch, on/off\". Space toggles it.","The track colours (`toggle-on`, `toggle-off`) are only 1.9:1 and 1.5:1 against white, so the track and thumb get a 1px `border-input` outline (3.4:1) to meet the 3:1 needed for controls. The thumb position also shows the state.","Form-associated: submits `value` when on, and `form.reset()` restores the initial state.","Respects reduced motion."],"related":["checkbox","radio"]},{"tag":"cm-select","slug":"select","name":"Select","react":"Select","group":"Forms","summary":"Picks one option from a list that opens below the field.","lead":"A 40px field (32px with `size=\"small\"`; 40px since 1.6, owner standard) with a chevron that opens a list of options. The chosen option is shown in black in the list and as the field's value.","docs_url":"https://commmerce.com/commmerceui/#components--select","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the chosen option; empty when nothing is chosen."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Shown while nothing is chosen, e.g. \"Select customer\"."},{"attribute":"options","property":"options","type":"Array<string | SelectOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, group }`. Used instead of `<option>` children when set."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the list is showing."},{"attribute":"show-group","property":"showGroup","type":"boolean","default":"false","description":"Shows the chosen option's group before its label in the box (\"Lead: Company\"), for grouped lists where labels\nrepeat across groups. The list itself always shows the bare label under its group heading. Since 1.3."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. `medium` (1.8.1): 36px, the height of a standard\nbutton, for a select in a row of buttons such as page header actions. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens all are 44px. Since 1.5."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner in place of the chevron while you load the options (the box is `aria-busy`); the list doesn't\nopen until it is cleared. For options fetched as the merchant types, use `cm-combobox`. Since 1.6."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_slotted","property":"_slotted","type":"SelectOption[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"SelectOption[]","description":"The options in use, normalised, in the order shown (options of a group together)."}],"methods":[],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements, optionally inside `<optgroup label=\"…\">`. `disabled` (also on an optgroup) and `selected` are honoured."}],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the merchant picks a different option."}],"parts":[],"examples":[{"title":"Default","description":"Write options as `<option>` children, as you would for a native select.","html":"<cm-select name=\"customer\" label=\"Customer\" placeholder=\"Select customer\">\n <option value=\"robinson-rao\">Robinson Mid Rao - robiroa09102@gmail.com</option>\n <option value=\"robinson\">Robinson - robinson9900@gmail.com</option>\n <option value=\"manjunath\">Manjunath - manju8393@gmail.com</option>\n</cm-select>"},{"title":"Next to a button","description":"The field fills the row and a large primary button of the same height (40px) sits on the right.","html":"<div class=\"row\" style=\"align-items:flex-end;flex-wrap:nowrap;gap:8px\">\n <cm-select name=\"customer\" label=\"Customer\" placeholder=\"Select customer\" style=\"flex:1\">\n <option value=\"robinson\">Robinson - robinson9900@gmail.com</option>\n <option value=\"manjunath\">Manjunath - manju8393@gmail.com</option>\n </cm-select>\n <cm-button variant=\"primary\">Add new customer</cm-button>\n</div>"},{"title":"Small, in a filter row","description":"Since 1.5. `size=\"small\"` makes the box 32px, the height of slim buttons and small search, so a toolbar or filter row lines up. Name fields without a visible label with `aria-label`.","html":"<div style=\"display:flex;flex-wrap:wrap;gap:8px;align-items:center\">\n <cm-search size=\"small\" label=\"Search orders\" placeholder=\"Search orders\" style=\"flex:1 1 200px;min-width:0\"></cm-search>\n <cm-select size=\"small\" aria-label=\"Status\" placeholder=\"Status\">\n <option value=\"open\">Open</option>\n <option value=\"done\">Done</option>\n </cm-select>\n <cm-select size=\"small\" aria-label=\"Owner\" placeholder=\"Owner\">\n <option value=\"me\">Me</option>\n <option value=\"anyone\">Anyone</option>\n </cm-select>\n <cm-button size=\"slim\">Clear filters</cm-button>\n</div>"},{"title":"Preselected","html":"<cm-select name=\"status\" label=\"Status\">\n <option value=\"active\">Active</option>\n <option value=\"inactive\" selected>Inactive</option>\n <option value=\"draft\">Draft</option>\n</cm-select>"},{"title":"Help text and disabled option","html":"<cm-select name=\"courier\" label=\"Courier\" placeholder=\"Choose a courier\" help-text=\"Used for new orders only\">\n <option value=\"delhivery\">Delhivery</option>\n <option value=\"bluedart\">Blue Dart</option>\n <option value=\"ekart\" disabled>Ekart (not available in your area)</option>\n</cm-select>"},{"title":"Error","html":"<cm-select name=\"state\" label=\"State\" placeholder=\"Select state\" required error=\"Choose the state for GST\">\n <option value=\"ka\">Karnataka</option>\n <option value=\"mh\">Maharashtra</option>\n <option value=\"tn\">Tamil Nadu</option>\n</cm-select>"},{"title":"Disabled","html":"<cm-select label=\"Currency\" disabled><option value=\"inr\" selected>Indian rupee (INR)</option></cm-select>"},{"title":"Option groups","description":"Since 1.3. Put options under headings with `<optgroup label=\"…\">`, or give each option in `options` a `group` (`{ value, label, group }`): options of a group are shown together, in the order the groups first appear. Headings can't be chosen and the arrow keys skip them. When labels repeat across groups, `show-group` shows the chosen option as \"Lead: Email\" in the box.","html":"<div style=\"min-height:340px\"><cm-select name=\"field\" label=\"Take the value from a CRM field\" placeholder=\"Choose a field\" show-group>\n <option value=\"owner\">Record owner</option>\n <optgroup label=\"Lead\">\n <option value=\"lead.company\">Company</option>\n <option value=\"lead.email\">Email</option>\n </optgroup>\n <optgroup label=\"Contact\">\n <option value=\"contact.name\">Full name</option>\n <option value=\"contact.email\">Email</option>\n </optgroup>\n <optgroup label=\"Deal\">\n <option value=\"deal.amount\">Amount</option>\n </optgroup>\n</cm-select></div>"}],"do":["Use a select for five or more options, or when space is tight; use radios for fewer.","Write a placeholder that says what to pick: \"Select customer\".","Order options in a way the merchant expects: alphabetical, by frequency, or by size.","When no option is marked `selected`, `value` is `''`. For a required single choice, either pre-select the sensible default or keep the confirming button (Apply, Save) disabled until `value` is set, so pressing it never silently does nothing."],"dont":["Don't use a select for actions: use an action menu.","Don't use it for yes/no: use a checkbox or toggle.","Don't put very long lists in it (hundreds of items): use a Combobox, which filters as the merchant types."],"content":["The label is a noun: \"Customer\", \"Status\".","Options are short and start with the word that tells them apart, so typeahead works."],"accessibility":["**Why a custom list, not a native `<select>`:** the open list is a styled panel with a black fill on the chosen option, and native select popups can't be styled that way (and look different on every OS). So it follows the WAI-ARIA \"select-only combobox\" pattern, with native-select keyboard support.","Option groups are `group`s inside the listbox, each named by its heading (`aria-labelledby`), so screen readers say which group an option is in; the headings are not options.","Keyboard: Down, Up, Enter or Space opens; arrows move (skipping disabled options and group headings); Home and End jump; Page Up/Down move by ten; typing letters jumps to a match (repeat a letter to cycle); Enter or Space chooses; Escape closes without choosing; Tab chooses the highlighted option and moves on.","The field is a `combobox` labelled by the visible label, with `aria-expanded` and `aria-activedescendant`; options are `option`s with `aria-selected`.","Form-associated: submits `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice. `<option selected>` sets the initial value.","Contrast: the border is `border-input` (3:1 or more, as form controls need) and the placeholder is `text-tertiary` (4.5:1 or more)."],"responsive":["Options in the open list are 36px rows of 14px text with 12px side padding (32px with `size=\"small\"`; since 1.6, the same rows as Action menu and Combobox); on touch screens the box and the rows are 44px tall and the value is 16px."],"related":["radio","option-group","text-field"]},{"tag":"cm-search","slug":"search","name":"Search","react":"Search","group":"Forms","summary":"Filters a list or table by what the merchant types.","lead":"A box with a search icon, placed at the top of lists, in the same white box and grey outline as the other fields. It can carry a filter button that opens a filter panel. Sizes: `small` 32px for toolbars, filter rows and table headers, `default` 40px (since 1.6, owner standard; was 36px), `large` 40px; all 44px on touch screens.","docs_url":"https://commmerce.com/commmerceui/#components--search","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name, read by screen readers but not shown. Say what is searched: \"Search orders\". Default: the built-in string `label` (\"Search\")."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Current query. Updated on every keystroke."},{"attribute":"placeholder","property":"placeholder","type":"string","description":"Example query, shown in text-tertiary. Default: the built-in string `placeholder` (\"Search\")."},{"attribute":"filter","property":"filter","type":"boolean","default":"false","description":"Shows the filter button at the end of the box."},{"attribute":"filter-label","property":"filterLabel","type":"string","description":"Accessible name of the filter button. Default: the built-in string `filter` (\"Filter\")."},{"attribute":"filter-count","property":"filterCount","type":"number","default":"0","description":"Number of filters applied; shown on the filter button when above 0."},{"attribute":"size","property":"size","type":"'default' | 'small' | 'large'","default":"'default'","description":"`default` 40px (since 1.6, owner standard; was 36px); `small` 32px (toolbars, filter rows and table headers, since 1.5);\n`large` 40px (page-level search; the same as the default since 1.6, kept for compatibility). On touch screens every size is 44px."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"input","description":"On every keystroke, and when cleared."},{"name":"change","description":"When the value is committed (Enter or blur after typing, or clear)."},{"name":"cm-search","description":"When the merchant presses Enter. `detail.value` is the query."},{"name":"cm-filter","description":"When the filter button is pressed. Open a filter panel in response."}],"parts":[],"examples":[{"title":"Default","html":"<cm-search label=\"Search products\" placeholder=\"Search something\"></cm-search>"},{"title":"With filter","description":"Listen for `cm-filter` and open your filter panel. `filter-count` shows how many filters are applied.","html":"<cm-search label=\"Search orders\" placeholder=\"Search by order ID or customer\" filter filter-count=\"2\"></cm-search>"},{"title":"Small","description":"Since 1.5. 32px, for toolbars and filter rows next to small selects and slim buttons.","html":"<div style=\"display:flex;flex-wrap:wrap;gap:8px;align-items:center\">\n <cm-search size=\"small\" label=\"Search tasks\" placeholder=\"Search tasks\" style=\"flex:1 1 200px;min-width:0\"></cm-search>\n <cm-select size=\"small\" aria-label=\"Owner\" placeholder=\"Owner\"><option value=\"me\">Me</option><option value=\"anyone\">Anyone</option></cm-select>\n <cm-button size=\"slim\">Clear</cm-button>\n</div>"},{"title":"Large","description":"40px, for a search that leads the page.","html":"<cm-search size=\"large\" label=\"Search customers\" placeholder=\"Search something\" filter></cm-search>"},{"title":"In a table header","description":"A small (32px) box with a slim (32px) button next to it, so their edges line up.","html":"<div class=\"row\" style=\"flex-wrap:nowrap;gap:8px\">\n <cm-search label=\"Search orders\" placeholder=\"Search something\" style=\"flex:1\"></cm-search>\n <cm-button>Bulk orders</cm-button>\n</div>"}],"do":["Say what is searched in `label`, and give an example in `placeholder`.","Filter as the merchant types for short lists; wait for Enter (`cm-search`) when results come from the server.","Show an empty state when nothing matches, with a way to clear the search."],"dont":["Don't use the placeholder as the only label: set `label` (it is read out, not shown).","Don't put more than one search box above a list."],"content":["Placeholders give an example or the fields searched: \"Search by order ID or customer\".","No full stop."],"accessibility":["A native `type=\"search\"` input named by `label`. Enter fires `cm-search`; Escape clears.","The clear button (shown once there is a query) and the filter button are real buttons with names; the filter count is part of the filter button's name.","The edge is `border-input` (3:1 or more, as form controls need) and the placeholder is `text-tertiary` (4.5:1 or more). The clear and filter buttons are 24px (32px on touch screens).","Form-associated: submits the query under `name`."],"related":["text-field","select","tag"]},{"tag":"cm-global-search","slug":"global-search","name":"Global search","react":"GlobalSearch","group":"Navigation","summary":"One box that searches everything and lists matches grouped by kind, each a link to its page.","lead":"A search box like Search with a panel of results under it, grouped by kind (\"Leads\", \"Deals\", \"Tickets\"): each group has a heading with its total, up to a few results with a title and a grey second line, and an optional \"See all\" link. Your app does the searching: listen for `cm-search` (it carries the query), fetch, and set `results`, with `loading` while the request runs. Choosing a result follows its link; `cm-combobox` is the one to use when the merchant picks a value for a form.","docs_url":"https://commmerce.com/commmerceui/#components--global-search","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name of the box, read by screen readers but not shown. Default: the built-in string `label` (\"Search\")."},{"attribute":"placeholder","property":"placeholder","type":"string","description":"Example query in the empty box: \"Search leads, deals, contacts\". Default: the built-in string `placeholder` (\"Search\")."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The query. Updated as the merchant types."},{"attribute":"results","property":"results","type":"GlobalSearchGroup[]","default":"[]","description":"Results for the current query, grouped by kind. Set it when your search returns. Groups with no items are skipped."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows \"Loading\" with a spinner in place of the results while you fetch them."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the results panel is showing. It shows only while there is a query."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown when a query has no results. Default: the built-in string `noResults` (\"No results\")."},{"attribute":"loading-text","property":"loadingText","type":"string","description":"Shown and announced while `loading`. Default: the built-in string `loading` (\"Loading\", shared with other components)."},{"attribute":"see-all-label","property":"seeAllLabel","type":"string","description":"Text of each group's \"See all\" row. Default: the built-in string `seeAll` (\"See all\")."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"A key that moves focus to the box from anywhere on the page, e.g. `/`. Off by default: turn it on only for\none search per page. It is ignored while the merchant is typing in a field or holding Ctrl, Alt or Cmd."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"cm-search","description":"As the merchant types (and when the box is cleared), with `detail: { query }`. Fetch results and set `results`."},{"name":"cm-select","description":"When a result or a \"See all\" row is chosen, with `detail: { href, item, group }` (`item` is undefined for \"See all\"). Cancelable: `preventDefault()` stops the link, to route in your app."}],"parts":[],"examples":[{"title":"Grouped results","description":"Opens with results for \"ravi\"; type in the box to search again (this demo shows the same results for any query). Arrow keys move through every result across groups, Enter opens one, Escape closes.","html":"<div style=\"min-height:420px;max-width:560px\">\n <cm-global-search label=\"Search the CRM\" placeholder=\"Search leads, deals, tickets\" value=\"ravi\" open\n results='[{\"label\": \"Leads\", \"total\": 12, \"href\": \"#leads\", \"items\": [{\"title\": \"Ravi Stores\", \"description\": \"Lead · Mumbai · +91 98200 12345\", \"href\": \"#lead-ravi-stores\", \"icon\": \"user\"}, {\"title\": \"Ravi Traders\", \"description\": \"Lead · Pune\", \"href\": \"#lead-ravi-traders\", \"icon\": \"user\"}]}, {\"label\": \"Deals\", \"total\": 3, \"href\": \"#deals\", \"items\": [{\"title\": \"Ravi Stores annual plan\", \"description\": \"Deal · ₹ 48,000 · Negotiation\", \"href\": \"#deal-1042\", \"icon\": \"wallet\"}]}, {\"label\": \"Tickets\", \"items\": [{\"title\": \"Ravi Stores cannot print invoices\", \"description\": \"Ticket #5531 · Open\", \"href\": \"#ticket-5531\", \"icon\": \"help\"}]}]'></cm-global-search>\n</div>"},{"title":"With a shortcut key","description":"`shortcut=\"/\"` lets the merchant press / anywhere on the page to jump to the box (not while typing in a field). It is off by default: turn it on for one search per page, usually the one in the header.","html":"<div style=\"max-width:560px\"><cm-global-search label=\"Search the CRM\" placeholder=\"Search everything\" shortcut=\"/\"></cm-global-search></div>"},{"title":"In the header bar","description":"Put it in the Header bar's `search` slot. Wider than 900px the box sits inline after the store switcher; this preview is narrower, so the bar shows a search button that opens the search full screen.","html":"<cm-header-bar store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder-mark.svg\" alt=\"Store logo\" width=\"24\" height=\"24\">\n <cm-global-search slot=\"search\" label=\"Search the CRM\" placeholder=\"Search leads, deals, tickets\"></cm-global-search>\n</cm-header-bar>"}],"do":["Debounce `cm-search` requests (about 250 ms), cancel stale ones, and set `loading` while they run.","Show the best three to five results per kind and link the rest with the group's `href` (\"See all\").","Pass each group's full `total`, not only the number shown.","Make every result a real link (`href`); cancel `cm-select` with `preventDefault()` only to route inside a single-page app."],"dont":["Don't use it to pick a value in a form: use a Combobox.","Don't use it to filter the list on the current page: use Search.","Don't turn on `shortcut` for more than one search on a page."],"content":["The placeholder names what can be found: \"Search leads, deals, tickets\".","Group headings are the plural kind: \"Leads\", \"Deals\". The second line says what the result is and how to tell it apart: \"Lead · Mumbai\"."],"accessibility":["Follows the WAI-ARIA combobox pattern with a grouped listbox: the text box has `role=\"combobox\"`, `aria-expanded` and `aria-controls`; results are `option`s inside `group`s named by their heading and total (\"Leads, 12 results\"). Focus stays in the box and the highlighted result is shown with `aria-activedescendant`.","Keyboard: typing searches and opens the results; Down and Up move through every result across groups (wrapping); Enter opens the highlighted result; Escape closes the results, and a second Escape clears the box; Tab moves on and closes them.","The number of results, \"Loading\" and \"No results\" are announced through a polite live region.","The `shortcut` key is opt-in and exposed as `aria-keyshortcuts`; it never fires while the merchant types in a field or holds Ctrl, Alt or Cmd.","Why not `cm-search` with a popover: the combobox and its listbox have to share one shadow root for `aria-activedescendant` and `aria-controls` to work, so the box is built in."],"responsive":["Results open under the box at its full width and scroll once they are taller than 480px (or the window less 140px).","In the Header bar's `search` slot, at 900px or narrower the bar shows a search button instead, and the search opens full screen with the results filling the screen under it."],"related":["search","combobox","header-bar"]},{"tag":"cm-command-palette","slug":"command-palette","name":"Command palette","react":"CommandPalette","group":"Navigation","summary":"A search box in a dialog (Cmd/Ctrl+K) to jump to any record or run an action from the keyboard.","lead":"For people who work from the keyboard: press a shortcut, type a few letters, press Enter. The dialog lists records your app finds (\"Records\": leads, contacts), the actions it can run (\"New lead\") and places it can go (\"Go to Tasks\"), in groups, each row with an icon, a title, a grey second line and an optional key hint. Records come from your server, as in Global search: listen for `cm-search`, fetch, set `results`. Actions are registered once in `actions`, with `keywords`, and the palette filters them itself as the merchant types. While the box is empty it shows `recent` items, then every action. Choosing a row fires a cancelable `cm-select` and follows its link, or calls its `run` function.","docs_url":"https://commmerce.com/commmerceui/#components--command-palette","properties":[{"attribute":"label","property":"label","type":"string","default":"undefined","description":"Accessible name of the dialog and its text box, read by screen readers but not shown. Default: the built-in string `label` (\"Command palette\")."},{"attribute":"placeholder","property":"placeholder","type":"string","description":"Text in the empty box: \"Search leads, contacts or run a command\". Default: the built-in string `placeholder` (\"Search or run a command\")."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The query. Updated as the merchant types; emptied when the palette closes."},{"attribute":"results","property":"results","type":"CommandPaletteGroup[]","default":"[]","description":"Records found for the current query, grouped by kind, as in `cm-global-search`. Shown only while there is a query. Groups with no items are skipped."},{"attribute":"actions","property":"actions","type":"CommandPaletteGroup[]","default":"[]","description":"Actions and places, grouped (\"Actions\", \"Navigate\"). Always available: filtered by the palette as the merchant types."},{"attribute":"recent","property":"recent","type":"CommandPaletteItem[]","default":"[]","description":"Items the merchant chose recently, shown under \"Recent\" while the box is empty. Your app keeps the list (e.g. add the chosen item in `cm-select`)."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows \"Loading\" with a spinner in place of `results` while you fetch them. Matching actions still show."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"A shortcut that opens (and closes) the palette from anywhere on the page: `mod+k` is Cmd+K on a Mac and\nCtrl+K elsewhere. Off by default: turn it on for one palette per page. A shortcut without Ctrl, Cmd or Alt\n(like `/`) is ignored while the merchant is typing in a field. The page only gets the key while it has focus\n(not from the address bar; in an embedded app, only while focus is in the app's frame), and shortcuts the\nbrowser reserves (Ctrl+T, Ctrl+W, Ctrl+N) can't be used: keep a visible button that calls `show()` too."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown when nothing matches. Default: the built-in string `noResults` (\"No results\")."},{"attribute":"loading-text","property":"loadingText","type":"string","description":"Shown and announced while `loading`. Default: the built-in string `loading` (\"Loading\", shared with other components)."},{"attribute":"recent-label","property":"recentLabel","type":"string","description":"Heading of the `recent` items. Default: the built-in string `recent` (\"Recent\")."},{"attribute":"see-all-label","property":"seeAllLabel","type":"string","description":"Text of each results group's \"See all\" row. Default: the built-in string `seeAll` (\"See all\")."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"toggle","description":"Opens the palette if it is closed and closes it if it is open."},{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[],"events":[{"name":"cm-select","description":"When an item or a \"See all\" row is chosen, with `detail: { item, group, href }` (`item` is undefined for \"See all\"). The palette has already closed. Cancelable: `preventDefault()` stops the link and the item's `run`, to route in your app."},{"name":"cm-search","description":"As the merchant types (and when the box is cleared), with `detail: { query }`. Fetch records and set `results`."},{"name":"cm-open","description":"After the palette opens."},{"name":"cm-close","description":"Before it closes from Escape, the backdrop, the close button or the shortcut. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed and focus has gone back."}],"parts":[],"examples":[{"title":"CRM: leads, contacts and actions","description":"Press the button, or Ctrl+K (⌘K on a Mac) anywhere on this page, even while typing in a field. Type \"ravi\" for records (the demo answers after 400 ms), \"add\" or \"night\" to find actions by keyword, or \"zzz\" for no results. Choosing a record or a place shows a toast here instead of leaving the page; \"Switch to dark theme\" switches this preview.","html":"<div style=\"min-height:120px\">\n <cm-button data-opens=\"palette\" icon=\"search\">Search or run a command</cm-button>\n <cm-command-palette id=\"palette\" shortcut=\"mod+k\" data-demo-crm placeholder=\"Search leads and contacts, or run a command\"\n recent='[{\"title\": \"Ravi Stores\", \"description\": \"Lead · Mumbai\", \"href\": \"#lead-ravi-stores\", \"icon\": \"user\"}, {\"title\": \"Anika Sharma\", \"description\": \"Contact · Sharma Textiles\", \"href\": \"#contact-anika\", \"icon\": \"id-card\"}]'\n actions='[{\"label\": \"Actions\", \"items\": [{\"title\": \"New lead\", \"description\": \"Create a lead\", \"icon\": \"plus\", \"keywords\": [\"create\", \"add\"], \"shortcut\": \"mod+shift+l\", \"value\": \"new-lead\"}, {\"title\": \"Switch to dark theme\", \"icon\": \"moon\", \"keywords\": [\"appearance\", \"night\", \"mode\"], \"value\": \"theme-dark\"}]}, {\"label\": \"Navigate\", \"items\": [{\"title\": \"Go to Tasks\", \"icon\": \"tasks\", \"href\": \"#tasks\", \"shortcut\": \"g t\", \"keywords\": [\"todo\", \"to-do\"]}, {\"title\": \"Go to Leads\", \"icon\": \"users\", \"href\": \"#leads\"}, {\"title\": \"Go to Contacts\", \"icon\": \"id-card\", \"href\": \"#contacts\"}]}]'></cm-command-palette>\n</div>"}],"do":["Turn the shortcut on for one palette per app, in the admin shell, with `shortcut=\"mod+k\"`.","Register every action in `actions` with a few `keywords` merchants might type (\"create\", \"add\" for \"New lead\").","Keep `recent` up to date from `cm-select`, five to eight items.","Debounce `cm-search` (about 250 ms), cancel stale requests, set `loading` while they run, and show at most five records per kind with a \"See all\" link (`href` on the group).","Give actions that have their own shortcut a `shortcut` hint (`mod+shift+l`, or `g t` for keys pressed one after the other), and listen for that shortcut yourself."],"dont":["Don't make it the only way to reach something: everything in it must also be on a page or a menu.","Don't use it to search the list on the current page: use Search; for a search box in the header use Global search.","Don't pick a shortcut the browser keeps for itself (Ctrl+T, Ctrl+W, Ctrl+N, Ctrl+L): pages can't override those.","Don't put destructive actions in it without a confirmation step."],"content":["Actions start with a verb in sentence case: \"New lead\", \"Switch to dark theme\". Places start with \"Go to\": \"Go to Tasks\".","The second line says what a record is and how to tell it apart: \"Lead · Mumbai\".","Group headings are short plurals or kinds: \"Leads\", \"Contacts\", \"Actions\", \"Navigate\"."],"accessibility":["A native modal `<dialog>` named \"Command palette\" (`label`), opened with `showModal()` through the same overlay helper as Modal: the page behind is inert, Esc closes through a cancelable `cm-close`, page scrolling is locked and focus returns to the element that had it.","Inside, the search box is a `combobox` with `aria-expanded`, `aria-controls` and `aria-activedescendant` over a grouped `listbox`, as in Global search: each group is a `group` labelled by its heading; focus never leaves the box.","Result counts, \"Loading\" and \"No results\" are announced through a polite live region; nothing is announced for the empty box.","Key hints are drawn as `<kbd>` keycaps (12px), hidden from screen readers, and exposed on the row as `aria-keyshortcuts` (single shortcuts only, not sequences).","**Shortcut caveat:** `mod+k` is Cmd+K on macOS and iPadOS and Ctrl+K elsewhere. It works while the merchant types in a field because it holds a modifier. The page only gets the key while it has focus: not while focus is in the browser's address bar, and inside an embedded app only while focus is in the app's frame. Chrome, Edge, Firefox and Safari let pages take Ctrl+K / Cmd+K (their own \"search the web\" shortcut then doesn't run while the page has focus); shortcuts browsers reserve (Ctrl+T, Ctrl+W, Ctrl+N) can never be taken. Keep a visible way to open the palette (a button) as well."],"responsive":["A dialog 640px wide (never wider than the window less 32px), centred and 12% of the window height from the top; the list scrolls inside it.","At 640px wide or narrower it fills the screen with square corners, and shows a close button instead of the Esc keycap.","The search box is 40px tall (44px on touch screens, with 16px typed text so phones don't zoom). Rows are 36px with 14px text, 16px icons and 12px side padding, like other menus (1.6); 44px on touch screens."],"related":["global-search","modal","action-menu","header-bar"]},{"tag":"cm-combobox","slug":"combobox","name":"Combobox","react":"Combobox","group":"Forms","summary":"Suggests matching options as the merchant types; picks one, or several shown as tags.","lead":"A 40px text box (32px with `size=\"small\"`, for toolbars and filter rows; 40px since 1.6) that opens a list of matching options as the merchant types. Use it when the list is too long to scroll (customers, products, tags), when results come from the server, or when the merchant may add a value of their own. With `multiple`, chosen options show as removable 24px Tags (12px text, the same tags as everywhere) inside the box; while it isn't focused, the first three show and the rest become \"+N more\" (since 1.6).","docs_url":"https://commmerce.com/commmerceui/#components--combobox","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name. With `multiple`, each value is submitted as its own entry under this name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the chosen option (single mode). Empty when nothing is chosen."},{"attribute":"values","property":"values","type":"string[]","default":"[]","description":"Values of the chosen options (`multiple` mode), in the order they were added."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Shown in the empty text box, e.g. \"Search tags\"."},{"attribute":"options","property":"options","type":"Array<string | SelectOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, group }`. Used instead of `<option>` children when set."},{"attribute":"multiple","property":"multiple","type":"boolean","default":"false","description":"Lets the merchant choose several options, shown as removable 24px tags (`cm-tag`) that wrap onto more rows as the box\ngrows from its 40px minimum. Keyboard: Backspace in the empty box removes the last tag; ← (→ in right-to-left text)\nat the start of the box moves to the tags, ←/→ move between them, Backspace or Delete removes the focused tag, and\n→ past the last tag (or Esc) goes back to the text box. The tags are not Tab stops."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label, for toolbars, filter rows and filter panels. Default: a 40px box (since 1.6, owner standard; was 36px). On touch\nscreens both are 44px. Since 1.5."},{"attribute":"allow-custom","property":"allowCustom","type":"boolean","default":"false","description":"Lets the merchant add what they typed when it isn't an option (\"Add “summer”\"). Fires a cancelable `cm-create`."},{"attribute":"filter","property":"filter","type":"'contains' | 'starts-with' | 'none'","default":"'contains'","description":"How typing narrows the list: `contains` (default), `starts-with`, or `none` when you filter on the server from `cm-search`."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner in the list while you load options."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown in the list when nothing matches. Default: the built-in string `noResults` (\"No results\")."},{"attribute":"loading-text","property":"loadingText","type":"string","description":"Announced and shown while `loading`. Default: the built-in string `loading` (\"Loading\", shared with other components)."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until something is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the list is showing."},{"attribute":"show-group","property":"showGroup","type":"boolean","default":"false","description":"Shows the chosen option's group before its label in the box, or in its tag with `multiple` (\"Lead: Company\"),\nfor grouped lists where labels repeat across groups. The list itself shows the bare label under its heading. Since 1.3."},{"attribute":"max-tags","property":"maxTags","type":"number","default":"3","description":"`multiple`: how many tags show while the box isn't focused; the rest become one \"+N more\" tag. Every tag shows\nwhile the merchant is in the box. `0` shows them all. Default 3 (since 1.6, owner standard)."},{"attribute":"_query","property":"_query","type":"string","default":"''"},{"attribute":"_focusIn","property":"_focusIn","type":"boolean","default":"false","description":"True while focus is inside the element (all tags show)."},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_slotted","property":"_slotted","type":"SelectOption[]","default":"[]"},{"attribute":"_typing","property":"_typing","type":"boolean","default":"false","description":"True while the text box holds the merchant's own query rather than the chosen option's label."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"SelectOption[]","description":"All options in use, normalised (before filtering), in the order shown (options of a group together)."},{"property":"filteredItems","type":"SelectOption[]","description":"The options shown for the current query."}],"methods":[{"name":"removeValue","description":"Removes a chosen value (`multiple`)."},{"name":"focus","description":"Focuses the text box (not the first tag)."}],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements, optionally inside `<optgroup label=\"…\">`. `disabled` (also on an optgroup) and `selected` are honoured."}],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the value changes (an option picked or removed, or a custom value added)."},{"name":"cm-create","description":"Before a custom value is added (`allow-custom`), with `detail: { value }`. Cancelable: call `preventDefault()` to refuse it."},{"name":"cm-search","description":"As the merchant types, with `detail: { query }`. Use it to load matches from the server."}],"parts":[],"examples":[{"title":"Default","description":"Write options as `<option>` children, as for Select. Typing narrows the list to options that contain the text.","html":"<cm-combobox name=\"customer\" label=\"Customer\" placeholder=\"Search customers\">\n <option value=\"c-101\">Robinson Mid Rao</option>\n <option value=\"c-102\">Manjunath K</option>\n <option value=\"c-103\">Anika Sharma</option>\n <option value=\"c-104\">Priya Raman</option>\n <option value=\"c-105\">Rahul Verma</option>\n</cm-combobox>"},{"title":"Product tags (multi-select)","description":"`multiple` shows each chosen tag as a removable Tag; Backspace in the empty box removes the last one, and ← moves to the tags (←/→ between them, Backspace or Delete removes one). `allow-custom` offers \"Add …\" for a tag that doesn't exist yet. The form submits each tag as its own `tags` entry.","html":"<cm-combobox name=\"tags\" label=\"Tags\" multiple allow-custom placeholder=\"Find or create tags\" help-text=\"Customers can filter your store by tag\">\n <option value=\"cotton\" selected>Cotton</option>\n <option value=\"summer\" selected>Summer</option>\n <option value=\"handmade\">Handmade</option>\n <option value=\"festive\">Festive</option>\n <option value=\"sale\">Sale</option>\n <option value=\"organic\">Organic</option>\n</cm-combobox>"},{"title":"Many choices (\"What they sell\")","description":"Since 1.6. With many options chosen, the box shows three tags and \"+4 more\" until the merchant clicks or tabs into it; then every tag shows, wrapping onto more rows. Set `max-tags` to show more (or `0` for all). The list scrolls after seven 36px rows.","html":"<div style=\"max-width:420px;min-height:360px\"><cm-combobox name=\"sells\" label=\"What they sell\" multiple placeholder=\"Search categories\" help-text=\"Choose every category the shop sells\">\n <option selected>Groceries</option><option selected>Dairy</option><option selected>Bakery</option><option selected>Snacks</option>\n <option selected>Beverages</option><option selected>Personal care</option><option selected>Household</option>\n <option>Frozen foods</option><option>Fruits and vegetables</option><option>Stationery</option><option>Electronics</option><option>Pet supplies</option>\n</cm-combobox></div>"},{"title":"Results from the server","description":"With `filter=\"none\"` the component doesn't filter. Listen for `cm-search` (its `detail.query` is the text), set `loading` while you fetch, then set `options` and clear `loading`. Debounce the request in your code. In this preview the list is already loaded.","html":"<cm-combobox name=\"product\" label=\"Product\" filter=\"none\" placeholder=\"Search products\" empty-text=\"No products match\">\n <option value=\"p-1\">Cotton kurta, indigo</option>\n <option value=\"p-2\">Cotton kurta, white</option>\n <option value=\"p-3\">Silk dupatta</option>\n</cm-combobox>"},{"title":"Loading","description":"While `loading`, the open list shows a spinner and \"Loading\" is announced.","html":"<cm-combobox label=\"Product\" filter=\"none\" loading placeholder=\"Search products\"></cm-combobox>"},{"title":"Error","html":"<cm-combobox name=\"courier\" label=\"Courier\" required error=\"Choose a courier for this order\" placeholder=\"Search couriers\">\n <option value=\"delhivery\">Delhivery</option>\n <option value=\"bluedart\">Blue Dart</option>\n <option value=\"ekart\" disabled>Ekart (not available in your area)</option>\n</cm-combobox>"},{"title":"Small","description":"Since 1.5. `size=\"small\"` makes the box 32px with a 13px label, to sit in a filter row with small selects and slim buttons.","html":"<cm-combobox size=\"small\" label=\"Customer\" placeholder=\"Search customers\">\n <option value=\"c-101\">Robinson Mid Rao</option>\n <option value=\"c-102\">Manjunath K</option>\n</cm-combobox>"},{"title":"Disabled","html":"<cm-combobox label=\"Tags\" multiple disabled><option value=\"cotton\" selected>Cotton</option></cm-combobox>"},{"title":"Option groups","description":"Since 1.3. `<optgroup label=\"…\">` children or a `group` on each option in `options`, as for Select. Typing keeps the heading of every group that still has a match (try \"em\"). `show-group` shows the chosen option as \"Contact: Email\" in the box (and in tags with `multiple`).","html":"<div style=\"min-height:340px\"><cm-combobox name=\"field\" label=\"Take the value from a CRM field\" placeholder=\"Search fields\" show-group>\n <optgroup label=\"Lead\">\n <option value=\"lead.company\">Company</option>\n <option value=\"lead.email\">Email</option>\n <option value=\"lead.phone\">Phone</option>\n </optgroup>\n <optgroup label=\"Contact\">\n <option value=\"contact.name\">Full name</option>\n <option value=\"contact.email\">Email</option>\n </optgroup>\n <optgroup label=\"Account\">\n <option value=\"account.name\">Account name</option>\n <option value=\"account.gstin\">GSTIN</option>\n </optgroup>\n</cm-combobox></div>"}],"do":["Use a combobox for long lists (more than about 15 options) and for anything loaded from the server; use Select for short fixed lists.","Use `multiple` for tags, collections and filters that accept several values.","Debounce `cm-search` requests (about 250 ms) and show `loading` while they run.","Use `allow-custom` only where a new value makes sense, such as tags; listen for `cm-create` to check or refuse it."],"dont":["Don't use it for fewer than about 7 options: a select or radio buttons show every choice at once.","Don't put actions in the list: use an action menu.","Don't clear what the merchant typed when results arrive."],"content":["The label is a noun: \"Customer\", \"Tags\".","The placeholder says what can be searched: \"Search by name or phone\".","`empty-text` names what wasn't found: \"No customers match\"."],"accessibility":["Follows the WAI-ARIA APG \"combobox with list autocomplete\" pattern: a native text input with `role=\"combobox\"`, `aria-autocomplete=\"list\"`, `aria-expanded` and `aria-controls` pointing at a `listbox`. Focus stays in the text box; the highlighted option is shown with `aria-activedescendant`.","Option groups are `group`s inside the listbox named by their heading (`aria-labelledby`); headings are not options, and the announced count is of options only.","Keyboard: typing filters and opens the list; Down and Up open it and move through options (skipping disabled ones and group headings, wrapping at the ends); Alt+Down opens it without highlighting; Enter chooses the highlighted option, or adds the typed value with `allow-custom`; Escape closes the list, and a second Escape clears the box; Backspace in an empty box removes the last tag (`multiple`); Tab moves on.","Tags (`multiple`, since 1.6): ← (→ in right-to-left text) at the start of the box moves focus to the last tag; ←/→ move between tags, Home/End to the first and last; Backspace removes the focused tag and moves to the one before, Delete to the one after; → past the last tag or Esc goes back to the text box. Tags are not Tab stops, so Tab leaves the field in one step.","The number of matches (\"3 results\", \"No results\", \"Loading\") is announced through a polite live region as the merchant types.","With `multiple` the listbox is `aria-multiselectable` and chosen options have `aria-selected=\"true\"` and a check mark, not only colour. Each tag's remove button is named \"Remove <tag>\" and focus returns to the text box after removing.","Form-associated: submits `value` under `name`, or with `multiple` one entry per value (`formData.getAll(name)`); `required` blocks submission; `form.reset()` restores the initial choice. `<option selected>` sets it."],"responsive":["Suggestions in the open list are 36px rows of 14px text with 12px side padding (32px with `size=\"small\"`; since 1.6); on touch screens the box and the rows are 44px tall and the typed text is 16px.","With `multiple`, 24px tags wrap onto new rows inside the box, so it grows 28px per row from its 40px minimum instead of getting wider; the chevron stays at the end. While the box isn't focused only `max-tags` (3) tags show, then \"+N more\"."],"related":["select","tag","search","text-field"]},{"tag":"cm-date-picker","slug":"date-picker","name":"Date picker","react":"DatePicker","group":"Forms","summary":"Lets merchants type a date or pick one from a calendar, optionally with a time.","lead":"A 40px text box (32px with `size=\"small\"`; 40px since 1.6) with a calendar button. Merchants can type the date in their own format (15/11/2026, 2026-11-15 or 15 Nov 2026) or open a month calendar to pick it. The value is always ISO `yyyy-mm-dd`, and month and weekday names follow the page language. Add `time` for a date and a time (since 1.2): a time box joins it and the value becomes local `yyyy-mm-ddThh:mm`.","docs_url":"https://commmerce.com/commmerceui/#components--date-picker","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box. Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The date as ISO `yyyy-mm-dd`; empty when no date is set. With `time`: the local date and time\n`yyyy-mm-ddThh:mm` (no time zone or offset), empty until both a date and a time are set."},{"attribute":"min","property":"min","type":"string","default":"''","description":"Earliest date that can be chosen, ISO `yyyy-mm-dd`. With `time` it may include a time, `yyyy-mm-ddThh:mm`,\nor be `now` (the current minute, checked again whenever the field is validated)."},{"attribute":"max","property":"max","type":"string","default":"''","description":"Latest date that can be chosen, ISO `yyyy-mm-dd`. With `time`, also `yyyy-mm-ddThh:mm` or `now`."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Shown in the empty box. Defaults to the locale's pattern, e.g. \"dd/mm/yyyy\"."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for month and weekday names and the typed date order, e.g. `en-IN`, `hi-IN`. Empty: the same\nlanguage as every other component (`configure({ locale })`, else the nearest `lang` attribute, else the browser's).\nBuilt-in text follows that language too; set it with `strings`, `setStrings()` or `configure()`."},{"attribute":"first-day-of-week","property":"firstDayOfWeek","type":"number | undefined","description":"First column of the calendar: 0 = Sunday, 1 = Monday … 6 = Saturday. Defaults to the locale's custom where the browser knows it, else Sunday."},{"attribute":"disabled-dates","property":"disabledDates","type":"string[]","default":"[]","description":"Dates that can't be chosen, as ISO strings. In HTML, a comma- or space-separated list."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until a date is set."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the calendar is showing."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px."},{"attribute":"time","property":"time","type":"boolean","default":"false","description":"Adds a time box next to the date box, so the field holds a date and a time. Times are typed (`3:30 pm`, `15:30`)\nand shown in the locale's clock (12-hour with am/pm for `en-IN`); Up and Down change the time by `step`."},{"attribute":"step","property":"step","type":"number","default":"1","description":"With `time`: minutes between allowed times, counted from midnight (15 allows :00, :15, :30, :45). Up and Down in the time box move by it. Default 1."},{"attribute":"hour-cycle","property":"hourCycle","type":"'' | 'h12' | 'h23'","default":"''","description":"With `time`: `h12` or `h23` to force a 12- or 24-hour clock. Empty: the locale's clock."},{"attribute":"_text","property":"_text","type":"string","default":"''"},{"attribute":"_dateError","property":"_dateError","type":"string","default":"''","description":"Shown after the user leaves a box holding text that isn't a date (or a time); an app's `error` wins."},{"attribute":"_timeError","property":"_timeError","type":"string","default":"''"},{"attribute":"_focus","property":"_focus","type":"Date","default":"new Date()"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"isDateDisabled","type":"(date: string) => boolean | undefined","description":"Function that returns true for dates that can't be chosen, e.g. `(iso) => new Date(iso).getDay() === 0` for Sundays. Property only."},{"property":"valueAsDate","type":"Date | null","description":"The value as a local Date (with `time`, at that time), or null."}],"methods":[{"name":"show","description":"Opens the calendar."},{"name":"close","description":"Closes the calendar."},{"name":"isUnavailable","description":"True when a date can't be chosen (outside min/max, in `disabledDates` or refused by `isDateDisabled`)."}],"slots":[],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the date changes: picked in the calendar, or typed and committed with Enter or by leaving the box."}],"parts":[],"examples":[{"title":"Default","description":"Typed dates are read in the order of the page language: day first for `en-IN`, month first for `en-US`. The placeholder shows the order.","html":"<cm-date-picker name=\"ship_by\" label=\"Ship by\" locale=\"en-IN\" help-text=\"The date the courier collects the parcel\"></cm-date-picker>"},{"title":"With a value, min and max","description":"`min` and `max` take ISO dates. Dates outside them can't be picked, and a typed date outside them makes the field invalid.","html":"<cm-date-picker name=\"publish\" label=\"Publish on\" value=\"2026-11-20\" min=\"2026-11-15\" max=\"2026-12-31\"></cm-date-picker>"},{"title":"Date and time","description":"`time` adds a time box: merchants type `4pm`, `16:00` or `4:15 pm`, or press Up and Down to move by `step` minutes. The time is shown in the locale's clock (12-hour with am/pm for `en-IN`). `min=\"now\"` refuses past days and earlier times today, checked again whenever the field is validated. The value is the merchant's local date and time with no time zone, e.g. `2026-11-20T16:00`: the browser's time zone is the merchant's, so convert it with `new Date(value)` before sending it to a server that stores UTC.","html":"<cm-date-picker name=\"follow_up\" label=\"Follow up on\" locale=\"en-IN\" time min=\"now\" step=\"15\" required help-text=\"In your time zone. Times are on the quarter hour.\"></cm-date-picker>"},{"title":"Date and time with limits","description":"With `time`, `min` and `max` take a date and time (`2026-11-20T10:00`) or a date: a date-only `max` allows the whole of that day. A time outside them, or off the `step`, makes the field invalid with a message that names the limit.","html":"<cm-date-picker name=\"demo_at\" label=\"Demo at\" locale=\"en-IN\" time min=\"2026-11-20T10:00\" max=\"2026-11-27T18:00\" step=\"30\" value=\"2026-11-20T09:30\"></cm-date-picker>"},{"title":"Unavailable dates","description":"`disabled-dates` lists dates that can't be picked (holidays, full slots). For a rule, such as no Sundays, set the `isDateDisabled` property to a function in JavaScript.","html":"<cm-date-picker name=\"pickup\" label=\"Pickup date\" value=\"2026-11-16\" disabled-dates=\"2026-11-17 2026-11-18\" help-text=\"Courier holidays are not available\"></cm-date-picker>"},{"title":"Another language","description":"`locale` sets the language of month and weekday names and the typed order; without it the picker uses the same language as every other component (`configure({ locale })`, else the nearest `lang` attribute). Translate its built-in text (button names, validation messages, the dd/mm/yyyy letters) with `strings` or `setStrings({ datePicker: {…} })`. `first-day-of-week` sets the first column (0 Sunday, 1 Monday).","html":"<cm-date-picker label=\"तारीख\" locale=\"hi-IN\" first-day-of-week=\"0\" value=\"2026-11-15\"></cm-date-picker>"},{"title":"Required","html":"<cm-date-picker name=\"dob\" label=\"Date of birth\" required max=\"2026-11-15\"></cm-date-picker>"},{"title":"Error","html":"<cm-date-picker name=\"expiry\" label=\"Offer ends\" value=\"2026-11-01\" error=\"Choose a date after the offer starts (5 Nov 2026)\"></cm-date-picker>"},{"title":"Small","description":"`size=\"small\"` makes the box 32px with a 13px label, the height of slim buttons, for toolbars, filter rows and filter panels. Both sizes are 44px on touch screens.","html":"<cm-date-picker size=\"small\" label=\"Placed after\"></cm-date-picker>"}],"do":["Let merchants type: it is quicker than the calendar for dates far away, such as a date of birth.","Set `min` and `max` when only some dates make sense, and say why in `help-text`.","Send and store the ISO `value`; format dates for display with `Intl.DateTimeFormat`.","For a start and end date, use Date range picker.","For a follow-up, a booking or a reminder, add `time` and `min=\"now\"`; set `step` (15 or 30) when only round times make sense."],"dont":["Don't add `time` when only the day matters (ship-by dates, dates of birth).","Don't use three separate day, month and year selects.","Don't hide unavailable dates; they stay in the calendar, crossed out and not choosable."],"content":["The label names the date: \"Ship by\", \"Offer ends\", not \"Date\".","Errors say which dates are allowed: \"Choose a date after 5 Nov 2026\"."],"accessibility":["Follows the WAI-ARIA APG \"date picker dialog\" pattern. The text box is a real `<input>` with a `<label>`; the calendar button is named \"Choose date for <label>\" (or \"Change date…, <date>\" once set) and has `aria-haspopup=\"dialog\"` and `aria-expanded`.","The calendar is a `dialog` with a `grid` labelled by the month heading. The month heading is a polite live region, so changing month is announced. Each day is named with the full date (\"Sunday 15 November 2026\"); the chosen day has `aria-selected`, today has `aria-current=\"date\"` and unavailable days `aria-disabled`.","Keyboard in the calendar: arrows move by day and week (in right-to-left languages the grid runs right to left and Left goes to the next day); Home and End go to the start and end of the week; Page Up/Down change month and Shift+Page Up/Down change year; Enter or Space picks the date and closes; Escape closes without picking. Focus returns to the calendar button either way. Tab moves between the month buttons and the grid and stays inside the calendar while it is open. Alt+Down in the text box opens it.","Form-associated: submits the ISO date under `name`; `required` blocks submission while empty; text that is not a date, a date outside `min`/`max` and an unavailable date make the field invalid (`validity.badInput`, `rangeUnderflow`, `rangeOverflow`, `customError`); `form.reset()` restores the initial date.","Dates are local calendar dates with no time zone, so a date never shifts by a day for merchants east or west of UTC.","With `time`: the time box is a text box named \"Time for <label>\", sharing the field's help text and error. Its placeholder shows the format (hh:mm am). Up and Down move the time by `step` minutes (from an empty box they start at `min` or the current time); Enter or leaving the box reads what was typed. Picking a day in the calendar moves focus to the time box while it is empty. A date without a time, or a time that can't be read, makes the field invalid (`validity.badInput`, \"Enter a time.\"); an earlier or later time `rangeUnderflow`/`rangeOverflow`; a time off the step `stepMismatch`. Times are local, like the date: the browser's time zone."],"responsive":["The calendar is never wider than the window less 32px; when the window is 640px wide or less, day cells are 36px tall instead of 40px.","With `time`, the date and time boxes sit side by side (date about two thirds) and the time box moves under the date box when the field is narrower than about 300px."],"related":["date-range-picker","text-field","select"]},{"tag":"cm-date-range-picker","slug":"date-range-picker","name":"Date range picker","react":"DateRangePicker","group":"Forms","summary":"Picks a start (from) and end (to) date, typed or from a calendar, with preset ranges for reports.","lead":"Two date boxes in one field, from and to, with a calendar button. In the calendar, the first date picked is the start and the second the end; preset ranges such as \"Last 7 days\" sit beside it. For reports (since 1.16) it works like an analytics date picker: a \"Custom\" preset, two months side by side and Apply/Cancel. Use it to filter orders and reports by date.","docs_url":"https://commmerce.com/commmerceui/#components--date-range-picker","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box, e.g. \"Order date\". Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name. The range is submitted as `<name>-start` and `<name>-end` unless `start-name` / `end-name` are set."},{"attribute":"start-name","property":"startName","type":"string","default":"''","description":"Form entry name for the start date (instead of `<name>-start`). `name` must still be set for the form to include the field."},{"attribute":"end-name","property":"endName","type":"string","default":"''","description":"Form entry name for the end date (instead of `<name>-end`)."},{"attribute":"start","property":"start","type":"string","default":"''","description":"Start of the range, ISO `yyyy-mm-dd`; empty when not set."},{"attribute":"end","property":"end","type":"string","default":"''","description":"End of the range, ISO `yyyy-mm-dd`; empty when not set."},{"attribute":"min","property":"min","type":"string","default":"''","description":"Earliest date that can be chosen, ISO `yyyy-mm-dd`."},{"attribute":"max","property":"max","type":"string","default":"''","description":"Latest date that can be chosen, ISO `yyyy-mm-dd`. For reports, usually today."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for month and weekday names and the typed date order. Empty: the same language as every other\ncomponent (`configure({ locale })`, else the nearest `lang` attribute, else the browser's)."},{"attribute":"first-day-of-week","property":"firstDayOfWeek","type":"number | undefined","description":"First column of the calendar: 0 = Sunday, 1 = Monday … 6 = Saturday. Defaults to the locale's custom where known, else Sunday."},{"attribute":"disabled-dates","property":"disabledDates","type":"string[]","default":"[]","description":"Dates that can't be chosen, as ISO strings. In HTML, a comma- or space-separated list."},{"attribute":"presets","property":"presets","type":"Array<DateRangePresetKey | DateRangePreset>","default":"[]","description":"Preset ranges shown beside the calendar: keys (`today`, `yesterday`, `last-7-days`, `last-30-days`, `last-90-days`,\n`this-month`, `last-month`) or `{ label, start, end }` objects. In HTML, a space-separated list of keys."},{"attribute":"preset","property":"preset","type":"string","default":"''","description":"Key of the preset the range came from (`last-7-days`), or empty for dates picked or typed. Set it to a key to\nchoose that range relative to today, e.g. a report that opens on \"Last 28 days\"; the picker keeps it up to date\nwhen people change the range. The key need not be in `presets`."},{"attribute":"months","property":"months","type":"number","default":"1","description":"Months shown side by side in the calendar: 1 (default) or 2. Phones (640px or narrower) always show one."},{"attribute":"confirm","property":"confirm","type":"boolean","default":"false","description":"Presets and dates picked in the calendar are a draft until Apply; Cancel, Escape or a click outside drop it.\nWithout it, choosing a preset or the end date changes the range at once."},{"attribute":"variant","property":"variant","type":"'' | 'report'","default":"''","description":"`report` (since 1.18): the layout for report and dashboard pages. The field is one button that shows the preset\nand the range (\"Last 28 days · 23 Oct – 19 Nov 2026\"); the popup has the presets on the left (\"Custom\" first, each\nwith its dates), start and end date boxes, months to scroll through, and Cancel and Apply. It always works as with\n`confirm`. Without `presets` it lists custom, today, yesterday, this week, last 7 days, last week, last 28 days,\nlast 30 days, this month, last month, last 90 days, quarter to date and this year."},{"attribute":"_dStartText","property":"_dStartText","type":"string","default":"''","description":"`variant=\"report\"`: the text in the popup's start and end boxes (the draft, or what is being typed)."},{"attribute":"_dEndText","property":"_dEndText","type":"string","default":"''"},{"attribute":"start-label","property":"startLabel","type":"string","description":"Accessible name of the start input. Default: the built-in string `start` (\"Start date\")."},{"attribute":"end-label","property":"endLabel","type":"string","description":"Accessible name of the end input. Default: the built-in string `end` (\"End date\")."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until both dates are set."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the calendar is showing."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box with a 13px label (filter rows and panels). Default: a 40px box (since 1.6; was 36px). On touch screens both are 44px."},{"attribute":"_startText","property":"_startText","type":"string","default":"''"},{"attribute":"_endText","property":"_endText","type":"string","default":"''"},{"attribute":"_focus","property":"_focus","type":"Date","default":"new Date()"},{"attribute":"_draftStart","property":"_draftStart","type":"string","default":"''"},{"attribute":"_draftEnd","property":"_draftEnd","type":"string","default":"''"},{"attribute":"_hover","property":"_hover","type":"Date | null","default":"null"},{"attribute":"_view","property":"_view","type":"Date","description":"First month shown."},{"attribute":"_draftPreset","property":"_draftPreset","type":"string","default":"''","description":"With `confirm`: the preset key of the draft range."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"isDateDisabled","type":"(date: string) => boolean | undefined","description":"Function that returns true for dates that can't be chosen. Property only."}],"methods":[{"name":"show","description":"Opens the calendar."},{"name":"close","description":"Closes the calendar without changing the range."},{"name":"isUnavailable","description":"True when a date can't be chosen (outside min/max, in `disabledDates` or refused by `isDateDisabled`)."}],"slots":[],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the range changes: both dates picked, a preset chosen, or a typed date committed."}],"parts":[],"examples":[{"title":"Report date range","description":"`variant=\"report\"` (since 1.18) for report and dashboard pages: the field shows the preset and the dates; the popup has the presets on the left with their dates under each, typed start and end boxes, months to scroll through, and Cancel and Apply. Without `presets` it lists the report set (custom, today, yesterday, this week, last 7 days, last week, last 28 days, last 30 days, this month, last month, last 90 days, quarter to date, this year). `preset=\"last-28-days\"` opens on the last 28 days counted from today, and the picker keeps `preset` up to date, so save the preset rather than the dates. Set `max` to today when future days have no data.","html":"<cm-date-range-picker name=\"report\" label=\"Report period\" variant=\"report\" preset=\"last-28-days\"></cm-date-range-picker>"},{"title":"Two months with Apply","description":"For a period that isn't a report filter, `months=\"2\"` shows two months side by side and `confirm` makes presets and dates a draft until Apply. End the presets with `custom` for a \"Custom\" button.","html":"<cm-date-range-picker name=\"sale\" label=\"Sale period\" presets=\"this-week last-week this-month last-month custom\" months=\"2\" confirm></cm-date-range-picker>"},{"title":"Orders date filter","description":"Presets come from a list of keys: `today`, `yesterday`, `this-week`, `last-week`, `last-7-days`, `last-28-days`, `last-30-days`, `last-90-days`, `last-12-months`, `this-month`, `last-month`, `quarter-to-date`, `last-quarter`, `this-year` (1 January to today), `last-year`, and `custom`, a button that leaves the dates to the calendar. Weeks start on the picker's first day of the week. Set `max` to the current date when you render the page, so future days can't be chosen.","html":"<cm-date-range-picker name=\"placed\" label=\"Order date\" presets=\"today last-7-days last-30-days this-month\" start=\"2026-11-01\" end=\"2026-11-15\" help-text=\"Shows orders placed between these dates\"></cm-date-range-picker>"},{"title":"In a filter bar","description":"Next to a payment select, both in the small size (32px), so the boxes line up. The form submits `placed-start` and `placed-end`.","html":"<div class=\"row\" style=\"align-items:flex-end;gap:8px\">\n <cm-date-range-picker size=\"small\" name=\"placed\" label=\"Placed\" presets=\"today last-7-days last-30-days this-month\" style=\"flex:1;min-width:260px\"></cm-date-range-picker>\n <cm-select size=\"small\" label=\"Payment\" style=\"min-width:160px\"><option value=\"\">Any</option><option value=\"paid\">Paid</option><option value=\"pending\">Pending</option></cm-select>\n</div>"},{"title":"Custom form names","description":"For a server that expects other field names, set `start-name` and `end-name` (`name` must still be set).","html":"<cm-date-range-picker name=\"range\" start-name=\"from\" end-name=\"to\" label=\"Sale period\" min=\"2026-11-01\"></cm-date-range-picker>"},{"title":"Required","html":"<cm-date-range-picker name=\"report\" label=\"Report period\" required></cm-date-range-picker>"},{"title":"Error","html":"<cm-date-range-picker name=\"report\" label=\"Report period\" start=\"2026-10-01\" end=\"2026-11-15\" error=\"Choose 31 days or fewer\"></cm-date-range-picker>"}],"do":["Offer presets that match what merchants report on; \"Last 7 days\" and \"This month\" cover most order and sales filters.","For report and dashboard pages, use `variant=\"report\"`.","Save `preset` with a report when it is set, so \"Last 28 days\" still means the last 28 days next week.","Set `max` to today for reports, so empty future days can't be chosen.","Show the chosen range in the report heading too, so a printed or shared page says which dates it covers.","Set custom presets as objects in JavaScript: `picker.presets = [{ label: 'Diwali sale', start: '2026-11-01', end: '2026-11-08' }]`."],"dont":["Don't use two separate date pickers for a range: the range picker keeps the two dates in order and shows the range.","Don't offer more than about six presets in a filter row; a report period can list up to about twelve.","Don't use `confirm` in a small filter row where each change should show at once.","Don't allow very long ranges your reports can't load: check them and set `error`."],"content":["The label names what is filtered: \"Order date\", \"Report period\".","Preset labels are short and relative: \"Last 7 days\", \"This month\"."],"accessibility":["The field is a `group` named by the label, with two text inputs named \"Start date\" and \"End date\" (change with `start-label` and `end-label`). The calendar button is named \"Choose dates for <label>\", or with the current range once set.","The calendar is the same APG date picker grid as Date picker, with the same keys. Picking is two steps: a line under the grid says \"Choose the start date\", then \"Start date 4 Nov 2026. Choose the end date.\" (a polite live region). Dates in the range have `aria-selected`; the start and end days are named \"…, start date\" and \"…, end date\".","Preset ranges are buttons in a list named \"Preset ranges\"; the preset that matches the current range has `aria-pressed=\"true\"` (\"Custom\" when the dates match no preset). Tab moves between presets, month buttons and the grid, staying inside the open calendar; Escape closes without changing the range and returns focus to the calendar button.","With `variant=\"report\"` the field is one button named by the preset and the range (\"Last 28 days, Change dates for Report period, …\"). In the popup, the start and end boxes are labelled text boxes that change the draft (Enter or leaving the box); each listed month is a grid labelled by its month heading, under one weekday row that screen readers skip (each grid has its own hidden weekday headers); only one day is a Tab stop and arrow keys move across months, scrolling the list. The footer says the draft range and its length (\"23 Oct – 19 Nov 2026 · 28 days\").","With `months=\"2\"` the two months are two grids, each labelled by its month heading; only one day in either is a Tab stop, and arrow keys move across both (the months move when focus leaves them). With `confirm`, picking the end date keeps the calendar open; the footer shows the draft range and Cancel and Apply buttons (Apply is disabled until both dates are picked). Escape, Cancel or a click outside drop the draft.","Form-associated: submits `<name>-start` and `<name>-end` (or `start-name` / `end-name`) as ISO dates; `required` needs both; an end before the start, text that isn't a date and dates outside `min`/`max` make it invalid; `form.reset()` restores the initial range."],"responsive":["When the window is 640px wide or less, preset ranges move above the calendar as a row of pills, and day cells are 36px tall.","With `months=\"2\"`, phones (640px or narrower) show one month with both arrows.","With `variant=\"report\"`, phones show the presets as one row of pills that scrolls sideways, above the date boxes and months; the months list is at most 40% of the screen tall.","The calendar is never wider than the window less 32px."],"related":["date-picker","time-picker","filter-panel","data-table","select"]},{"tag":"cm-time-picker","slug":"time-picker","name":"Time picker","react":"TimePicker","group":"Forms","summary":"Lets merchants type a time or choose one from a list, on a 12-hour (am/pm) or 24-hour clock.","lead":"A 40px text box with a clock button and a list of times (since 1.16). Merchants type a time the way they say it (3:30 pm, 15:30, 1530, 9pm) or choose one from the list. The clock follows the page language: 12-hour with am/pm for `en-IN` and `en-US`, 24-hour for `en-GB` and most of Europe. Set `hour-cycle=\"h12\"` or `\"h23\"` to choose one. The value is always 24-hour `hh:mm`, whichever clock is shown.","docs_url":"https://commmerce.com/commmerceui/#components--time-picker","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the box, e.g. \"Pickup time\". Required for accessibility unless the element has an aria-label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the box in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message; turns the border critical and sets aria-invalid."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The time as 24-hour ISO `hh:mm` (`15:30`), whichever clock is shown; empty when not set."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Placeholder. Default: the format, e.g. \"hh:mm am\" or \"hh:mm\"."},{"attribute":"min","property":"min","type":"string","default":"''","description":"Earliest time that can be chosen, `hh:mm`. The list starts here."},{"attribute":"max","property":"max","type":"string","default":"''","description":"Latest time that can be chosen, `hh:mm`. The list ends here."},{"attribute":"step","property":"step","type":"number","default":"1","description":"Minutes between allowed times, counted from midnight (15 allows :00, :15, :30, :45). A typed time off the step is invalid. Default 1."},{"attribute":"interval","property":"interval","type":"number | undefined","description":"Minutes between the times in the list. Default: `step` when it is 5 or more, else 30. Any allowed time can still be typed."},{"attribute":"hour-cycle","property":"hourCycle","type":"'' | 'h12' | 'h23'","default":"''","description":"`h12` (am/pm) or `h23` (24-hour) to force a clock. Empty: the locale's clock (12-hour for `en-IN` and `en-US`, 24-hour for `en-GB` and most of Europe)."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for the clock and am/pm words. Empty: the same language as every other component."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until a time is set."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Whether the list of times is showing."},{"attribute":"size","property":"size","type":"'default' | 'medium' | 'small'","default":"'default'","description":"`small`: a 32px box (filter rows); `medium`: 36px. Default 40px. On touch screens all are 44px."},{"attribute":"_text","property":"_text","type":"string","default":"''"},{"attribute":"_active","property":"_active","type":"number","default":"-1","description":"Index of the keyboard-active time in the list, or -1."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"valueAsNumber","type":"number | null","description":"The value as minutes since midnight, or null."}],"methods":[{"name":"show","description":"Shows the list of times, with the chosen time (or the one nearest to now) active and scrolled into view."},{"name":"close","description":"Hides the list without changing the time."}],"slots":[],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the time changes: a time chosen from the list, or typed text read on Enter or on leaving the box."}],"parts":[],"examples":[{"title":"12-hour clock (am/pm)","description":"`hour-cycle=\"h12\"` shows am/pm whatever the language. The value of this field is `15:30`.","html":"<cm-time-picker name=\"pickup\" label=\"Pickup time\" hour-cycle=\"h12\" value=\"15:30\" help-text=\"In your time zone\"></cm-time-picker>"},{"title":"24-hour clock","description":"`hour-cycle=\"h23\"` shows 00:00 to 23:59.","html":"<cm-time-picker name=\"cutoff\" label=\"Order cut-off\" hour-cycle=\"h23\" value=\"18:00\"></cm-time-picker>"},{"title":"Opening hours","description":"`min` and `max` limit the list and typed times; `step` sets the allowed minutes (15 allows :00, :15, :30, :45) and the list follows it. `interval` changes only the list (default: `step` when it is 5 or more, else every 30 minutes).","html":"<div class=\"row\" style=\"gap:8px;align-items:flex-end\">\n <cm-time-picker name=\"opens\" label=\"Opens\" min=\"06:00\" max=\"23:00\" step=\"15\" value=\"09:00\" style=\"flex:1;min-width:140px\"></cm-time-picker>\n <cm-time-picker name=\"closes\" label=\"Closes\" min=\"06:00\" max=\"23:00\" step=\"15\" value=\"21:00\" style=\"flex:1;min-width:140px\"></cm-time-picker>\n</div>"},{"title":"With a date","description":"For one moment (a follow-up, a delivery slot), use Date picker with `time`; it keeps the date and time in one value. Use the time picker when only the time matters, or for a daily time.","html":"<cm-date-picker name=\"follow_up\" label=\"Follow up on\" time step=\"15\"></cm-date-picker>"},{"title":"Required","html":"<cm-time-picker name=\"slot\" label=\"Delivery slot\" required></cm-time-picker>"},{"title":"Error","html":"<cm-time-picker name=\"slot\" label=\"Delivery slot\" value=\"23:30\" error=\"The last slot starts at 9 pm\"></cm-time-picker>"},{"title":"Small","description":"`size=\"small\"` is 32px for filter rows; `size=\"medium\"` 36px. All sizes are 44px on touch screens.","html":"<cm-time-picker size=\"small\" label=\"From\"></cm-time-picker>"}],"do":["Let the page language choose the clock unless your product has one rule; set `hour-cycle` for that.","Store and send the 24-hour `value`; show times to people with `Intl.DateTimeFormat`.","Set `step` when only some times make sense (slots every 15 or 30 minutes), and say so in `help-text`."],"dont":["Don't use two selects for hours and minutes.","Don't use a time picker for a date and time: use the date picker with `time`.","Don't use it for durations (2 hours 30 minutes): use a number field with a unit."],"content":["The label names the time: \"Pickup time\", \"Opens\", not \"Time\".","Say the time zone in `help-text` when people in other zones use the page."],"accessibility":["Follows the WAI-ARIA APG combobox pattern: the text box has `role=\"combobox\"`, `aria-expanded` and `aria-controls` pointing to a `listbox` named \"Times for <label>\"; the keyboard-active time is `aria-activedescendant` and the chosen time has `aria-selected`. Focus stays in the text box.","Keyboard: Down or Up opens the list at the chosen time (or the next time from now); Up and Down move by one time, Page Up and Page Down by six; Enter chooses; Escape closes without changing the time. Typing while the list is open makes the next listed time active. Enter or leaving the box reads what was typed.","The clock button is not a Tab stop (the text box opens the list) and is named \"Show times\".","Form-associated: submits `hh:mm` under `name`; `required` blocks submission while empty; text that is not a time, a time outside `min`/`max` and a time off the `step` make it invalid (`badInput`, `rangeUnderflow`, `rangeOverflow`, `stepMismatch`), with messages under the field as for every field (1.14); `form.reset()` restores the first value."],"responsive":["The list of times is at least as wide as the box and scrolls after about seven times.","On touch screens the box and each time in the list are 44px tall."],"related":["date-picker","date-range-picker","select"]},{"tag":"cm-file-upload","slug":"file-upload","name":"File upload","react":"FileUpload","group":"Forms","summary":"Lets the merchant choose or drop files, such as product images or documents.","lead":"A compact dashed drop zone under a heading (owner standard, 1.6): one 72px row with an upload icon, \"Drag files here or **Browse**\" and the accepted types and size in 12px grey. Its outline darkens on hover, turns solid while files are dragged over it, and gets a focus ring from the keyboard. Chosen images show as thumbnails with a remove button; with `multiple`, a dashed tile at the end adds more. Upload the files yourself and report progress with `setProgress(file, percent)` (a bar and a Cancel button on the tile) and failures with `setFileError(file, message)`.","docs_url":"https://commmerce.com/commmerceui/#components--file-upload","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Heading above the zone, e.g. \"Add product images\"."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Accepted types and size in 12px grey, e.g. \"PNG or JPG, up to 2 MB\". Shown in the empty zone's row (since 1.6),\nnext to the label once files are chosen, and under the label in the photo tile."},{"attribute":"prompt","property":"prompt","type":"string","description":"Text inside the zone; `{browse}` in it becomes the link-like \"Browse\". Default: the built-in string `prompt`\n(\"Drag files here or {browse}\"; \"Click here to upload\" before 1.6)."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"accept","property":"accept","type":"string","default":"''","description":"Allowed types, as for a native input: `image/*`, `.pdf,.csv`. Other files are refused."},{"attribute":"multiple","property":"multiple","type":"boolean","default":"false","description":"Allows more than one file. Chosen files are added to the list rather than replacing it."},{"attribute":"max-size","property":"maxSize","type":"number","default":"0","description":"Largest allowed file in bytes. Larger files are refused."},{"attribute":"max-files","property":"maxFiles","type":"number","default":"0","description":"Most files allowed when `multiple`; 0 for no limit."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit without a file."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message from your own validation; announced and linked to the input."},{"attribute":"variant","property":"variant","type":"'photo' | undefined","description":"`photo` (since 1.3): a single-photo tile for phones. It shows a camera icon and the `label` (or the prompt\n\"Take a photo\" without one); after a photo is taken it fills the tile, with Retake and Remove buttons under it.\nOne file only (`multiple` is ignored); `accept` defaults to `image/*`. Size the tile with CSS on the element;\nit is 4:3 (change it with `::part(photo)`, e.g. `aspect-ratio: 16 / 10` for a visiting card). Empty, the tile is\nat most 120px tall (since 1.6; 4:3 when it is narrower than 160px)."},{"attribute":"capture","property":"capture","type":"'environment' | 'user' | undefined","description":"Asks phones to open the camera instead of the file chooser, as `capture` on a native input (since 1.3):\n`environment` for the back camera (a shop front, a document), `user` for the front camera (a selfie).\nDesktop browsers ignore it and show the file chooser."},{"attribute":"_rejected","property":"_rejected","type":"string","default":"''"},{"attribute":"_progress","property":"_progress","default":"new Map<File, number>()"},{"attribute":"_fileErrors","property":"_fileErrors","default":"new Map<File, string>()"},{"attribute":"_over","property":"_over","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"files","type":"File[]","description":"The chosen files. Set it to `[]` to clear."}],"methods":[{"name":"addFiles","description":"Adds files as if the merchant had chosen them: filters by type, size and count, then fires events."},{"name":"setProgress","description":"Shows a chosen file uploading (since 1.6): a progress bar from 0 to 100 on its tile, with a Cancel button in place\nof Remove. `null` ends it (the upload finished, or failed: then call `setFileError`)."},{"name":"setFileError","description":"Marks one chosen file as failed (since 1.6): its tile turns red with `message` under it. `''` clears it."},{"name":"removeFile","description":"Removes one chosen file and fires `change`."}],"slots":[],"events":[{"name":"cm-reject","description":"When chosen files are refused for type or size. `detail.files` lists them."},{"name":"change","description":"When files are added or removed. Read `files`."},{"name":"cm-cancel","description":"When the merchant cancels a file's upload, with `detail: { file }`: stop the upload. The file is then removed; `preventDefault()` keeps it. Since 1.6."}],"parts":[],"examples":[{"title":"Product images","description":"The compact empty state (1.6). Choose or drop a file to see it pretend to upload.","html":"<cm-file-upload name=\"images\" label=\"Add product images\" hint=\"PNG or JPG, up to 300 KB each\" accept=\"image/*\" multiple max-size=\"307200\" data-demo-upload></cm-file-upload>"},{"title":"Uploading and failed files","description":"Since 1.6. After `change`, upload each new file and call `setProgress(file, percent)` as it goes and `setProgress(file, null)` when it is done: the tile shows a progress bar and its × becomes \"Cancel uploading …\", which fires `cm-cancel` (stop the request; the file is then removed). A failed file: `setFileError(file, message)` turns its tile red with the message under it. In this preview the files are made up.","html":"<cm-file-upload name=\"feedback\" label=\"Feedback attachments\" hint=\"PNG, JPG or PDF, up to 5 MB\" accept=\"image/*,.pdf\" multiple data-demo-files=\"screen.png:45,receipt.pdf:80,photo.png:error\"></cm-file-upload>"},{"title":"Single document","description":"Without `multiple`, a chosen file replaces the zone; remove it to choose another.","html":"<cm-file-upload name=\"gst\" label=\"GST certificate\" hint=\"PDF, up to 2 MB\" accept=\".pdf\" max-size=\"2097152\" prompt=\"Drag a PDF here or {browse}\"></cm-file-upload>"},{"title":"Without a heading","description":"Inside a popup, where the popup title already says what to upload. Give the zone a prompt that names the file; `{browse}` in it becomes the link-like \"Browse\".","html":"<cm-file-upload name=\"banner\" prompt=\"Drop the banner image here or {browse}\" hint=\"1200 x 400px\" accept=\"image/*\"></cm-file-upload>"},{"title":"Required with error","html":"<cm-file-upload name=\"kyc\" label=\"Address proof\" hint=\"PDF or photo, up to 5 MB\" required error=\"Upload an address proof to continue\"></cm-file-upload>"},{"title":"Photo from the camera","description":"Since 1.3. `variant=\"photo\"` is one tile for one photo, the usual pattern on phones; `capture=\"environment\"` opens the back camera directly (desktop browsers show the file chooser). Empty, the tile is 4:3 and at most 120px tall (since 1.6; it grew to 300px in wide columns). After a photo is taken it fills the width, with Retake and Remove under it. Images only unless you set `accept`.","html":"<div style=\"display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:16px;max-width:420px\">\n <cm-file-upload name=\"shop_photo\" variant=\"photo\" capture=\"environment\" label=\"Shop front photo\" required max-size=\"5242880\"></cm-file-upload>\n <cm-file-upload name=\"card_photo\" variant=\"photo\" capture=\"environment\" label=\"Visiting card\" hint=\"max. 5 MB\" max-size=\"5242880\"></cm-file-upload>\n</div>"},{"title":"Camera on a multi-file zone","description":"Since 1.3. `capture` works on the default zone too, for example for several shelf photos.","html":"<cm-file-upload name=\"shelf\" label=\"Shelf photos\" accept=\"image/*\" capture=\"environment\" multiple max-files=\"4\"></cm-file-upload>"}],"do":["State the allowed types and size in `hint`, and enforce them with `accept` and `max-size`.","Use `multiple` with `max-files` for galleries.","On phones, use `variant=\"photo\"` with `capture=\"environment\"` for a photo the merchant takes on the spot (shop front, visiting card, delivery proof). Give each tile a label that names the photo; the buttons are named after it (\"Retake Shop front photo\").","Change the photo tile's shape with `::part(photo)` (the empty tile and the photo both have it), e.g. `aspect-ratio: 16 / 10` for a card; it is 4:3 by default.","Upload in the background after `change`; report progress on the file's own tile with `setProgress(file, percent)` and a failure with `setFileError(file, message)`, and stop the request on `cm-cancel`."],"dont":["Don't hide the rules until after an upload fails.","Don't make the empty zone tall to draw attention: the 72px row is the standard (owner standard, 1.6).","Don't use it for a single image that can be picked from existing media: use a resource picker (planned)."],"content":["Heading says what to add: \"Add product images\".","Hints are lowercase rules: \"max. file size 300 KB\".","Refusals name the file and the rule: \"banner.png is larger than 300 KB\"."],"accessibility":["A native file input fills the zone, so it is reachable with Tab, opens with Enter or Space, and accepts dropped files. It is named by the heading and the prompt.","Photo tile (`variant=\"photo\"`): the input is named by the label alone (\"Shop front photo\", or \"Take a photo\" without a label) and described by the hint. The taken photo's `alt` is the label. Retake and Remove are buttons named \"Retake <label>\" and \"Remove <label>\"; Retake opens the same input again, and after Remove focus returns to the empty tile. A refused photo keeps the previous one and its message is linked to Retake.","Each thumbnail's remove button is named \"Remove <file name>\"; after removing, focus returns to the zone.","Uploading (1.6): each file's bar is a `progressbar` named \"Uploading <file name>\" with its percentage; its button is named \"Cancel uploading <file name>\". A failed file's message is announced (`role=\"alert\"`) and describes its Remove button.","Refused files and errors are announced (`role=\"alert\"`) and linked with `aria-describedby`; `cm-reject` lists the refused files.","Form-associated: submits the files under `name` (use `enctype=\"multipart/form-data\"`), `required` blocks submission, and `form.reset()` clears them.","The zone is the full width you give it; thumbnails are 112–140px; the drag handle and the star/download/edit hover actions from the product-image screen are left for a future media manager."],"responsive":["Empty, the zone is one 72px row at every width (since 1.6; it was a 160px box): the icon tile, the prompt and the hint; long hints wrap inside it.","Chosen files are shown as tiles: each row holds as many 112–140px tiles as fit, 16px apart.","The empty photo tile (`variant=\"photo\"`) is 4:3 and at most 120px tall, so 160 x 120px in a wide column.","When the window is 640px wide or less, the label is smaller."],"related":["text-field","button"]},{"tag":"cm-color-field","slug":"color-field","name":"Colour field","react":"ColorField","group":"Forms","summary":"Lets the merchant choose a colour that means something, such as the colour of each lead status.","lead":"A label, a row of round swatches and a hex box. The default palette is 12 colours taken from the Commmerce tokens; pass your own with `swatches`. `picker` adds the colour picker for any other colour, with the store's brand colours and the merchant's recent ones. The value is lowercase `#rrggbb` unless you allow opacity, RGB/HSL or gradients. Since 1.3; picker panel since 1.17.","docs_url":"https://commmerce.com/commmerceui/#components--color-field","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the swatches, e.g. \"Colour\". Without one, give the element an `aria-label`."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Lowercase bracketed note after the label, e.g. \"shown on the status tag\"."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the field in text-tertiary."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message from your own validation; turns the hex box critical and is announced."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The colour as lowercase `#rrggbb`, or empty for none. `#ABC` and `ABCDEF` are accepted and normalised."},{"attribute":"swatches","property":"swatches","type":"Array<string | ColorSwatch> | undefined","description":"The palette, as `#rrggbb` strings or `{ value, name }`. Names are read out with the hex code and shown as a\ntooltip. Default: 12 colours from the Commmerce tokens (black, greys, red, oranges, yellow, greens, blues).\nIn HTML, pass JSON: `swatches='[\"#2e6faf\", {\"value\": \"#de0000\", \"name\": \"Lost\"}]'`."},{"attribute":"picker","property":"picker","type":"boolean | 'native'","default":"false","description":"Adds a button that opens a colour picker for colours outside the palette: the Commmerce picker panel (since\n1.17.0), or the browser's own with `picker=\"native\"`."},{"attribute":"alpha","property":"alpha","type":"boolean","default":"false","description":"Allows see-through colours: the picker shows opacity; the value may be `#rrggbbaa`, `rgba()` or `hsla()`."},{"attribute":"gradient","property":"gradient","type":"boolean","default":"false","description":"Allows linear and radial gradients from the picker; the value may then be a CSS gradient."},{"attribute":"formats","property":"formats","type":"string","default":"'hex'","description":"Formats the merchant may pick in the picker, space separated: `hex`, `rgb`, `hsl`. Default `hex` only, so the\nvalue stays `#rrggbb`. With more, the value is written in the format they chose."},{"attribute":"brand-colors","property":"brandColors","type":"Array<string | ColorSwatch> | undefined","description":"The store's brand colours, shown first in the picker. In HTML, pass JSON. Wins over `source`."},{"attribute":"recent-colors","property":"recentColors","type":"string[] | undefined","description":"Recent colours for the picker, newest first. Wins over `source`."},{"attribute":"recent-key","property":"recentKey","type":"string","default":"''","description":"Keeps recent colours in this browser under this key when there is no `source`."},{"attribute":"_open","property":"_open","type":"boolean","default":"false"},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Shows a red asterisk and blocks form submission until a colour is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"_draft","property":"_draft","type":"string | undefined","description":"Text in the hex box while it differs from `value`."},{"attribute":"_invalid","property":"_invalid","type":"boolean","default":"false","description":"The hex box holds text that isn't a colour (after it was committed)."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"source","type":"ColorSource | undefined","description":"Where the picker gets brand and recent colours: `app.colors` (App Bridge), `httpColorSource()` or your own."},{"property":"items","type":"ColorSwatch[]","description":"The swatches in use, normalised, with their names. Invalid colours are left out."}],"methods":[{"name":"show","description":"Opens or closes the picker panel."}],"slots":[],"events":[{"name":"type"},{"name":"input","description":"When the colour changes: a swatch, a complete hex code typed, or the picker moving."},{"name":"change","description":"When the colour is committed: a swatch picked, the hex box left or Enter pressed, the picker closed."},{"name":"cm-recent-change","description":"From the picker panel: `detail.colors`, the new recent list."}],"parts":[],"examples":[{"title":"Status colour","html":"<cm-color-field name=\"status_color\" label=\"Status colour\" value=\"#2e6faf\" help-text=\"Shown on the status tag in lists.\"></cm-color-field>"},{"title":"With the colour picker","description":"`picker` turns the preview square into a button that opens the colour picker: a saturation square, hue, the hex box, the eyedropper (Chrome and Edge), brand colours, recent colours and the palette. Without `formats`, `alpha` or `gradient` the value stays `#rrggbb`. Since 1.17; before, `picker` opened the browser's own picker, which `picker=\"native\"` still does.","html":"<cm-color-field name=\"highlight\" label=\"Highlight\" hint=\"optional\" value=\"#ffc107\" picker recent-key=\"docs-highlight\" brand-colors='[{\"value\":\"#0a7cff\",\"name\":\"Primary\"},{\"value\":\"#111827\",\"name\":\"Ink\"},{\"value\":\"#ff5a1f\",\"name\":\"Accent\"}]'></cm-color-field>"},{"title":"Opacity, formats and gradients","description":"`alpha` adds opacity (`#rrggbbaa`, `rgba()`, `hsla()`), `formats=\"hex rgb hsl\"` lets the merchant choose how the value is written, and `gradient` adds linear and radial gradients. The box then takes any of those. Check the value again on your server.","html":"<cm-color-field name=\"banner_bg\" label=\"Banner background\" picker alpha gradient formats=\"hex rgb hsl\" value=\"linear-gradient(90deg, #2e6faf 0%, #81bb47 100%)\"></cm-color-field>"},{"title":"Brand and recent colours from the admin","description":"In an embedded app, pass App Bridge's `app.colors` as `source`: the admin answers with the brand colours set in the store settings and remembers recents per staff member. Outside the admin, use `httpColorSource({ baseUrl })` with your server (see Colour picker). In JavaScript: `field.source = app.colors`.","html":"<cm-color-field name=\"label_color\" label=\"Label colour\" picker value=\"#2e6faf\"></cm-color-field>"},{"title":"Your own palette","description":"Strings or `{ value, name }`. Names are read out with the hex code and shown as a tooltip. In JavaScript: `field.swatches = [{ value: '#3c7c00', name: 'Won' }]`.","html":"<cm-color-field name=\"pipeline_color\" label=\"Stage colour\" swatches='[{\"value\":\"#3c7c00\",\"name\":\"Won\"},{\"value\":\"#de0000\",\"name\":\"Lost\"},{\"value\":\"#ad5500\",\"name\":\"On hold\"},{\"value\":\"#2e6faf\",\"name\":\"Open\"}]' value=\"#de0000\"></cm-color-field>"},{"title":"Required with error","html":"<cm-color-field name=\"tag_color\" label=\"Tag colour\" required error=\"Choose a colour that isn't used by another status\"></cm-color-field>"}],"do":["Use it where a colour helps merchants tell things apart at a glance (pick-list values, tags, calendar types), and always show the name next to the colour where it is used.","Keep the palette small: the default 12, or fewer of your own.","Pair a chosen colour with text by luminance where you use it (as the swatch check mark does), so labels on it stay readable."],"dont":["Don't use a picked colour to theme your app's own interface: embedded apps use Commmerce's palette. Picked colours are the merchant's data (a label, a banner, a status).","Don't let colour be the only way a status is shown: keep its name visible.","Don't turn on `alpha`, `gradient` or more `formats` unless the place the colour is used can show them."],"content":["Label names what the colour is for: \"Status colour\", not \"Colour\".","Name your own swatches after what they mean (\"Won\", \"Lost\") or plainly (\"Blue\"); the hex code is added for you."],"accessibility":["The swatches are a `radiogroup` named by the label (or the element's `aria-label`): one tab stop, arrow keys move and select (wrapping; ArrowLeft moves forward in right-to-left text), Home and End jump, Space and Enter select. Each swatch is a `radio` named \"<name>, <hex>\" (\"Blue, #2e6faf\"), or by its hex code alone.","The selected swatch shows a check mark and a ring, so the choice doesn't rely on colour. The check is black or white, whichever contrasts more with the swatch (4.5:1 or more for any colour); every swatch has a `border-input` outline so light colours stand out on white and black on dark.","The hex box is named \"<label>, hex code\". A complete code updates the value as you type; leaving the box or pressing Enter commits it. Text that isn't a colour shows \"Enter a colour as #RRGGBB, for example #2e6faf.\" (announced, `aria-invalid`, linked with `aria-describedby`) and makes the field invalid. `#abc` and codes without `#` are accepted and normalised.","With `picker`, the button is named \"Choose a custom colour for <label>\", says it opens a dialog (`aria-haspopup`, `aria-expanded`) and opens the picker in the top layer with focus on its square; Escape or a click outside closes it and Escape returns focus to the button. See Colour picker for the panel. With `picker=\"native\"`, the browser's colour input has the same name.","With `alpha`, `gradient` or more `formats`, the box is named \"<label>, colour value\" and text that isn't a colour shows \"Enter a colour such as #2e6faf or rgb(46, 111, 175).\"","Form-associated like Text field: submits `value` under `name`, `required` blocks submission, `error` sets a custom error, a disabled `<fieldset>` disables it, `form.reset()` restores the first value."],"responsive":["Swatches wrap onto more rows when they don't fit; each is 32px with 8px between.","The hex box is wide enough for \"#rrggbb\" and does not stretch."],"related":["text-field","option-group","tag"]},{"tag":"cm-color-picker","slug":"color-picker","name":"Colour picker","react":"ColorPicker","group":"Forms","summary":"Picks any colour: a saturation square, hue and opacity, hex/RGB/HSL, the eyedropper, gradients, and the store's brand colours and recent colours.","lead":"The panel that colour field opens with `picker`; use it on its own in a side panel or popover of yours. From the top: Solid / Gradient tabs (`gradient`), the gradient bar with its stops, the saturation and brightness square, hue and opacity (`alpha`) sliders with a preview, the format menu (`formats`) with a box per channel and the eyedropper, then three swatch groups: **Brand colours**, **Recent** and **Palette**. Since 1.17.","docs_url":"https://commmerce.com/commmerceui/#components--color-picker","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"The colour: hex, `rgb()`, `hsl()` or, with `gradient`, a `linear-gradient()` / `radial-gradient()`. Empty for none."},{"attribute":"format","property":"format","type":"ColorFormat","default":"'hex'","description":"How the value is written: `hex` (default), `rgb` or `hsl`. Changes when the merchant picks another format."},{"attribute":"formats","property":"formats","type":"string","default":"'hex rgb hsl'","description":"Formats the merchant may switch between, space separated. Default `hex rgb hsl`; one format hides the menu."},{"attribute":"alpha","property":"alpha","type":"boolean","default":"false","description":"Shows the opacity slider. A see-through colour is written `#rrggbbaa`, `rgba()` or `hsla()`."},{"attribute":"gradient","property":"gradient","type":"boolean","default":"false","description":"Adds Solid / Gradient tabs: linear or radial gradients with two or more stops."},{"attribute":"swatches","property":"swatches","type":"Array<string | ColorSwatch> | undefined","description":"The palette, as colours or `{ value, name }`. Default: 12 colours from the Commmerce tokens. `[]` hides it."},{"attribute":"brand-colors","property":"brandColors","type":"Array<string | ColorSwatch> | undefined","description":"The store's brand colours. Wins over `source`. In HTML, pass JSON."},{"attribute":"recent-colors","property":"recentColors","type":"string[] | undefined","description":"Recent colours, newest first. Wins over `source`; update it from `cm-recent-change`."},{"attribute":"recent-key","property":"recentKey","type":"string","default":"''","description":"Keeps recents in this browser under this key when there is no `source` (a `localColorSource`)."},{"attribute":"max-recent","property":"maxRecent","type":"number","default":"MAX_RECENT","description":"How many recent colours to show. Default 16."},{"attribute":"eyedropper","property":"eyedropper","type":"boolean","default":"true","description":"Shows the eyedropper where the browser has one (Chrome and Edge on desktop). Default on."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction."},{"attribute":"_hsva","property":"_hsva","type":"Hsva","default":"{ h: 0, s: 0, v: 0, a: 1 }"},{"attribute":"_grad","property":"_grad","type":"Gradient | null","default":"null"},{"attribute":"_stop","property":"_stop","type":"number","default":"0"},{"attribute":"_brand","property":"_brand","type":"ColorSwatch[]","default":"[]"},{"attribute":"_recent","property":"_recent","type":"string[]","default":"[]"},{"attribute":"_drafts","property":"_drafts","type":"Record<string, string>","default":"{}","description":"Text in a box while it differs from the colour, keyed by box."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"source","type":"ColorSource | undefined","description":"Where brand and recent colours come from (see the colour picker docs)."},{"property":"allowedFormats","type":"ColorFormat[]","description":"Formats the merchant may choose."},{"property":"palette","type":"ColorSwatch[]","description":"The palette in use."},{"property":"brand","type":"ColorSwatch[]","description":"Brand colours in use (`brand-colors`, else from `source`)."},{"property":"recent","type":"string[]","description":"Recent colours in use (`recent-colors`, else from `source` / `recent-key`), without gradients unless `gradient`."}],"methods":[],"slots":[],"events":[{"name":"type"},{"name":"cm-recent-change","description":"`detail.colors`: the new recent list (newest first) after a commit added to it."},{"name":"input","description":"While the colour changes (dragging, typing a complete value)."},{"name":"change","description":"When a colour is committed: a drag ends, a swatch is picked, a box is left or Enter pressed."}],"parts":[],"examples":[{"title":"Brand and recent colours","description":"Brand colours are the ones the merchant set for the store. Each colour they commit that isn't a brand or palette colour goes first in Recent. Here `recent-key` keeps recents in this browser; try a few colours.","html":"<cm-color-picker value=\"#0a7cff\" recent-key=\"docs-picker\" brand-colors='[{\"value\":\"#0a7cff\",\"name\":\"Primary\"},{\"value\":\"#111827\",\"name\":\"Ink\"},{\"value\":\"#ff5a1f\",\"name\":\"Accent\"},{\"value\":\"#f4f1ea\",\"name\":\"Paper\"}]'></cm-color-picker>"},{"title":"Opacity and formats","description":"`alpha` adds the opacity slider and box. The format menu writes the value as hex (`#rrggbbaa` when see-through), `rgb()`/`rgba()` or `hsl()`/`hsla()`; limit it with `formats` (one format hides the menu).","html":"<cm-color-picker alpha value=\"rgba(46, 111, 175, 0.6)\"></cm-color-picker>"},{"title":"Gradients","description":"`gradient` adds Solid / Gradient tabs. Click the bar to add a stop, drag a stop or use the arrow keys to move it, Delete to remove it (two stay). The square, sliders and boxes edit the selected stop. Linear (with an angle) or radial.","html":"<cm-color-picker gradient alpha value=\"linear-gradient(135deg, #0a7cff 0%, #81bb47 100%)\"></cm-color-picker>"},{"title":"From App Bridge or your server","description":"`source` is any object with `brandColors()`, `recentColors()` and `addRecentColor(color)`. In an embedded app, `app.colors` (App Bridge 1.17) asks the admin. Elsewhere, `httpColorSource()` calls the Colour API on your server: `GET /brand-colors`, `GET /recent-colors`, `POST /recent-colors` with `{ \"color\": … }`, each answering `{ \"colors\": […] }`. A reference server (Node, no dependencies) is in the repository at examples/color-api. Lists that fail to load are left out. In JavaScript: `picker.source = httpColorSource({ baseUrl: '/api/colors', headers: () => ({ Authorization: 'Bearer ' + token }) })`, or `picker.source = app.colors` inside the admin, and save `picker.value` on `change`.","html":"<cm-color-picker value=\"#2e6faf\"></cm-color-picker>"}],"do":["Pass the store's brand colours wherever merchants style something customers see (labels, banners, emails), so they stay on brand.","Save `value` on `change`, not `input`: `input` fires on every step of a drag.","Check the value again on your server (the reference Colour API has a validator)."],"dont":["Don't theme your app's own interface with picked colours.","Don't turn on `alpha` or `gradient` for places that can only show a solid colour.","Don't keep recents only in the browser when the merchant works on several devices: use App Bridge or your server."],"content":["Name brand colours by role (\"Primary\", \"Accent\"), not by hex."],"accessibility":["The panel is a group named \"Colour picker\" (or its `aria-label`).","The square is a `slider` named \"Saturation and brightness\" with a value like \"Saturation 74%, brightness 69%\". Left and Right change saturation (reversed in right-to-left text), Up and Down brightness, Shift for steps of 10, Home/End for no or full saturation, PageUp/PageDown for full or no brightness. Each key press commits.","Hue and opacity are native range inputs (\"Hue\", \"Opacity\"), so arrow keys, Home and End work and screen readers read them as sliders. Each box is named after its channel (Hex, Red, Green, Blue, Hue, Saturation, Lightness, Opacity); text that isn't a value turns the box red (`aria-invalid`) and changes nothing.","Gradient stops are `slider`s named \"Stop 2, #0000ff at 100%\": arrows move them (Shift for 10), Home/End to the ends, Delete or Backspace removes one. Solid / Gradient is a `radiogroup`.","Swatches are buttons named \"<name>, <value>\" (or the value) with `aria-pressed` for the current colour, in groups named by their headings. See-through swatches sit on a checkerboard.","The eyedropper shows only where the browser has one (Chrome and Edge on desktop) and is named \"Pick a colour from the screen\".","All built-in text is translatable (`colorPicker` strings)."],"responsive":["272px wide, or narrower when its container is. The square is 160px tall.","Swatches are 24px with 8px between and wrap onto more rows.","On touch screens the square and the stop handles follow the finger; the page does not scroll while dragging on them."],"related":["color-field","modal","side-panel"]},{"tag":"cm-signature-field","slug":"signature-field","name":"Signature field","react":"SignatureField","group":"Forms","summary":"Collects a signature: drawn with a mouse, finger or pen, or typed and shown in a handwriting font.","lead":"A label, Draw and Type tabs with Undo and Clear, and a 3:1 pad with a dashed line and \"Sign here\". Draw takes mouse, touch and pen (with pen pressure), smoothing the strokes; Type shows the name in Dancing Script, self-hosted in `@commmerce/tokens/fonts.css` (falls back to a cursive system font). The value is a PNG data URL, cropped to the ink with 8px around it, at 2x, black ink on transparent in either theme, so it looks right in documents. `toDataURL()` and `toBlob()` give the same image; `empty` says whether anything is signed; `clear()` and `undo()` do what the buttons do. Set `value` to a saved PNG to show it again. There is no upload mode. Since 1.4.","docs_url":"https://commmerce.com/commmerceui/#components--signature-field","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible label above the field, e.g. \"Your signature\". Without one, give the element an `aria-label`."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"Lowercase bracketed note after the label."},{"attribute":"help-text","property":"helpText","type":"string","default":"''","description":"One sentence under the field in text-tertiary, e.g. what the signer agrees to."},{"attribute":"error","property":"error","type":"string","default":"''","description":"Error message from your own validation; turns the pad's border critical and is announced."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"The signature as a PNG data URL (`data:image/png;base64,…`), cropped to the ink, or empty when nothing is\nsigned. Updated after every stroke and keystroke. Set it to a PNG or SVG data URL (or any image URL the page\nmay read) to show a saved signature in Draw mode; set it to `''` to clear both modes."},{"attribute":"mode","property":"mode","type":"'draw' | 'type'","default":"'draw'","description":"The selected tab: `draw` (pointer, touch, pen) or `type` (keyboard). Each keeps its own signature."},{"attribute":"typed-name","property":"typedName","type":"string","default":"''","description":"The name typed in Type mode. Set it to prefill the box with the signer's name."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"Shows a red asterisk and blocks form submission until something is signed."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks interaction. Also set by a disabled `<fieldset>`."},{"attribute":"_announce","property":"_announce"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"empty","type":"boolean","description":"True when the current mode has nothing signed: no strokes (or saved image) in Draw, no text in Type."}],"methods":[{"name":"toDataURL","description":"The signature as a PNG data URL: black ink on transparent at 2x the pad's size, cropped to the ink with 8px\n(16 image pixels) around it. Empty string when nothing is signed."},{"name":"toBlob","description":"The same PNG as `toDataURL()` as a Blob, for uploading. `null` when nothing is signed."},{"name":"clear","description":"Removes the current mode's signature (Draw: every stroke and any saved image; Type: the text)."},{"name":"undo","description":"Removes the last stroke in Draw mode (then the saved image, if one was loaded)."}],"slots":[],"events":[{"name":"cm-change","description":"After a stroke is finished, Undo, Clear, a switch between Draw and Type, or typing stops for 400ms. `detail`: `{ value, empty, mode }`. A plain `change` event (no detail) follows it, for code that treats every form field alike."},{"name":"change"}],"parts":[],"examples":[{"title":"Sign now dialog","description":"The CRM's e-sign step. The main button stays disabled until something is signed: listen for `change` (or `cm-change`) and read `empty`. Send `toBlob()` to your server, or submit `value`.","html":"<cm-button variant=\"primary\" data-opens=\"sign-now\">Sign now</cm-button>\n<cm-modal id=\"sign-now\" heading=\"Sign quote Q-1042\">\n <div style=\"display:grid;gap:var(--cm-space-16)\">\n <p style=\"margin:0\">By signing, you accept quote Q-1042 for ₹48,500.</p>\n <cm-signature-field name=\"signature\" label=\"Your signature\" required onchange=\"this.closest('cm-modal').querySelector('[data-sign]').disabled = this.empty\"></cm-signature-field>\n </div>\n <cm-button slot=\"footer\">Cancel</cm-button>\n <cm-button slot=\"footer\" variant=\"primary\" data-sign disabled>Sign and accept</cm-button>\n</cm-modal>"},{"title":"Required in a form","description":"Form-associated: submits the PNG data URL under `name`, and `required` blocks submission until something is signed (drawn or typed). Reset clears it.","html":"<form class=\"stack\" style=\"max-width:560px\" onsubmit=\"event.preventDefault(); const d = new FormData(this); this.querySelector('output').textContent = 'Submitted: ' + d.get('signer') + ', signature PNG of ' + Math.ceil(d.get('signature').length * 0.75 / 1024) + ' KB'\">\n <cm-text-field name=\"signer\" label=\"Full name\" value=\"Asha Rao\" required></cm-text-field>\n <cm-signature-field name=\"signature\" label=\"Signature\" required help-text=\"Draw your signature, or choose Type to type your name.\"></cm-signature-field>\n <div class=\"row\">\n <cm-button type=\"reset\">Reset</cm-button>\n <cm-button type=\"submit\" variant=\"primary\">Submit</cm-button>\n </div>\n <output></output>\n</form>"},{"title":"Typed signature","description":"`mode=\"type\"` opens on Type; `typed-name` prefills the box, for example with the signer's name from the record. Typing is the way to sign with a keyboard or a screen reader. The font is Dancing Script (Latin letters); other scripts use the system's cursive font.","html":"<cm-signature-field name=\"signature\" label=\"Signature\" mode=\"type\" typed-name=\"Asha Rao\"></cm-signature-field>"},{"title":"The exported image","description":"What `value` holds after each change: a PNG cropped to the ink, black on transparent in the light and dark theme. It is shown here on white, as it would be on a document.","html":"<div class=\"stack\" style=\"gap:var(--cm-space-16)\">\n <cm-signature-field label=\"Signature\" onchange=\"const img = this.nextElementSibling; img.hidden = this.empty; img.src = this.value || ''\"></cm-signature-field>\n <img alt=\"Exported signature\" hidden style=\"justify-self:start;max-width:100%;height:80px;background:white;border:1px dashed var(--cm-border-input)\">\n</div>"}],"do":["Say what the signer agrees to right above the field (the quote, the amount, the terms), and name the main button after it: \"Sign and accept\".","Keep both Draw and Type: typing is the accessible way to sign, and many signers prefer it on a laptop.","Store the PNG with who signed, when, and what they signed; the image alone is not proof.","Load `fonts.css` on signing pages, so typed signatures use the handwriting font."],"dont":["Don't prefill `typed-name` and submit without the signer acting: prefill only to save typing, and make them press the sign button.","Don't put the pad in a scrolling area that is too small to draw in: on phones, give it the full width.","Don't recolour or invert the exported image for the dark theme: it is meant for light documents."],"content":["Label it \"Signature\" or \"Your signature\".","Help text says what signing means in one sentence: \"By signing, you accept the quote.\""],"accessibility":["Draw and Type are a real `tablist`: one tab stop, ArrowLeft/ArrowRight (mirrored in right-to-left text), Home and End move and select; each tab controls its `tabpanel`. The tab list is named by the label (or the element's `aria-label`, else \"How to sign\").","The drawing area is a canvas with `role=\"img\"`, named \"Signature drawing area\" (\"…, signed\" once drawn) and described by the instructions: \"Draw your signature with a mouse, finger or pen. To sign with the keyboard, choose Type.\" Its panel takes focus so screen reader users hear this.","Type is the keyboard and screen reader path: a text box named \"<label>: Type your full name\", with `autocomplete=\"name\"`.","Undo (\"Undo last stroke\") and Clear (\"Clear signature\") are native buttons, disabled while there is nothing to undo or clear; when the one with focus becomes disabled, focus moves to the selected tab (or the text box). \"Last stroke removed\" and \"Signature cleared\" are announced in a polite status region.","Ink is `text-default` on `bg-surface` (AA in both themes); the pad outline is `border-input`, critical with an `error`. The exported image is always black on transparent.","Form-associated like Text field: `required` gives \"Please sign here.\", `error` sets a custom error (announced, `aria-invalid` on the text box), a disabled `<fieldset>` disables it, `form.reset()` clears it.","`touch-action: none` on the canvas, so drawing on a phone doesn't scroll the page. Only the first finger draws; right-clicks are ignored.","No Figma design exists for this component; it follows the Text field and Status tabs styles."],"responsive":["Fills the width of its container; the pad keeps a 3:1 shape (about 96px tall in a 288px column, 200px at 600px).","When the pad is resized (rotating a phone, a panel opening) the signature is drawn again from its strokes at the new size, so it stays sharp and in place.","Draw / Type and Undo / Clear share one row and wrap onto two when they don't fit."],"related":["text-field","modal","file-upload"]},{"tag":"cm-option-group","slug":"option-group","name":"Option group","react":"OptionGroup","group":"Forms","summary":"Switches a form between a few types, with one always selected.","lead":"A row of 36px outlined buttons under a field-style label. The selected one is black. It works like a radio group, so it suits choices that change which fields follow, such as the offer type.","docs_url":"https://commmerce.com/commmerceui/#components--option-group","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Heading above the options, e.g. \"Select offer type\". Without one, give the element an `aria-label`."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the selected option; empty when nothing is selected."},{"attribute":"options","property":"options","type":"Array<string | OptionGroupOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, tone }`. Used instead of `<option>` children when set."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks every option. Also set by a disabled `<fieldset>`."},{"attribute":"_slotted","property":"_slotted","type":"OptionGroupOption[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"OptionGroupOption[]","description":"The options in use, normalised."}],"methods":[{"name":"focus","description":"Focuses the selected option, or the first one."}],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements. `disabled`, `selected` and `tone` (`success`, `critical`) are honoured."}],"events":[{"name":"input","description":"Same moment as `change`."},{"name":"change","description":"When the merchant picks a different option."}],"parts":[],"examples":[{"title":"Offer type","html":"<cm-option-group name=\"offer\" label=\"Select offer type\">\n <option value=\"orders\" selected>Orders over</option>\n <option value=\"categories\">Categories</option>\n <option value=\"product\">Specific product</option>\n <option value=\"product-group\">Product group</option>\n <option value=\"customer-group\">Customer group</option>\n</cm-option-group>"},{"title":"Without a heading","description":"When the card title already asks the question, name the group with `aria-label`.","html":"<cm-option-group name=\"discount\" aria-label=\"Discount type\">\n <option value=\"percent\" selected>Percentage</option>\n <option value=\"flat\">Flat amount</option>\n</cm-option-group>"},{"title":"Visit outcome (tones)","description":"Since 1.3. `tone=\"success\"` or `tone=\"critical\"` on an option (or `tone` in `options`) colours it by the outcome it records, with the same colours as Button tones: outlined in the tone, filled in it once selected. The label still says what it means; use tones only for clearly good or bad outcomes and leave the rest plain.","html":"<cm-option-group name=\"outcome\" label=\"Visit outcome\">\n <option value=\"pitched\">Pitched</option>\n <option value=\"demo\">Demo done</option>\n <option value=\"signed_up\" tone=\"success\">Signed up</option>\n <option value=\"not_interested\" tone=\"critical\">Not interested</option>\n <option value=\"later\">Visit again later</option>\n</cm-option-group>"},{"title":"Disabled option","html":"<cm-option-group name=\"delivery\" label=\"Delivery\">\n <option value=\"ship\" selected>Ship to customer</option>\n <option value=\"pickup\">Store pickup</option>\n <option value=\"local\" disabled>Local delivery</option>\n</cm-option-group>"}],"do":["Use it for two to six short options that switch what the rest of the form asks.","Pre-select the most common option, so one is always selected.","Keep labels to one to three words so the row fits."],"dont":["Don't use it for actions: use buttons.","Don't use it to filter a list or switch a view: use a Segmented control or Status tabs.","Don't use it for long or many options: use a select."],"content":["The heading asks the question: \"Select offer type\".","Option labels are short nouns in sentence case."],"accessibility":["A `radiogroup` of `radio` buttons named by the heading.","Tones (since 1.3) never carry meaning on their own: the label says what the outcome is, and selected options are filled while the others are outlined, in every tone. They use the same token pairs as Button tones (4.5:1 or more for text, 3:1 for outlines, in light and dark); disabled options look the same with or without a tone.","One tab stop on the selected option; arrow keys move and select (skipping disabled options, wrapping at the ends), Home and End jump, Space or Enter selects.","Form-associated: submits the selected `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice.","Unselected options are white with a `border-input` outline (3:1 or more), like fields. On phones the buttons wrap; use a `cm-select` yourself if a phone layout needs one row."],"responsive":["Options wrap onto more lines when they don't fit.","Options are 36px tall with 14px text and 8px apart at every width; on touch screens they are 44px tall."],"related":["radio","select","segmented-control"]},{"tag":"cm-segmented-control","slug":"segmented-control","name":"Segmented control","react":"SegmentedControl","group":"Forms","summary":"Switches between two to four views or filters of the same content, right away.","lead":"Two to four options side by side in one grey track; the selected one is white with an outline. Use it for view switches such as Open / Done or Board / List, where picking an option changes what is shown at once. It is an Option group with a compact look, so it has the same keyboard, events and form behaviour. Two sizes: `default` 36px, the height of buttons beside it, and `small` 32px for toolbars, filter rows and card headers. Since 1.5.","docs_url":"https://commmerce.com/commmerceui/#components--segmented-control","properties":[{"attribute":"size","property":"size","type":"'default' | 'small'","default":"'default'","description":"`default`: a 36px track, the height of buttons and fields beside it. `small`: 32px, for toolbars, filter rows and\ncard headers next to small fields and slim buttons. On touch screens both are 44px tall."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Heading above the options, e.g. \"Select offer type\". Without one, give the element an `aria-label`."},{"attribute":"name","property":"name","type":"string","default":"''","description":"Form field name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the selected option; empty when nothing is selected."},{"attribute":"options","property":"options","type":"Array<string | OptionGroupOption>","default":"[]","description":"Options as strings or `{ value, label, disabled, tone }`. Used instead of `<option>` children when set."},{"attribute":"required","property":"required","type":"boolean","default":"false","description":"The form will not submit until an option is chosen."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks every option. Also set by a disabled `<fieldset>`."},{"attribute":"_slotted","property":"_slotted","type":"OptionGroupOption[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"OptionGroupOption[]","description":"The options in use, normalised."}],"methods":[{"name":"focus","description":"Focuses the selected option, or the first one."}],"slots":[{"name":"(default)","description":"`<option value=\"…\">Label</option>` elements. `disabled` and `selected` are honoured."}],"events":[{"name":"change","description":"When the merchant picks a different option."},{"name":"input","description":"Same moment as `change`."}],"parts":[],"examples":[{"title":"Open / Done","description":"A filter at the top of a task list. Name the control with `aria-label` when nothing visible labels it.","html":"<cm-segmented-control name=\"state\" aria-label=\"Tasks\" size=\"small\" value=\"open\">\n <option value=\"open\">Open</option>\n <option value=\"done\">Done</option>\n</cm-segmented-control>"},{"title":"Board / List","description":"A view switch. Listen for `change` and swap the view; `value` is the selected option.","html":"<div class=\"stack\">\n <cm-segmented-control aria-label=\"View\" value=\"board\" onchange=\"this.nextElementSibling.textContent = this.value === 'board' ? 'Showing the board' : 'Showing the list'\">\n <option value=\"board\">Board</option>\n <option value=\"list\">List</option>\n </cm-segmented-control>\n <p style=\"margin:0\">Showing the board</p>\n</div>"},{"title":"In a toolbar","description":"With `size=\"small\"` it lines up with a small search, small selects and slim buttons (all 32px).","html":"<div style=\"display:flex;flex-wrap:wrap;gap:8px;align-items:center\">\n <cm-search size=\"small\" label=\"Search deals\" placeholder=\"Search deals\" style=\"flex:1 1 200px;min-width:0\"></cm-search>\n <cm-select size=\"small\" aria-label=\"Owner\" placeholder=\"Owner\"><option value=\"me\">Me</option><option value=\"team\">My team</option></cm-select>\n <cm-segmented-control size=\"small\" aria-label=\"View\" value=\"board\">\n <option value=\"board\">Board</option>\n <option value=\"list\">List</option>\n </cm-segmented-control>\n</div>"},{"title":"With a label","description":"`label` shows a field-style label above the track and names the group.","html":"<cm-segmented-control name=\"period\" label=\"Show\" value=\"week\">\n <option value=\"day\">Day</option>\n <option value=\"week\">Week</option>\n <option value=\"month\">Month</option>\n</cm-segmented-control>"}],"do":["Use it for two to four short options that change what is shown right away, with no Save button.","Always have one option selected: set `value` or mark an `<option selected>`.","Keep the same order everywhere the same switch appears."],"dont":["Don't use it for a setting that is saved with a form: use an Option group.","Don't use it for five or more choices: use a Select.","Don't use it to move between pages or sections with their own address: use Link tabs or Status tabs.","Don't mix it with actions: every option is a view, not a command."],"content":["One or two words per option, in sentence case: \"Open\", \"Done\", \"Board\", \"List\".","Write a text label on every option; don't use icons alone.","Options are parallel: all nouns or all states."],"accessibility":["A `radiogroup` of `radio` buttons named by `label` or the element's `aria-label`.","One tab stop on the selected option; arrow keys move and select (skipping disabled options and wrapping; mirrored in right-to-left text), Home and End jump, Space or Enter selects. Each new choice fires `input` and `change`.","The selected option is shown by a white fill, a `border-input` outline (3:1 or more) and dark text, not by colour alone; unselected options are `text-tertiary` (4.5:1 or more).","At least 44px tall on touch screens (`pointer: coarse`).","Form-associated: submits the selected `value` under `name`, `required` blocks submission, and `form.reset()` restores the initial choice. Built-in text is in its own `segmentedControl` namespace.","Disabled options use `text-secondary`, the disabled text colour, which is below 4.5:1 by design (about 3.2:1 in dark). WCAG 1.4.3 exempts disabled controls, and screen readers announce the option as unavailable (it is a disabled native button). Don't use `text-secondary` for anything a merchant needs to read."],"responsive":["The track is as wide as its options and never wider than its container; a long label is cut short with an ellipsis rather than pushing the page wider.","On touch screens the track is 44px tall at either size."],"related":["option-group","status-tabs","link-tabs","select"]},{"tag":"cm-tag","slug":"tag","name":"Tag","react":"Tag","group":"Forms","summary":"Shows a product tag or an applied filter, with an optional remove button.","lead":"A 24px pill with 12px text and an outline. Removable tags have a small circled × that fires `cm-remove`; your code takes the tag out of the list, for example `tag.addEventListener('cm-remove', () => tag.remove())`, and moves focus to the next tag.","docs_url":"https://commmerce.com/commmerceui/#components--tag","properties":[{"attribute":"removable","property":"removable","type":"boolean","default":"false","description":"Shows the remove button."},{"attribute":"remove-label","property":"removeLabel","type":"string","default":"''","description":"Accessible name of the remove button. Defaults to \"Remove\" plus the tag text."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Hides the remove button's action and dims the tag."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The tag text."}],"events":[{"name":"cm-remove","description":"When the remove button is pressed."}],"parts":[],"examples":[{"title":"Product tags","description":"Tags sit `space-8` apart in both directions.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-tag removable>Karnataka</cm-tag>\n <cm-tag removable>Orange</cm-tag>\n <cm-tag removable>Cotton</cm-tag>\n <cm-tag removable>Summer sale</cm-tag>\n</div>"},{"title":"Applied filters","description":"Name the remove button with what it removes.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-tag removable remove-label=\"Remove filter: Payment status is Paid\">Paid</cm-tag>\n <cm-tag removable remove-label=\"Remove filter: Order type is Store pickup\">Store pickup</cm-tag>\n</div>"},{"title":"Read-only","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-tag>Cotton</cm-tag>\n <cm-tag>Handmade</cm-tag>\n</div>"}],"do":["Keep tag text to one or two words.","After removing a tag, move focus to the next tag or to the field that adds tags, so keyboard users are not lost.","Use `remove-label` when the tag text alone doesn't say what is removed."],"dont":["Don't use tags for status: use a badge.","Don't make tags clickable links; use buttons or links."],"content":["Write tags as the merchant typed them; don't change their case."],"accessibility":["The remove button is a real button, named \"Remove <tag text>\" by default, and reachable with Tab.","Its 20px target, with tags 8px apart, meets the 24px target-spacing rule.","The outline is `border-strong`, which meets 3:1 against the tag fill in both themes."],"responsive":["Tags are 24px tall with a 20px remove button at every width."],"related":["badge","search"]},{"tag":"cm-badge","slug":"badge","name":"Badge","react":"Badge","group":"Feedback","summary":"Shows the status of an order, payment or other object.","lead":"A 24px pill (owner standard, 1.6; 20px in 1.5) with one or two words in sentence case, 12px medium text with tabular numbers. Colour says the kind of status; the words say the status. Since 1.5 the text is shown as written (it used to be upper-cased and letter-spaced).","docs_url":"https://commmerce.com/commmerceui/#components--badge","properties":[{"attribute":"tone","property":"tone","type":"Tone | 'neutral'","default":"'neutral'","description":"Colour and meaning. `neutral` for drafts and other states with no status."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Status text."}],"events":[],"parts":[],"examples":[{"title":"Tones","html":"<div class=\"row\">\n <cm-badge tone=\"information\">Order placed</cm-badge>\n <cm-badge tone=\"success\">Accepted</cm-badge>\n <cm-badge tone=\"critical\">Cancelled</cm-badge>\n <cm-badge tone=\"attention\">New</cm-badge>\n <cm-badge>Draft</cm-badge>\n</div>"},{"title":"Next to a title","description":"Use the card's `title-adornment` slot.","html":"<cm-card heading=\"Order #1042\">\n <cm-badge slot=\"title-adornment\" tone=\"success\">Paid</cm-badge>\n <p style=\"margin:0\">2 items · Rs. 2,340</p>\n</cm-card>"}],"do":["Keep it to one or two words.","Use the same word for the same status everywhere in the admin.","Information is orange and attention is blue in this system: pick the tone by meaning, not by colour."],"dont":["Don't use a badge as a button: it is not interactive.","Don't rely on colour alone: the words must say the status."],"content":["Write in sentence case: \"Order placed\", \"2 h late\". The badge shows the text exactly as written.","Use the state, not an action: \"Paid\", not \"Pay now\"."],"accessibility":["Text colours meet 4.5:1 on their badge fills in both themes.","Not focusable. If the status changes while the page is open, announce it elsewhere (for example with a banner)."],"related":["banner","card"]},{"tag":"cm-card","slug":"card","name":"Card","react":"Card","group":"Layout","summary":"Groups related content and actions into a section of the page.","lead":"The white section container every admin page is built from: flat, with a 1px `border-subtle` edge, 8px corners and no shadow. The heading is 16px semibold, the description 13px grey. Three variants (owner standard, 1.6): `standard` (default) is padded 24px with 16px between header and body, `compact` 16px and 12px (dashboards, task summaries, metrics), and `interactive` makes the whole card a link (`href`) or a button (`cm-action`) with hover, pressed, focus and `selected` states. On phones every card is padded 16px. With `flush` the body starts 8px under the heading, so a list sits right under it.","docs_url":"https://commmerce.com/commmerceui/#components--card","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Card title, rendered as a heading at `heading-level`."},{"attribute":"description","property":"description","type":"string","default":"''","description":"One sentence under the title, 13px in text-tertiary."},{"attribute":"flush","property":"flush","type":"boolean","default":"false","description":"Removes body padding, for lists and tables that run edge to edge."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level for the title, so pages keep a correct outline. Default 2."},{"attribute":"variant","property":"variant","type":"'standard' | 'compact' | 'interactive' | 'interactive compact' | 'compact interactive'","default":"'standard'","description":"`standard` (default: 24px padding), `compact` (16px padding, for dashboards, task summaries and metrics) or\n`interactive` (the whole card is a link or button, with hover, pressed, focus and selected states). Combine\nwith a space, e.g. `interactive compact`. Phones always get 16px padding. Since 1.6."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Interactive cards: the address the card opens. Without it the card is a button that fires `cm-action`. Since 1.6."},{"attribute":"target","property":"target","type":"string","default":"''","description":"Link target when `href` is set. `_blank` adds `rel=\"noopener noreferrer\"`. Since 1.6."},{"attribute":"selected","property":"selected","type":"boolean","default":"false","description":"Interactive cards: shows the card as chosen (a 2px dark outline). A button card reports it as pressed, a link card as the current one. Since 1.6."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Interactive cards without a `heading`: the accessible name of the card's link or button. Since 1.6."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Body."},{"name":"actions","description":"Header actions (buttons, links), at the end of the header. Since 1.3 they also show on a card with no `heading` or `description`, in a row of their own at the top of the card."},{"name":"title-adornment","description":"Badge or icon next to the title."}],"events":[{"name":"cm-action","description":"An interactive card without `href` was pressed (click, Enter or Space). Not fired by the header actions. Since 1.6."}],"parts":[],"examples":[{"title":"Basic","html":"<cm-card heading=\"Pricing\">\n <div class=\"stack\">\n <cm-text-field label=\"Price\" hint=\"rs.\" type=\"number\" value=\"1299\"></cm-text-field>\n <cm-text-field label=\"Compare-at price\" hint=\"rs.\" type=\"number\"></cm-text-field>\n </div>\n</cm-card>"},{"title":"Description and actions","html":"<cm-card heading=\"Shipping\" description=\"How this product is weighed and shipped.\">\n <cm-button slot=\"actions\" size=\"slim\">Edit</cm-button>\n <p style=\"margin:0\">0.4 kg · Ships from Bengaluru warehouse</p>\n</cm-card>"},{"title":"Badges next to the heading","description":"Put counts or a status in the `title-adornment` slot. On a narrow card (try a phone) the badges move under the heading so it is never squeezed, and the actions move under the title only if the heading would have less than about 12 characters of room.","html":"<cm-card heading=\"Partner tasks\" heading-level=\"3\" style=\"max-width:390px\">\n <cm-badge slot=\"title-adornment\" tone=\"critical\">1 overdue</cm-badge>\n <cm-badge slot=\"title-adornment\" tone=\"attention\">2 today</cm-badge>\n <cm-badge slot=\"title-adornment\">4 later</cm-badge>\n <cm-button slot=\"actions\" size=\"slim\">View all</cm-button>\n <p style=\"margin:0\">Call back Priya S. about the bulk order</p>\n</cm-card>"},{"title":"Compact","description":"`variant=\"compact\"`: 16px padding, for dashboards, task summaries and metrics. Since 1.6.","html":"<div class=\"row\" style=\"align-items:stretch\">\n <cm-card variant=\"compact\" heading=\"Due today\" style=\"flex:1 1 160px\"><cm-metric label=\"Open\" value=\"12\"></cm-metric></cm-card>\n <cm-card variant=\"compact\" heading=\"Overdue\" style=\"flex:1 1 160px\"><cm-metric label=\"Open\" value=\"3\"></cm-metric></cm-card>\n</div>"},{"title":"Interactive","description":"`variant=\"interactive\"`: the whole card opens something. With `href` the heading is a link stretched over the card; without it the card is a button that fires `cm-action` (Enter and Space work too). `selected` draws a 2px outline and is announced (pressed for a button card, current for a link card). Header actions stay separately clickable; keep other controls out of the body. Combine with compact: `variant=\"interactive compact\"`. Since 1.6.","html":"<div class=\"row\" style=\"align-items:stretch\">\n <cm-card variant=\"interactive compact\" heading=\"Monthly plan\" selected style=\"flex:1 1 180px\">Rs. 499 a month</cm-card>\n <cm-card variant=\"interactive compact\" heading=\"Yearly plan\" style=\"flex:1 1 180px\">Rs. 4,990 a year</cm-card>\n <cm-card variant=\"interactive compact\" heading=\"Renewals\" href=\"#/components/card\" style=\"flex:1 1 180px\">8 renewals this month</cm-card>\n</div>"},{"title":"Flush","description":"`flush` removes the body padding for lists and tables that run edge to edge.","html":"<cm-card heading=\"Recent orders\" flush>\n <ul style=\"list-style:none;margin:0;padding:0\">\n <li style=\"display:flex;justify-content:space-between;padding:12px 20px;border-top:1px solid var(--cm-border-subtle)\">#1042 · Priya S. <cm-badge tone=\"success\">Paid</cm-badge></li>\n <li style=\"display:flex;justify-content:space-between;padding:12px 20px;border-top:1px solid var(--cm-border-subtle)\">#1041 · Rahul M. <cm-badge tone=\"information\">Order placed</cm-badge></li>\n </ul>\n</cm-card>"},{"title":"Actions without a heading","description":"Since 1.3, the `actions` slot also shows on a card with no `heading` or `description`: the actions sit in a row of their own at the top, at the end. (Before 1.3 they were not shown at all.) With a heading, the header is unchanged.","html":"<cm-card style=\"max-width:480px\">\n <cm-button slot=\"actions\" size=\"slim\">Edit shipping</cm-button>\n <p style=\"margin:0\">0.4 kg · Ships from Bengaluru warehouse</p>\n</cm-card>"}],"do":["Give every card a heading unless it is the only thing on the page.","Set `heading-level` so the page outline makes sense (2 under the page title, 3 inside a section).","Stack cards `space-24` apart (the `cm-layout-section` default since 1.6).","Use `variant=\"compact\"` for dashboard tiles and summaries, the standard card for forms and details."],"dont":["Don't nest cards inside cards: use `bg-inset` panels instead.","Don't put more than two actions in the header."],"content":["Headings are short nouns: \"Pricing\", \"Shipping\", \"Variants\".","The description is one sentence in plain language."],"accessibility":["The heading is exposed with `role=\"heading\"` and `aria-level`, so screen-reader users can jump between cards.","The card is a labelled region named by its heading. An interactive card is not a region: it is one link or button, named by its heading (or `label` when it has none), with a 2px focus ring around the whole card.","A card without a heading is not a named region: if its actions need context (\"Edit\" what?), name them, e.g. `aria-label=\"Edit shipping\"` on the button."],"responsive":["Follows the card's own width, not the window. When the heading and its `title-adornment` don't fit on one line, the adornment moves under the heading instead of squeezing it (since 1.2).","The header actions stay beside the title while the heading keeps about 12 characters of room (or its whole text, if shorter); below that they move under the title. Wide cards keep everything on one row."],"related":["badge","button"]},{"tag":"cm-page","slug":"page","name":"Page","react":"Page","group":"Layout","summary":"Wraps a whole admin page: the page header, then the content on the page background.","lead":"The outermost element of a screen. The page header runs edge to edge across the top; the content sits on `bg-page` with `space-24` padding (`space-16` when the page is 640px wide or less), so it lines up with the page header's title, centred at the width you choose with `width`. Inside `cm-app-frame panel` the background is transparent, so the page sits on the white panel.","docs_url":"https://commmerce.com/commmerceui/#components--page","properties":[{"attribute":"width","property":"width","type":"'' | 'form' | 'detail' | 'wide' | 'full'","default":"''","description":"Largest width of the content, centred: `form` (640px), `detail` (1040px), `wide` (1600px) or `full` (no limit).\nEmpty is `wide`, unless `narrow` or `full-width` is set."},{"attribute":"full-width","property":"fullWidth","type":"boolean","default":"false","description":"Same as `width=\"full\"`: the content uses every pixel of width (wide tables, reports)."},{"attribute":"narrow","property":"narrow","type":"boolean","default":"false","description":"Content at most 800px wide, centred. Kept from 1.0; prefer `width=\"form\"` (640px) or `width=\"detail\"` (1040px)."}],"script_properties":[],"methods":[],"slots":[{"name":"header","description":"A `cm-page-header`. Runs edge to edge."},{"name":"(default)","description":"The page content, usually a `cm-layout`."},{"name":"footer","description":"A `cm-save-bar` or `cm-action-bar`, after the content."}],"events":[],"parts":[],"examples":[{"title":"Page anatomy","description":"Every page has the same order: the header (the title, with the primary action at the end), then a filter or toolbar row, then the content. Pick the width by what the page holds: `width=\"form\"` (640px) for settings and single-column forms, `width=\"detail\"` (1040px) for one record such as an order or a customer, the default `wide` (1600px) for lists and dashboards, and `width=\"full\"` for wide tables and reports.","html":"<cm-page width=\"detail\">\n <cm-page-header slot=\"header\" heading=\"Orders\">\n <cm-button slot=\"actions\" variant=\"primary\">Create order</cm-button>\n </cm-page-header>\n <cm-status-tabs aria-label=\"Order status\" style=\"margin-bottom:var(--cm-space-16)\">\n <option value=\"all\" count=\"233\">All</option>\n <option value=\"open\" count=\"23\" selected>Open</option>\n <option value=\"done\" count=\"210\">Done</option>\n </cm-status-tabs>\n <cm-card heading=\"Open orders\" flush>\n <cm-resource-list selectable resource-name=\"order\">\n <cm-resource-item value=\"o1\">#1042 · Priya S.</cm-resource-item>\n <cm-resource-item value=\"o2\">#1041 · Rahul M.</cm-resource-item>\n </cm-resource-list>\n </cm-card>\n</cm-page>"},{"title":"Detail page","description":"Page header, then a layout with a main and a side column. This is the shape of every detail page. The columns stack here because the example frame is narrower than 768px.","html":"<cm-page>\n <cm-page-header slot=\"header\" heading=\"Order #1042\" breadcrumbs='[{\"label\":\"Orders\",\"href\":\"#/components/page\"}]'>\n <cm-button slot=\"actions\" variant=\"primary\">Fulfil items</cm-button>\n </cm-page-header>\n <cm-layout>\n <cm-layout-section variant=\"two-thirds\">\n <cm-card heading=\"Items\">2 items · Rs. 2,340</cm-card>\n <cm-card heading=\"Payment\">Paid by UPI</cm-card>\n </cm-layout-section>\n <cm-layout-section variant=\"one-third\">\n <cm-card heading=\"Customer\">Priya S.</cm-card>\n </cm-layout-section>\n </cm-layout>\n</cm-page>"},{"title":"Form width","description":"`width=\"form\"` keeps settings and single-column forms at a readable 640px.","html":"<cm-page width=\"form\">\n <cm-page-header slot=\"header\" heading=\"Store details\"></cm-page-header>\n <cm-card heading=\"Contact\">\n <cm-stack>\n <cm-text-field label=\"Store name\" value=\"Ananya Handlooms\"></cm-text-field>\n <cm-text-field label=\"Support email\" type=\"email\"></cm-text-field>\n </cm-stack>\n </cm-card>\n</cm-page>"}],"do":["Use one `cm-page` per screen, with one page header.","Set `width`: `form` for settings forms, `detail` for one record, `full` for wide tables and reports; leave it empty for lists and dashboards.","Put a save bar or action bar in the `footer` slot, or anywhere on the page: both stick to the bottom."],"dont":["Don't add your own page padding or background around it.","Inside the admin, don't add a header bar or side navigation: the admin draws them around your app."],"content":["The page title in the header names the record or list: \"Order #1042\", \"Products\"."],"accessibility":["Put the page header first so the page title is the first heading.","The content keeps its source order on every width."],"responsive":["Content is centred, at most as wide as `width` says: `form` 640px, `detail` 1040px, `wide` (the default) 1600px, `full` no limit. `narrow` (800px) and `full-width` from 1.0 still work.","Follows the page's own width, not the window: at 640px or narrower the padding around the content drops from `space-24` (24px) to `space-16` (16px)."],"related":["page-header","layout","card"]},{"tag":"cm-layout","slug":"layout","name":"Layout","react":"Layout","group":"Layout","summary":"Arranges a page into columns: a main column and a side column, halves, or full-width rows.","lead":"A six-track grid of `cm-layout-section`s: `two-thirds` and `one-third` for detail pages, `one-half` for two equal columns, `full` (default) across the page. Sections are 24px apart and each stacks its cards `space-24` apart (owner standard, 1.6; was `space-20`). When the layout itself is narrower than 768px, every section goes full width, in source order. `variant=\"record\"` (since 1.7) is the standard record page: a main column and a 320px `aside` section, see Record page.","docs_url":"https://commmerce.com/commmerceui/#components--layout","properties":[{"attribute":"gap","property":"gap","type":"SpaceStep","default":"'24'","description":"Space between sections, across and down: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `24` (owner standard, 1.6: 24px between page sections; was 20).\nIn a record layout the default `24` becomes `16` once the layout is 640px wide or less."},{"attribute":"variant","property":"variant","type":"'default' | 'record' | 'sidebar'","default":"'default'","description":"`default`: a six-track grid for `full`, `one-half`, `one-third` and `two-thirds` sections.\n`record` (since 1.7): a main column and a 320px `aside` section on the end side from 880px (a 1280px laptop window with the side navigation gives about 950px); see the element description."},{"attribute":"aside-position","property":"asidePosition","type":"'above' | 'below'","default":"'above'","description":"Record layout: where the aside goes once the columns stack (below 880px), `above` the main content (default) or `below` it. Since 1.7."},{"attribute":"sticky-aside","property":"stickyAside","type":"boolean","default":"false","description":"Record layout: the aside stays in view below the header while the main column scrolls, as long as the whole aside\nfits in the window (a taller aside scrolls with the page, so nothing in it is out of reach). Only while the\ncolumns are side by side. Since 1.7."}],"script_properties":[{"property":"asideSticks","description":"Whether the aside currently sticks (`sticky-aside` is on and the whole aside fits in the window). For tests and debugging."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-layout-section` elements."}],"events":[],"parts":[{"tag":"cm-layout-section","react":"LayoutSection","properties":[{"attribute":"variant","property":"variant","type":"'full' | 'one-half' | 'one-third' | 'two-thirds' | 'aside' | 'sidebar'","default":"'full'","description":"Width on wide layouts: `full` (default), `one-half`, `one-third` or `two-thirds`. A detail page is a\n`two-thirds` main section and a `one-third` side section. Every section is full width once the layout stacks.\n`aside` (since 1.7) is the 320px side column of a `cm-layout variant=\"record\"`; in other layouts it is `one-third`.\n`sidebar` (since 1.8.2) is the 240px start column of a `cm-layout variant=\"sidebar\"`."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The section's content, usually cards."}],"events":[]}],"examples":[{"title":"Main and side columns","html":"<cm-layout>\n <cm-layout-section variant=\"two-thirds\">\n <cm-card heading=\"Details\">Title, description</cm-card>\n <cm-card heading=\"Pricing\">Price, compare-at price</cm-card>\n </cm-layout-section>\n <cm-layout-section variant=\"one-third\">\n <cm-card heading=\"Status\">Active</cm-card>\n </cm-layout-section>\n</cm-layout>"},{"title":"Halves, then a full row","html":"<cm-layout>\n <cm-layout-section variant=\"one-half\"><cm-card heading=\"Online store\">Rs. 48,200 this week</cm-card></cm-layout-section>\n <cm-layout-section variant=\"one-half\"><cm-card heading=\"Stores\">Rs. 1,12,900 this week</cm-card></cm-layout-section>\n <cm-layout-section><cm-card heading=\"Recent orders\">12 orders today</cm-card></cm-layout-section>\n</cm-layout>"},{"title":"Record page: main column and 320px aside","description":"`variant=\"record\"` with one main section and one `variant=\"aside\"` section. From 880px of the layout's own width the aside is a 320px column on the end side; narrower, it stacks above the main content (`aside-position=\"below\"` puts it under). `sticky-aside` keeps a short aside in view while the main column scrolls. Since 1.7.","html":"<cm-layout variant=\"record\" sticky-aside>\n <cm-layout-section variant=\"aside\">\n <cm-info-panel heading=\"Details\" variant=\"compact\" layout=\"rows\">\n <cm-info-item label=\"Email\"><a href=\"mailto:asha@example.com\">asha@example.com</a></cm-info-item>\n <cm-info-item label=\"Phone\">+91 98450 12345</cm-info-item>\n <cm-info-item label=\"Company\">Rao Textiles</cm-info-item>\n </cm-info-panel>\n </cm-layout-section>\n <cm-layout-section>\n <cm-card heading=\"Activity\">Called on 14 Nov: interested in the Growth plan.</cm-card>\n <cm-card heading=\"Deals\" variant=\"compact\">\n <cm-empty-state size=\"inline\" heading=\"No deals yet\" action=\"Add deal\"></cm-empty-state>\n </cm-card>\n </cm-layout-section>\n</cm-layout>"}],"do":["Put what customers see (details, media, pricing) in the main column and settings and summaries in the side column.","Put the main section first in the source: it comes first when the columns stack.","Fill a row: `two-thirds` + `one-third`, two `one-half`, or one `full`.","Record layout: put the sections in the source in their stacked order: the aside first with the default `aside-position=\"above\"`, the main section first with `below`. On wide layouts the aside moves to the end column wherever it is in the source.","Use `variant=\"record\"` for every record (lead, contact, deal, account, ticket, order, product) so they all look and behave the same."],"dont":["Don't nest layouts: use a grid inside a card for fields side by side.","Don't reorder sections with CSS: keyboard and screen-reader order would no longer match what is seen.","Don't put more than one main and one aside section in a record layout: the aside sits beside the first row only."],"content":[],"accessibility":["Default layouts never change order, so reading and Tab order follow the page on every width.","A record layout moves only the aside, as one block: on wide layouts to the end column, stacked to wherever `aside-position` says. Matching the source order to the stacked order keeps phones (where order matters most) exactly in reading order.","A sticky aside sticks only while it fits in the window, so every part of it can still be scrolled to and nothing is covered at 200% zoom.","The layout adds no landmarks or headings: your cards carry the headings."],"responsive":["Follows the layout's own width, not the window: below 768px every section takes the full width and they stack in source order. From 768px, `one-half`, `one-third` and `two-thirds` sections sit side by side.","`variant=\"record\"`: from 880px of the layout's own width the aside is a 320px column on the end side; narrower, the sections stack with the aside above the main content (or below it with `aside-position=\"below\"`), 24px apart, 16px once the layout is 640px wide or less. Inside a `cm-page` the layout is 48px narrower than the window (32px on phones), so an 880px window stacks; a 1024px window (976px of layout) keeps the aside beside the content."],"related":["page","grid","card"]},{"tag":"cm-stack","slug":"stack","name":"Stack","react":"Stack","group":"Layout","summary":"Spaces items evenly in a column or a row, using the spacing scale.","lead":"A column (default) or a row (`direction=\"inline\"`) of items `gap` apart. `gap` takes a spacing step: `0`, `10`, `12`, `15`, `20` (default), `22` or `30`. Rows can wrap, align and spread their items. The items stay in your page, so your styles and forms work as usual.","docs_url":"https://commmerce.com/commmerceui/#components--stack","properties":[{"attribute":"direction","property":"direction","type":"'block' | 'inline'","default":"'block'","description":"`block` stacks top to bottom; `inline` lays items out in a row (right to left in RTL pages)."},{"attribute":"gap","property":"gap","type":"SpaceStep","default":"'20'","description":"Space between items: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`, the gap between cards."},{"attribute":"align","property":"align","type":"'start' | 'center' | 'end' | 'stretch' | 'baseline' | undefined","description":"Cross-axis alignment. Default `stretch` in a column and `center` in a row."},{"attribute":"justify","property":"justify","type":"'start' | 'center' | 'end' | 'space-between' | undefined","description":"Main-axis distribution. `space-between` pushes the first and last items to the edges."},{"attribute":"wrap","property":"wrap","type":"boolean","default":"false","description":"Lets a row wrap onto more lines when it runs out of space."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The items to stack."}],"events":[],"parts":[],"examples":[{"title":"Fields in a card","description":"`space-16` between fields, as in the product editor.","html":"<cm-card heading=\"Details\" style=\"max-width:520px\">\n <cm-stack gap=\"32\">\n <cm-text-field label=\"Title\" placeholder=\"Short sleeve t-shirt\"></cm-text-field>\n <cm-text-field label=\"Description\" multiline rows=\"3\"></cm-text-field>\n </cm-stack>\n</cm-card>"},{"title":"Buttons in a row","html":"<cm-stack direction=\"inline\" gap=\"8\" wrap>\n <cm-button>Export</cm-button>\n <cm-button>Import</cm-button>\n <cm-button variant=\"primary\">Add product</cm-button>\n</cm-stack>"},{"title":"Spread across a row","html":"<cm-stack direction=\"inline\" justify=\"space-between\">\n <span>Subtotal</span>\n <strong>Rs. 2,340</strong>\n</cm-stack>"}],"do":["Use the default `20` between cards, `30` between fields in a card, `10` between buttons.","Use `wrap` on rows of buttons or tags so they never overflow on phones."],"dont":["Don't add margins to the items: the gap does the spacing.","Don't use a stack for a table-like layout: use a grid."],"content":[],"accessibility":["Order on screen is the order in the source."],"related":["grid","layout"]},{"tag":"cm-grid","slug":"grid","name":"Grid","react":"Grid","group":"Layout","summary":"Puts items in equal columns, for fields side by side, tiles and summary cards.","lead":"`columns` equal columns (default 2) that become one column when the grid is 640px wide or less, or with `min-column-width`, as many columns as fit, each at least that wide. `gap` takes a spacing step (default `20`).","docs_url":"https://commmerce.com/commmerceui/#components--grid","properties":[{"attribute":"columns","property":"columns","type":"number","default":"2","description":"Number of columns. Default 2. Ignored when `min-column-width` is set."},{"attribute":"min-column-width","property":"minColumnWidth","type":"string | undefined","description":"Fit as many columns as there is room for, each at least this wide (a CSS length such as `240px` or `15rem`).\nNever wider than the grid, so it reaches one column on its own on narrow screens."},{"attribute":"gap","property":"gap","type":"SpaceStep","default":"'20'","description":"Space between items: a spacing step on the 4px grid (`0`, `4`, `8`, `12`, `16`, `20`, `24`, `32`, `40`, `48`, `64`; the pre-1.5 steps `10`, `15`, `22` and `30` still work and draw as 8, 16, 24 and 32). Default `20`."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The grid items, in reading order."}],"events":[],"parts":[],"examples":[{"title":"Fields side by side","description":"Two columns while the grid is wider than 640px; one column below that (try Phone).","html":"<cm-card heading=\"Pricing\" style=\"max-width:760px\">\n <cm-grid columns=\"2\">\n <cm-text-field label=\"Price\" hint=\"rs.\" type=\"number\"></cm-text-field>\n <cm-text-field label=\"Compare-at price\" hint=\"rs.\" type=\"number\"></cm-text-field>\n </cm-grid>\n</cm-card>"},{"title":"As many as fit","description":"`min-column-width=\"200px\"`: resize the example to see columns come and go. A row of totals is a grid of Metric tiles.","html":"<cm-grid min-column-width=\"200px\">\n <cm-metric label=\"Orders\" value=\"128\"></cm-metric>\n <cm-metric label=\"Sales\" value=\"Rs. 2,41,000\"></cm-metric>\n <cm-metric label=\"Visitors\" value=\"3420\"></cm-metric>\n <cm-metric label=\"Returns\" value=\"4\"></cm-metric>\n</cm-grid>"}],"do":["Use two columns for pairs of short fields (price and compare-at price, city and PIN code).","Use `min-column-width` for tiles, so the count follows the space."],"dont":["Don't put long text fields side by side: give them the full width.","Don't place a grid inside a horizontal stack: it needs a width to work out its columns."],"content":[],"accessibility":["Items read left to right, then down, the same as the source order."],"responsive":["Follows the grid's own width, not the window: with `columns`, a grid 640px wide or narrower shows one column.","With `min-column-width`, it fits as many columns of at least that width as there is room for (never wider than the grid itself), at any width."],"related":["stack","layout","metric"]},{"tag":"cm-banner","slug":"banner","name":"Banner","react":"Banner","group":"Feedback","summary":"Tells merchants about something important on the page or in their store.","lead":"A full-width message with a tone, an optional heading and actions. Critical banners are announced immediately.","docs_url":"https://commmerce.com/commmerceui/#components--banner","properties":[{"attribute":"tone","property":"tone","type":"Tone","default":"'attention'","description":"attention = blue, information = orange, success = green, critical = red."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Bold first line. Leave empty for one-line banners."},{"attribute":"dismissible","property":"dismissible","type":"boolean","default":"false","description":"Shows a close button. Use for messages the merchant can act on later."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Message body."},{"name":"actions","description":"Buttons or links under the message."}],"events":[{"name":"cm-dismiss","description":"When the close button is pressed (cancelable; default hides the banner)."}],"parts":[],"examples":[{"title":"Tones","html":"<div class=\"stack\" style=\"gap:var(--cm-space-12)\">\n <cm-banner tone=\"attention\" heading=\"Your store is in test mode\">Orders placed now won't be charged.</cm-banner>\n <cm-banner tone=\"information\">GST rates changed on 1 Nov. Check your tax settings.</cm-banner>\n <cm-banner tone=\"success\">Product saved.</cm-banner>\n <cm-banner tone=\"critical\" heading=\"Payment failed\">The card was declined. Ask the customer for another payment method.</cm-banner>\n</div>"},{"title":"With actions","html":"<cm-banner tone=\"attention\" heading=\"Connect a payment provider\">\n You need one before customers can check out.\n <cm-button slot=\"actions\" variant=\"primary\" size=\"slim\">Set up payments</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Learn more</cm-button>\n</cm-banner>"},{"title":"Dismissible","description":"Fires `cm-dismiss`. Call `preventDefault()` on it to keep the banner open, for example to confirm first.","html":"<cm-banner tone=\"information\" dismissible>Your plan renews on 1 Dec.</cm-banner>"}],"do":["Put page-level banners at the top of the page, under the title.","Lead with what happened, then what to do.","Use `critical` only when something has failed or needs action now."],"dont":["Don't stack more than two banners: prioritise.","Don't use a banner for a passing confirmation that needs no action; use an App Bridge toast (`app.toast.show`) when your app runs in the admin."],"content":["Headings are a short statement: \"Payment failed\", not \"Error!\".","Body copy is one or two sentences.","Action labels follow the button rules."],"accessibility":["`critical` uses `role=\"alert\"` and interrupts the screen reader; other tones use `role=\"status\"`.","The dismiss button has an accessible name (\"Dismiss\") and a focus ring.","Text on every banner fill meets 4.5:1 in both themes."],"related":["badge","button"]},{"tag":"cm-icon","slug":"icon","name":"Icon","react":"Icon","group":"Images and icons","summary":"Draws one of the Commmerce line icons.","lead":"Icons inherit the text colour and are decorative unless you give them a label.","docs_url":"https://commmerce.com/commmerceui/#components--icon","properties":[{"attribute":"name","property":"name","type":"IconName","default":"'more'","description":"Icon from"},{"attribute":"size","property":"size","type":"number","default":"18","description":"Pixel size. Header icons are 18, buttons 16."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name. Leave empty when the icon sits next to text that says the same thing."},{"attribute":"mirror","property":"mirror","type":"'auto' | 'always' | 'never'","default":"'auto'","description":"Mirroring in right-to-left text: `auto` mirrors only directional icons, `never` keeps any icon as drawn, `always` mirrors any icon."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Basic","html":"<div class=\"row\">\n <cm-icon name=\"home\"></cm-icon><cm-icon name=\"cart\"></cm-icon><cm-icon name=\"box\"></cm-icon><cm-icon name=\"users\"></cm-icon><cm-icon name=\"chart\"></cm-icon><cm-icon name=\"settings\"></cm-icon>\n</div>"},{"title":"Sizes","description":"Three sizes: 16px inside controls (buttons, fields, menu items), 20px in navigation, 24px for feature icons on their own (empty states, tiles). The tokens are `--cm-icon-size-sm`, `-md` and `-lg`.","html":"<div class=\"row\"><cm-icon name=\"bell\" size=\"16\"></cm-icon><cm-icon name=\"bell\" size=\"18\"></cm-icon><cm-icon name=\"bell\" size=\"24\"></cm-icon><cm-icon name=\"bell\" size=\"32\"></cm-icon></div>"},{"title":"Colour","description":"Set `color` on the icon or its parent. Use the icon tokens.","html":"<div class=\"row\">\n <cm-icon name=\"check-circle\" size=\"24\" style=\"color:var(--cm-icon-success)\"></cm-icon>\n <cm-icon name=\"x-circle\" size=\"24\" style=\"color:var(--cm-icon-critical)\"></cm-icon>\n <cm-icon name=\"clock\" size=\"24\" style=\"color:var(--cm-icon-default)\"></cm-icon>\n</div>"},{"title":"Meaningful icon","description":"When the icon is the only thing that carries the meaning, give it a `label`.","html":"<span style=\"display:inline-flex;align-items:center;gap:8px\">Stock <cm-icon name=\"alert\" label=\"Low stock\" style=\"color:var(--cm-icon-critical)\"></cm-icon></span>"}],"do":["Pair icons with text in navigation and buttons.","Use the same icon for the same thing everywhere."],"dont":["Don't use icons from other sets next to these: stroke weights won't match.","Don't resize below 16px."],"content":["A `label` describes meaning, not the picture: \"Low stock\", not \"Warning triangle\"."],"accessibility":["Hidden from screen readers by default (`aria-hidden`).","With `label`, exposed as an image with that name.","Meaningful icons use colours with at least 3:1 contrast (`icon-default` is 3.4:1)."],"related":["button","avatar","thumbnail"]},{"tag":"cm-avatar","slug":"avatar","name":"Avatar","react":"Avatar","group":"Images and icons","summary":"Shows a person or a store as a photo or their initials.","lead":"Round for people, square for stores. Without a photo it shows the initials of `name` on the avatar green, and without a name a person or store icon.","docs_url":"https://commmerce.com/commmerceui/#components--avatar","properties":[{"attribute":"name","property":"name","type":"string","default":"''","description":"Who or what it shows. Used for the initials and as the accessible name."},{"attribute":"src","property":"src","type":"string","default":"''","description":"Photo or logo URL. Shown cropped to fill the avatar."},{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"`small` 24px, `medium` 36px, `large` 48px. Set `--cm-avatar-size` for any other size."},{"attribute":"shape","property":"shape","type":"'round' | 'square'","default":"'round'","description":"`round` for people, `square` for stores and businesses."},{"attribute":"decorative","property":"decorative","type":"boolean","default":"false","description":"Hides it from screen readers. Use when the name is written right next to the avatar."},{"attribute":"_failed","property":"_failed","type":"boolean","default":"false"}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"People","html":"<div class=\"row\">\n <cm-avatar name=\"Asha Rao\" size=\"small\"></cm-avatar>\n <cm-avatar name=\"Asha Rao\"></cm-avatar>\n <cm-avatar name=\"Asha Rao\" size=\"large\"></cm-avatar>\n <cm-avatar></cm-avatar>\n</div>"},{"title":"Stores","description":"`shape=\"square\"` for stores and businesses.","html":"<div class=\"row\">\n <cm-avatar shape=\"square\" name=\"Indiranagar store\"></cm-avatar>\n <cm-avatar shape=\"square\"></cm-avatar>\n</div>"},{"title":"Next to the name","description":"When the name is written beside it, mark the avatar `decorative` so screen readers don't hear the name twice.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-avatar name=\"Rahul Mehta\" decorative></cm-avatar>\n <span>Rahul Mehta · Store manager</span>\n</div>"}],"do":["Use the person's full name, so the initials and the accessible name are right.","Use square avatars for stores, round ones for people."],"dont":["Don't use an avatar for products: use a thumbnail.","Don't make the avatar the only way to tell people apart in a list: show the name too."],"content":["Pass the name as the merchant entered it; the avatar takes the first letters of the first and last word."],"accessibility":["An image named after `name`, unless `decorative` (then hidden).","Initials are dark text on `avatar-bg` (AA in both themes).","Without a name it is hidden from screen readers: give it a name if it carries meaning."],"related":["thumbnail","header-bar"]},{"tag":"cm-thumbnail","slug":"thumbnail","name":"Thumbnail","react":"Thumbnail","group":"Images and icons","summary":"Shows a small product or file image in a fixed square.","lead":"The whole image fits the box (never cropped) on a grey backdrop, so product photos of any shape line up in lists. Without an image, or when it fails to load, it shows a placeholder.","docs_url":"https://commmerce.com/commmerceui/#components--thumbnail","properties":[{"attribute":"src","property":"src","type":"string","default":"''","description":"Image URL."},{"attribute":"alt","property":"alt","type":"string","default":"''","description":"What the image shows, e.g. \"Blue cotton kurta, front\". Leave empty when the product name is written next to\nthe thumbnail: the image is then decorative."},{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"`small` 40px, `medium` 60px, `large` 80px. Set `--cm-thumbnail-size` for any other size."},{"attribute":"loading","property":"loading","type":"'eager' | 'lazy'","default":"'eager'","description":"`lazy` waits until the thumbnail is near the screen: use it in long lists."},{"attribute":"_failed","property":"_failed","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Sizes","description":"40px in dense lists, 60px in resource lists, 80px on detail pages.","html":"<div class=\"row\">\n <cm-thumbnail size=\"small\" alt=\"\" src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Crect width='40' height='60' rx='6' fill='%23327EC2'/%3E%3C/svg%3E\"></cm-thumbnail>\n <cm-thumbnail alt=\"\" src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Crect width='40' height='60' rx='6' fill='%23327EC2'/%3E%3C/svg%3E\"></cm-thumbnail>\n <cm-thumbnail size=\"large\" alt=\"\" src=\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 60'%3E%3Crect width='40' height='60' rx='6' fill='%23327EC2'/%3E%3C/svg%3E\"></cm-thumbnail>\n</div>"},{"title":"In a list","description":"Next to the product name, the image is decorative: leave `alt` empty. Use `loading=\"lazy\"` in long lists.","html":"<div class=\"row\" style=\"gap:var(--cm-space-8)\">\n <cm-thumbnail size=\"small\" loading=\"lazy\"></cm-thumbnail>\n <span>Blue cotton kurta · 12 in stock</span>\n</div>"}],"do":["Describe what the image shows in `alt` when nothing next to it does: \"Blue cotton kurta, front\".","Keep every thumbnail in one list the same size."],"dont":["Don't use a thumbnail for people or stores: use an avatar.","Don't write \"image of\" in `alt`."],"content":["Write `alt` as a short phrase in sentence case, without a full stop."],"accessibility":["An empty `alt` makes the image decorative.","The placeholder icon is decorative; the box is named from `alt` when it has one."],"related":["avatar","resource-list"]},{"tag":"cm-tooltip","slug":"tooltip","name":"Tooltip","react":"Tooltip","group":"Overlays","summary":"Explains a control in a few words when it is hovered or focused.","lead":"A small dark label next to one control: 12px white text on `bg-panel-header`, 8 x 12px padding, 6px corners, at most 240px wide (owner standard, 1.6). It appears on hover after 400ms and at once on keyboard focus, hides as soon as the pointer leaves (it stays while the pointer moves onto the bubble), and Esc closes it. The text is also the control's accessible description. Never the only way to get information: touch screens don't show it.","docs_url":"https://commmerce.com/commmerceui/#components--tooltip","properties":[{"attribute":"content","property":"content","type":"string","default":"''","description":"The tooltip text. Plain text, ideally under 80 characters."},{"attribute":"placement","property":"placement","type":"'top' | 'bottom' | 'start' | 'end'","default":"'top'","description":"Preferred side. It flips to the opposite side when there is no room."},{"attribute":"delay","property":"delay","type":"number","default":"400","description":"Wait before showing on hover, in ms. Keyboard focus shows it at once. Default 400 (since 1.6; was 300)."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"True while the tooltip is shown. Read it; use `show()` / `hide()` to change it."},{"attribute":"visual-only","property":"visualOnly","type":"boolean","default":"false","description":"Shows the bubble without adding its text to the control's accessible description. Use it only when the text\nrepeats the control's accessible name, such as the label of an icon-only navigation item, so screen readers\ndon't hear it twice."},{"attribute":"_side","property":"_side","type":"'top' | 'bottom' | 'start' | 'end'","default":"'top'"}],"script_properties":[],"methods":[{"name":"show","description":"Shows the tooltip now."},{"name":"hide","description":"Hides the tooltip now."}],"slots":[{"name":"(default)","description":"The one focusable element the tooltip belongs to (a `cm-button`, a link, an input…)."}],"events":[{"name":"cm-show","description":"When the tooltip appears."},{"name":"cm-hide","description":"When the tooltip disappears."}],"parts":[],"examples":[{"title":"Icon button","description":"An icon-only button still needs its own name: here, its `label`. The tooltip adds a description.","html":"<cm-tooltip content=\"Download this report as a CSV file\">\n <cm-button icon-only icon=\"download\" label=\"Download\"></cm-button>\n</cm-tooltip>"},{"title":"Placement","description":"It flips to the other side when there is no room.","html":"<div class=\"row\" style=\"gap:var(--cm-space-24);padding:40px 0\">\n <cm-tooltip content=\"Above\" placement=\"top\"><cm-button>Top</cm-button></cm-tooltip>\n <cm-tooltip content=\"Below\" placement=\"bottom\"><cm-button>Bottom</cm-button></cm-tooltip>\n <cm-tooltip content=\"Before\" placement=\"start\"><cm-button>Start</cm-button></cm-tooltip>\n <cm-tooltip content=\"After\" placement=\"end\"><cm-button>End</cm-button></cm-tooltip>\n</div>"},{"title":"Longer text","description":"Since 1.6 the bubble wraps at 240px. Keep it to one sentence; anything longer belongs in help text on the page.","html":"<div style=\"padding:24px 0 96px\"><cm-tooltip placement=\"bottom\" content=\"Orders paid more than 30 days ago are archived automatically, with their invoices.\">\n <cm-button>Archive rules</cm-button>\n</cm-tooltip></div>"},{"title":"Explaining a field","html":"<cm-tooltip content=\"Shown to customers at checkout\">\n <cm-text-field label=\"Display name\"></cm-text-field>\n</cm-tooltip>"}],"do":["Keep it under about 80 characters, one sentence or less.","Use it to explain icons and abbreviations.","Make sure what it says is also somewhere else (a label, help text, the page): a tooltip is never the only way to get information."],"dont":["Don't put links, buttons or other controls in a tooltip: it can't be reached.","Don't hide information a merchant needs to finish a task: put it in help text.","Don't add a tooltip that repeats the button text.","Don't wrap a disabled control: it can't be focused, so keyboard users never see the tooltip."],"content":["Write in sentence case without a full stop for fragments.","Say what the control does, not what it looks like."],"accessibility":["The text becomes the control's accessible description: `aria-describedby` on native controls, an element reference on the control inside a component.","It describes, it doesn't name: icon-only buttons need their own name.","With `visual-only`, the text is shown but not added as a description: use it only when it repeats the control's accessible name, as the collapsed Side navigation does with its item labels, so screen readers don't hear it twice.","Hover over it, keep it open while needed and dismiss it with Esc (WCAG 1.4.13).","White on near-black (`text-on-dark` on `bg-panel-header`), AA in both themes."],"responsive":["At most 240px wide (280px before 1.6), and never wider than the window minus 16px.","Positioned against the window: if the bubble doesn't fit on its `placement` side but fits on the opposite one, it flips, and it always stays 8px inside the window. It is placed again when the page scrolls or the window is resized."],"related":["button","icon"]},{"tag":"cm-page-header","slug":"page-header","name":"Page header","react":"PageHeader","group":"Layout","summary":"Tops every admin page with breadcrumbs, the page title and the page's main actions.","lead":"A white bar at least 64px tall: 13px breadcrumbs over a 24/32 semibold title on the left (with an optional 13px `description` under it, since 1.6), buttons 8px apart on the right. A badge in `title-adornment` sits beside the title and wraps under it only when the title runs out of room (fixed in 1.6, issue #32). Its sides are padded 24px (16px on phones), the same as Page content, so the title lines up with the cards below. Pass the parent pages as `breadcrumbs`; the title is added as the current page. On phones it is at least 48px with a 20px title, and the breadcrumbs become a back arrow to the parent page. `back-href` (since 1.7) shows that back arrow at every width, before the title: use it on record pages opened from a list.","docs_url":"https://commmerce.com/commmerceui/#components--page-header","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Page title, rendered as the page's `<h1>` and as the last (current) breadcrumb."},{"attribute":"description","property":"description","type":"string","default":"''","description":"One line under the title saying what the page is for, 13px in text-tertiary (owner standard: page description 13). Since 1.6.\nOn a record page, the record's facts at a glance: \"Owner Asha Rao · Created 12 Nov 2026 · Source Website form\"."},{"attribute":"breadcrumbs","property":"breadcrumbs","type":"Breadcrumb[]","default":"[]","description":"Parent pages, outermost first, as `{label, href}`. Don't include the current page.\nIn HTML pass JSON: `breadcrumbs='[{\"label\":\"Products\",\"href\":\"/products\"}]'`."},{"attribute":"back-href","property":"backHref","type":"string","default":"''","description":"Address of the page this one was opened from (the list of leads, of orders). Shows a back arrow before the title\nat every width, named \"Back to {back-label}\". Without it the arrow appears only on narrow screens, for the last\nbreadcrumb with an `href`. Since 1.7."},{"attribute":"back-label","property":"backLabel","type":"string","default":"''","description":"Name of the page `back-href` leads to (\"Leads\"), for the back arrow's accessible name. Since 1.7."},{"attribute":"pagination","property":"pagination","type":"boolean","default":"false","description":"Shows previous/next arrows for stepping through records (orders, products)."},{"attribute":"has-previous","property":"hasPrevious","type":"boolean","default":"false","description":"Enables the previous arrow."},{"attribute":"has-next","property":"hasNext","type":"boolean","default":"false","description":"Enables the next arrow."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"actions","description":"Buttons, right-aligned, secondary first and the primary action last (large size)."},{"name":"title-adornment","description":"Badge or count next to the title."}],"events":[{"name":"name"},{"name":"cm-previous","description":"When the previous-record arrow is pressed (with `pagination`)."},{"name":"cm-next","description":"When the next-record arrow is pressed (with `pagination`)."}],"parts":[],"examples":[{"title":"Record header","description":"The standard record header: `back-href` back to the list, the status in `title-adornment`, the record's owner, created date and source in `description`, secondary actions then the primary one. Since 1.7.","html":"<cm-page-header heading=\"Asha Rao\" back-href=\"#leads\" back-label=\"Leads\" description=\"Owner Ravi Kumar · Created 12 Nov 2026 · Source Website form\">\n <cm-badge slot=\"title-adornment\" tone=\"attention\">Qualified</cm-badge>\n <cm-button slot=\"actions\">Log call</cm-button>\n <cm-button slot=\"actions\" variant=\"primary\">Convert</cm-button>\n</cm-page-header>"},{"title":"Title badge and description","description":"A count or status in `title-adornment` sits beside the title (it wraps under it only when the title runs out of room), and `description` adds one 13px line under the title. Since 1.6.","html":"<cm-page-header heading=\"Tasks\" description=\"Calls, visits and follow-ups for your accounts.\">\n <cm-badge slot=\"title-adornment\" tone=\"attention\">5 open</cm-badge>\n <cm-button slot=\"actions\">Export</cm-button>\n <cm-button slot=\"actions\" variant=\"primary\">Add task</cm-button>\n</cm-page-header>"},{"title":"Edit page","description":"Secondary actions first, the primary action last, `space-20` apart.","html":"<cm-page-header heading=\"Add product\" breadcrumbs='[{\"label\":\"Dashboard\",\"href\":\"#\"},{\"label\":\"Products\",\"href\":\"#\"}]'>\n <cm-button slot=\"actions\" size=\"large\">Duplicate</cm-button>\n <cm-button slot=\"actions\" size=\"large\">Cancel</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Save</cm-button>\n</cm-page-header>"},{"title":"Record with previous/next","description":"`pagination` adds arrows that fire `cm-previous` and `cm-next`; enable them with `has-previous` and `has-next`.","html":"<cm-page-header heading=\"Order #ODYOD0744\" breadcrumbs='[{\"label\":\"Orders\",\"href\":\"#\"}]' pagination has-previous has-next>\n <cm-badge slot=\"title-adornment\" tone=\"information\">Order placed</cm-badge>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Fulfil</cm-button>\n</cm-page-header>"},{"title":"List page","description":"A count next to the title and import/export actions.","html":"<cm-page-header heading=\"Products\">\n <cm-badge slot=\"title-adornment\">39</cm-badge>\n <cm-button slot=\"actions\" size=\"large\">Import</cm-button>\n <cm-button slot=\"actions\" size=\"large\">Export</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Add product</cm-button>\n</cm-page-header>"}],"do":["Use one page header per page, at the top.","Keep it to three actions; put the rest in an action menu.","Make the title the same words as the link that led here."],"dont":["Don't include the current page in `breadcrumbs`: it is added from `heading`.","Don't use it inside cards or panels.","Don't use it to ask about unsaved changes: use the save bar."],"content":["Titles are nouns or short verb phrases: \"Products\", \"Add product\", \"Order #1042\".","Breadcrumbs use the page names from navigation."],"accessibility":["The title is the page's `<h1>`.","Breadcrumbs are a `nav` named \"Breadcrumb\" with an ordered list; the current page has `aria-current=\"page\"`.","The back arrow (on phones, or always with `back-href`) is a link named \"Back to <parent>\" (`back-label`; just \"Back\" without one). Previous/next arrows are buttons named \"Previous\" and \"Next\", disabled at the ends.","The previous/next arrows are 36px icon buttons (40px on touch screens, with a 44px hit area) with a `border-input` edge, so they meet 3:1."],"responsive":["When the window is 640px wide or less, the breadcrumbs are replaced by a back link to the parent page, the title is 20px, the sides are padded 16px instead of 24px, and the header is at least 48px tall and stays on one line."],"related":["action-bar","save-bar","button"]},{"tag":"cm-action-bar","slug":"action-bar","name":"Action bar","react":"ActionBar","group":"Layout","summary":"Keeps a record's name and its main actions in reach at the bottom of long pages.","lead":"A bar at least 64px tall: a 13px eyebrow and optional badge over a 16px semibold record name, buttons 8px apart on the right. Add `sticky` to pin it to the bottom of the scrolling area. With `tone=\"critical\"` it explains a blocking error and offers the fix.","docs_url":"https://commmerce.com/commmerceui/#components--action-bar","properties":[{"attribute":"eyebrow","property":"eyebrow","type":"string","default":"''","description":"Small line above the heading: the page or record ID (\"Add product\", \"#ODYOD0744\")."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The record name, or the error message when `tone=\"critical\"`."},{"attribute":"tone","property":"tone","type":"'default' | 'critical'","default":"'default'","description":"`default` white bar; `critical` pink bar with a red top edge and warning icon, announced as an alert."},{"attribute":"sticky","property":"sticky","type":"boolean","default":"false","description":"Sticks the bar to the bottom of the scrolling area."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of the bar's region. Defaults to the heading."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Extra content under the heading, such as an amount."},{"name":"adornment","description":"Badge next to the eyebrow (for example the order status)."},{"name":"actions","description":"Buttons, secondary first and the primary action last (large size)."}],"events":[],"parts":[],"examples":[{"title":"Order actions","description":"Badge in the `adornment` slot, extra content (an amount) in the default slot.","html":"<cm-action-bar eyebrow=\"#ODYOD0744\">\n <cm-badge slot=\"adornment\" tone=\"information\">Order placed</cm-badge>\n <p style=\"margin:0;font-size:16px;font-weight:600\">Amount payable: ₹2,234.00</p>\n <cm-button slot=\"actions\" size=\"large\">Cancel order</cm-button>\n <cm-button slot=\"actions\" size=\"large\">Mark as processing</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Mark as paid</cm-button>\n</cm-action-bar>"},{"title":"Record name","html":"<cm-action-bar eyebrow=\"Add product\" heading=\"Brocato Mobster Golden TR90 Rimless Square Eyeglasses\">\n <cm-button slot=\"actions\" size=\"large\">Cancel</cm-button>\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Save</cm-button>\n</cm-action-bar>"},{"title":"Blocking error","description":"Says what is wrong and offers one button that fixes it.","html":"<cm-action-bar tone=\"critical\" heading=\"Tax could not be calculated. Choose a tax rate for this order.\">\n <cm-button slot=\"actions\" size=\"large\" variant=\"primary\">Change tax rate</cm-button>\n</cm-action-bar>"}],"do":["Use it on long forms and order pages where the page header scrolls away.","Repeat the same actions as the page header, in the same order.","Give critical bars one action that fixes the problem."],"dont":["Don't show more than three buttons; on phones keep one and move the rest into a menu.","Don't use it for unsaved changes: use the save bar.","Don't stack two action bars."],"content":["Critical messages say what happened and what to do: \"Tax could not be calculated. Choose a tax rate.\"","Button labels are verbs: \"Mark as paid\", not \"Paid\"."],"accessibility":["A `region` named by the heading (or `label`), so screen-reader users can jump to it.","Critical headings have `role=\"alert\"`, so they are announced when the bar appears or the text changes.","Text on the critical fill (`bg-error-bar`) meets 4.5:1 and the red icon meets 3:1, both themes (checked on every build).","The warning icon is the vector `alert` icon on a 36px white circle; on phones the extra buttons stay visible and wrap instead of moving into a \"more\" menu — compose that with an action menu when it ships."],"responsive":["When the window is 640px wide or less, the bar is at least 56px tall instead of 64px, with 8px by 12px padding, a 14px heading, a 12px eyebrow and a 32px icon.","The actions move under the text when there is no room for both side by side (the text keeps at least 280px)."],"related":["page-header","save-bar","banner"]},{"tag":"cm-save-bar","slug":"save-bar","name":"Save bar","react":"SaveBar","group":"Layout","summary":"Asks the merchant to save or discard unsaved changes.","lead":"A bar with a message, Discard and Save, hidden until there are unsaved changes. Set `open` yourself, or point `form` at a form's ID: the bar opens when a field changes, Save submits the form and Discard resets it. Both events are cancelable, so you can confirm or save with your own code instead. It sticks to the bottom of the scrolling area.","docs_url":"https://commmerce.com/commmerceui/#components--save-bar","properties":[{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the bar. Set it when the page has unsaved changes."},{"attribute":"message","property":"message","type":"string","description":"The question or status shown next to the buttons. Default: the built-in string `message` (\"Unsaved changes\")."},{"attribute":"save-label","property":"saveLabel","type":"string","description":"Primary button label. Default: the built-in string `save` (\"Save\")."},{"attribute":"discard-label","property":"discardLabel","type":"string","description":"Secondary button label. Default: the built-in string `discard` (\"Discard\")."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner on Save and blocks both buttons while saving."},{"attribute":"save-disabled","property":"saveDisabled","type":"boolean","default":"false","description":"Disables Save, for example while the form has errors."},{"attribute":"form","property":"form","type":"string","default":"''","description":"ID of a `<form>` to watch: the bar opens on input, Save submits it and Discard resets it."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[{"name":"name"},{"name":"cm-save","description":"Save pressed (cancelable). With `form`, the default submits that form."},{"name":"cm-discard","description":"Discard pressed (cancelable). With `form`, the default resets that form and closes the bar."}],"parts":[],"examples":[{"title":"Watching a form","description":"Type in the field to open the bar. Discard puts the old value back.","html":"<form id=\"product-form\" class=\"stack\" onsubmit=\"event.preventDefault(); this.nextElementSibling.open = false\">\n <cm-text-field label=\"Title\" name=\"title\" value=\"Ceramic mug\"></cm-text-field>\n</form>\n<cm-save-bar form=\"product-form\"></cm-save-bar>"},{"title":"Open, with your own handlers","description":"Set `loading` while saving; `save-disabled` while the form has errors.","html":"<cm-save-bar open message=\"Do you want to save changes before closing?\" discard-label=\"Cancel\"></cm-save-bar>"}],"do":["Show it as soon as anything changes, and hide it after saving or discarding.","Keep the merchant on the page if they try to leave with unsaved changes.","Set `loading` while the save request runs."],"dont":["Don't use it on pages that save straight away (toggles, for example).","Don't add other actions to it: use the action bar.","Don't show it alongside an action bar with its own Save button."],"content":["The message is short: \"Unsaved changes\" or a question such as \"Save changes before closing?\".","Keep the labels \"Save\" and \"Discard\" unless the context needs \"Cancel\"."],"accessibility":["The message is a `status` live region, so it is announced when the bar opens.","The bar is a `region` named by the message; buttons are real buttons in a sensible tab order (Discard, then Save).","While `loading`, Save shows a spinner with `aria-busy` and both buttons are blocked.","The bar is at least 64px tall with a 16px semibold message and large (40px) Discard and Save buttons 8px apart."],"responsive":["The buttons move under the message when there is no room for both side by side (the message keeps at least 200px).","When the window is 640px wide or less, the bar is at least 56px tall instead of 64px, with 8px by 12px padding and a 14px message."],"related":["page-header","action-bar","button"]},{"tag":"cm-info-panel","slug":"info-panel","name":"Info panel","react":"InfoPanel","group":"Layout","summary":"Lists the facts about a record as label/value pairs, in the side column of detail pages.","lead":"A card (about 380px in the side column) with a 16px semibold title, an optional underlined text action, and `cm-info-item`s: a 13px grey label over a 14px medium value. Values can be text, badges or tags. `half` puts two short facts on one line. For record pages (since 1.7), `variant=\"compact\"` gives it a compact card's 16px padding and `layout=\"rows\"` puts each label beside its value.","docs_url":"https://commmerce.com/commmerceui/#components--info-panel","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Panel title."},{"attribute":"action","property":"action","type":"string","default":"''","description":"Text of the header action, in sentence case (\"Remove\", \"Edit\"). Leave empty for none."},{"attribute":"action-label","property":"actionLabel","type":"string","default":"''","description":"Accessible name of the header action when the text alone is unclear, e.g. \"Remove order details\"."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level for the title. Default 2."},{"attribute":"variant","property":"variant","type":"'default' | 'compact'","default":"'default'","description":"`default` (24px padding, like a standard `cm-card`; 16px on phones; 20px before 1.7.1) or `compact` (16px padding and 12px under the title, like a compact `cm-card`). Since 1.7."},{"attribute":"layout","property":"layout","type":"'stacked' | 'rows'","default":"'stacked'","description":"`stacked` (default: each label over its value; `half` items share a line) or `rows` (each label beside its value,\ntwo fifths of the width for the label; `half` is ignored). Since 1.7."},{"attribute":"_list","property":"_list","type":"boolean","default":"true","description":"The items area is a list only while it holds just `cm-info-item`s (not, say, a loading skeleton)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"`cm-info-item` elements."}],"events":[{"name":"cm-action","description":"When the header text action (for example REMOVE) is pressed."}],"parts":[{"tag":"cm-info-item","react":"InfoItem","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"What the value is (\"Ordered on\", \"SKU\")."},{"attribute":"half","property":"half","type":"boolean","default":"false","description":"Takes half the width, so two short facts share a line."},{"attribute":"editable","property":"editable","type":"boolean","default":"false","description":"Shows a pencil button after the value that fires `cm-edit`. Since 1.9.1."},{"attribute":"edit-label","property":"editLabel","type":"string","default":"''","description":"Accessible name of the pencil; default \"Edit {label}\". Since 1.9.1."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The value."}],"events":[{"name":"cm-edit","description":"When the pencil of an `editable` fact is pressed."}]}],"examples":[{"title":"Record details: compact rows","description":"The Details card of a record page's 320px aside: `variant=\"compact\"` (16px padding) and `layout=\"rows\"` (13px label on the start side, 14px value beside it, 12px between rows). Since 1.7.","html":"<div style=\"max-width:320px\">\n<cm-info-panel heading=\"Details\" action=\"Edit\" action-label=\"Edit details\" variant=\"compact\" layout=\"rows\">\n <cm-info-item label=\"Email\"><a href=\"mailto:asha@example.com\">asha@example.com</a></cm-info-item>\n <cm-info-item label=\"Phone\">+91 98450 12345</cm-info-item>\n <cm-info-item label=\"Company\">Rao Textiles</cm-info-item>\n <cm-info-item label=\"Lead source\">Website form</cm-info-item>\n <cm-info-item label=\"Status\"><cm-badge tone=\"attention\">Qualified</cm-badge></cm-info-item>\n</cm-info-panel>\n</div>"},{"title":"Order details","html":"<div style=\"max-width:380px\">\n<cm-info-panel heading=\"Order details\" action=\"Remove\" action-label=\"Remove order details\">\n <cm-info-item label=\"Ordered on\">Mar 29, 2023 3:45 AM</cm-info-item>\n <cm-info-item label=\"Order status\"><cm-badge tone=\"information\">Order placed</cm-badge></cm-info-item>\n <cm-info-item label=\"Order type\">Store pickup</cm-info-item>\n <cm-info-item label=\"Payment status\"><cm-badge tone=\"success\">Accepted</cm-badge></cm-info-item>\n <cm-info-item label=\"Transaction ID\">098765432108976</cm-info-item>\n <cm-info-item label=\"SKU\" half>OD673892</cm-info-item>\n <cm-info-item label=\"Inventory available\" half>8202</cm-info-item>\n <cm-info-item label=\"Product tags\">\n <cm-tag removable>Yellow</cm-tag><cm-tag removable>Cotton</cm-tag><cm-tag removable>Summer</cm-tag>\n </cm-info-item>\n</cm-info-panel>\n</div>"}],"do":["Put it in the side column of detail pages, next to the main cards.","On record pages use `variant=\"compact\" layout=\"rows\"` in the aside.","Use `half` only for short values that fit side by side.","Name the header action with `action-label` when \"Remove\" alone is unclear."],"dont":["Don't put form fields in it: use a card.","Don't use it for long text: values should be one line or a few tags."],"content":["Labels are sentence-case nouns: \"Ordered on\", \"Payment status\".","Write values the way the merchant sees them elsewhere (same date format, same status words)."],"accessibility":["The panel is a region named by its heading; the items are a list, each a list item, so screen readers announce \"list, 8 items\" and read each label before its value.","The header action is a real button; it fires `cm-action`.","The action is written in sentence case and underlined, and the panel takes the width you give it."],"related":["card","badge","tag"]},{"tag":"cm-accordion","slug":"accordion","name":"Accordion","react":"Accordion","group":"Layout","summary":"Shows or hides extra detail under a row, inside side panels and cards.","lead":"A 48px bordered row with 14px medium text and a 28px round chevron; the detail opens below a divider. Each accordion opens on its own; stack them `space-8` apart.","docs_url":"https://commmerce.com/commmerceui/#components--accordion","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The always-visible row text."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the detail."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks opening and closing."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"3","description":"Heading level wrapping the toggle button, so the page outline stays correct. Default 3."}],"script_properties":[],"methods":[{"name":"toggle","description":"Opens or closes it, as if the row was pressed."}],"slots":[{"name":"(default)","description":"The detail shown when open."}],"events":[{"name":"cm-toggle","description":"After it opens or closes; `detail.open` is the new state."}],"parts":[],"examples":[{"title":"Customer matches","html":"<div class=\"stack\" style=\"gap:var(--cm-space-8);max-width:480px\">\n <cm-accordion heading=\"Email and phone found in an abandoned cart\">\n <p style=\"margin:0\">Cart from 18-12-2022 · 3 items · Rs. 1,240</p>\n </cm-accordion>\n <cm-accordion heading=\"Email and phone found in 2 orders\" open>\n <p style=\"margin:0\">#NAYOD0736 · 20-12-2022<br>#NAYOD0741 · 02-01-2023</p>\n </cm-accordion>\n</div>"}],"do":["Use it to tuck away detail that most merchants don't need.","Write the row so it says what is inside: \"Found in 2 orders\".","Set `heading-level` to fit the page outline."],"dont":["Don't hide information needed to finish the task.","Don't nest accordions.","Don't use it for navigation: use tabs or links."],"content":["Row text is a short statement in sentence case, no full stop."],"accessibility":["The row is a button inside a heading, with `aria-expanded` and `aria-controls`; the detail is a region labelled by the row.","Enter or Space opens and closes it; `cm-toggle` reports the new state.","The chevron rotation respects reduced motion.","Built from the written guidance in the design-system artifact; sizes follow the 1.5 scale."],"responsive":["The header row is at least 48px tall with 14px text and a 28px chevron circle at every width."],"related":["card","info-panel"]},{"tag":"cm-empty-state","slug":"empty-state","name":"Empty state","react":"EmptyState","group":"Feedback","summary":"Fills a list or page that has nothing in it yet, and offers the next step.","lead":"Owner standard (1.6): a 48px icon tile with a 24px icon, a 16px semibold line saying what is missing, 13px supporting text and one 36px action, 8 to 12px apart, so an empty card stays compact. `size=\"large\"` keeps the 160px illustration circle (120px on phones) for a first-run page with a real illustration; it was the default before 1.6. `size=\"small\"` is a 120px circle and `size=\"inline\"` one line of text.","docs_url":"https://commmerce.com/commmerceui/#components--empty-state","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"What is missing, said plainly: \"No products found\"."},{"attribute":"image","property":"image","type":"string","default":"''","description":"URL of an illustration shown in the circle. Decorative, so it has no alt text."},{"attribute":"icon","property":"icon","type":"IconName | ''","default":"'box'","description":"System icon shown in the circle when there is no `image` or `image` slot."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level, so the page outline stays correct. Default 2."},{"attribute":"size","property":"size","type":"'default' | 'large' | 'small' | 'inline'","default":"'default'","description":"`default` (since 1.6, owner standard: a 48px icon tile, 16px heading, 13px text; for pages, cards and lists),\n`large` (the 160px illustration circle, 120px on phones: a first-run page with a real illustration; the default\nbefore 1.6), `small` (a 120px circle) or `inline` (since 1.2: no tile, a 20px icon, heading and text on one or two\nleft-aligned lines; for an empty list inside a card, panel or table). Inline shows the `icon` (default `box`); set `icon=\"\"` for text only."},{"attribute":"action","property":"action","type":"string","default":"''","description":"Text of one action drawn as a text button (\"Add task\", \"View all\"), after the text. Meant for `size=\"inline\"`; larger sizes put a `cm-button` in the `actions` slot. Fires `cm-action`. Since 1.2."},{"attribute":"action-href","property":"actionHref","type":"string","default":"''","description":"Makes the text action a link to this URL instead of a button. Since 1.2."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Optional supporting text under the heading (inline: after it, on the same line)."},{"name":"image","description":"Your own illustration or icon, drawn inside the tile (or the circle with `size=\"large\"`/`\"small\"`). Decorative: give it `alt=\"\"`. Inline: 20px."},{"name":"actions","description":"The primary action (usually one primary `cm-button`), plus an optional link."}],"events":[{"name":"cm-action","description":"The text action (`action`) was pressed. Not fired when it has `action-href` (it is then a link)."}],"parts":[],"examples":[{"title":"Default","description":"A 48px icon tile, 16px heading, 13px text and a 36px action. Since 1.6.","html":"<cm-empty-state heading=\"No visits planned\" icon=\"calendar\">\n Plan a visit to see it here.\n <cm-button slot=\"actions\" variant=\"primary\">Plan a visit</cm-button>\n</cm-empty-state>"},{"title":"Large illustration","description":"`size=\"large\"`: the 160px circle (120px on phones), for a first-run page.","html":"<cm-empty-state size=\"large\" heading=\"No products found\">\n <cm-button slot=\"actions\" variant=\"primary\" size=\"large\">Add product</cm-button>\n</cm-empty-state>"},{"title":"Inside a card, with supporting text","html":"<cm-card heading=\"Orders\" style=\"max-width:420px\">\n <cm-empty-state size=\"small\" icon=\"cart\" heading=\"No orders yet\">\n Orders appear here when customers check out.\n <cm-button slot=\"actions\" variant=\"primary\">Share your store</cm-button>\n </cm-empty-state>\n</cm-card>"},{"title":"Inline, for an empty list inside a card","description":"`size=\"inline\"` says \"nothing here\" in one or two left-aligned lines, with no circle and no extra height, so an empty card is no taller than a full one. The heading is bold, the supporting text follows it on the same line, an optional 20px `icon` sits in front (set `icon=\"\"` for text only), and `action` adds one text action that fires `cm-action` (or is a link with `action-href`). Since 1.2.","html":"<div class=\"row\" style=\"align-items:flex-start\">\n <cm-card heading=\"Customer tasks\" style=\"flex:1 1 260px;max-width:360px\">\n <cm-empty-state size=\"inline\" icon=\"tasks\" heading=\"Nothing due today.\" heading-level=\"3\" action=\"Add task\">4 later.</cm-empty-state>\n </cm-card>\n <cm-card heading=\"Chats\" style=\"flex:1 1 260px;max-width:360px\">\n <cm-empty-state size=\"inline\" icon=\"\" heading=\"No chats waiting.\" heading-level=\"3\"></cm-empty-state>\n </cm-card>\n</div>"}],"do":["Say what is missing and what to do next.","Inside a card, panel, table or list that sits next to full ones, use `size=\"inline\"`: one line, at most one text action.","Offer one primary action; add a link only if there is a real second path.","Use your own illustration in the `image` slot or `image` attribute when you have one."],"dont":["Don't use it for errors: use a critical banner.","Don't use it for search with no results without saying how to widen the search.","Don't show it while data is loading: use a skeleton."],"content":["Heading in sentence case, no exclamation mark: \"No products found\".","Supporting text is one sentence about what will appear and when."],"accessibility":["The heading is a real heading (`heading-level`, default 2) so screen-reader users find it in the outline.","The illustration is decorative and hidden from assistive technology.","The circle shows a system icon (`icon`, default `box`); pass your own artwork in the `image` slot."],"responsive":["The default tile is the same at every width. With `size=\"large\"`, when the window is 640px wide or less, the circle is 120px, as in the small size."],"related":["skeleton","banner","button"]},{"tag":"cm-toast","slug":"toast","name":"Toast","react":"Toast","group":"Feedback","summary":"A short confirmation at the bottom of the screen that goes away on its own.","lead":"One sentence on a dark bar, bottom centre, 48px tall with an 8px radius: \"Product saved\". Show it with `showToast()`, which keeps one polite live region on the page so every toast is announced. It stays 5 seconds (10 with an action), and pauses while the pointer or focus is on it. For reversible actions, act at once and offer Undo in a toast instead of asking first: see Undo instead of confirm.","docs_url":"https://commmerce.com/commmerceui/#components--toast","properties":[{"attribute":"message","property":"message","type":"string","default":"''","description":"The text: one short sentence, up to about 50 characters."},{"attribute":"tone","property":"tone","type":"ToastTone","default":"'default'","description":"`critical` for failures. Never the only place an error is shown: also say it next to what failed."},{"attribute":"duration","property":"duration","type":"number | undefined","description":"How long it stays, in ms: 2000–10000. Default 5000, or 10000 when it has an action."},{"attribute":"action-label","property":"actionLabel","type":"string","default":"''","description":"Label of one optional action (\"Undo\", \"View\"). The toast stays 10 seconds when it has one."},{"attribute":"open","property":"open","type":"boolean","default":"true","description":"Whether it is showing. Set it to show the toast again; it is cleared when the toast closes."},{"attribute":"_inRegion","property":"_inRegion"},{"attribute":"_primed","property":"_primed","type":"boolean","default":"false","description":"Alone, the toast's live region must exist before its text, or screen readers skip the first message."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"closed","type":"Promise<ToastCloseReason>","description":"Resolves when the toast closes (this time it is shown), with the reason: `action` (its action was pressed),\n`close` (Dismiss, Esc or `open = false`), `timeout`, or `removed` (taken off the page while open, e.g. pushed out by newer toasts)."},{"property":"effectiveDuration","type":"number","description":"The time the toast stays, clamped to 2000–10000 ms."}],"methods":[{"name":"show","description":"Shows the toast again and restarts its timer."},{"name":"dismiss","description":"Closes the toast, as if the close button were pressed. Returns false if a listener kept it open."}],"slots":[{"name":"(default)","description":"The message, if not given with `message`."}],"events":[{"name":"cm-action","description":"The action button was pressed (cancelable; by default the toast then closes)."},{"name":"cm-dismiss","description":"The toast is closing: `detail.reason` is `timeout`, `close` or `action` (cancelable; keeps it open)."}],"parts":[{"tag":"cm-toast-region","react":"ToastRegion","properties":[{"attribute":"max","property":"max","type":"number","default":"3","description":"Most toasts shown at once. When a new one would exceed it, the oldest is removed. Default 3."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"focusToast","description":"Moves focus to the newest open toast with an action (else the newest toast): its action, or its Dismiss button.\nF6 does this; call it to offer another shortcut. Returns false when there is no toast to focus."},{"name":"add","description":"Adds a toast, removing the oldest ones above `max`."}],"slots":[{"name":"(default)","description":"`cm-toast` elements. Closed toasts are removed."}],"events":[]}],"examples":[{"title":"Show a toast","description":"Call `showToast(message, { tone, duration, action })`. Each button here calls it.","html":"<div class=\"row\">\n <cm-button data-toast=\"Product saved\">Save product</cm-button>\n <cm-button data-toast=\"Order archived\" data-toast-action=\"Undo\">Archive order</cm-button>\n <cm-button data-toast=\"Couldn't save product. Check your connection.\" data-toast-tone=\"critical\">Fail to save</cm-button>\n</div>"},{"title":"Default","description":"A toast element on its own carries its own live region; set `open` to show it again.","html":"<cm-toast message=\"Product saved\" duration=\"10000\"></cm-toast>"},{"title":"With an action","html":"<cm-toast message=\"3 orders archived\" action-label=\"Undo\" duration=\"10000\"></cm-toast>"},{"title":"Critical","description":"Also show the error where it happened: a toast disappears, so it must never be the only place.","html":"<cm-toast tone=\"critical\" message=\"Couldn't save product\" duration=\"10000\"></cm-toast>"}],"do":["Confirm something the merchant just did: \"Product saved\", \"Order archived\".","Offer Undo for actions that are easy to reverse (archive, mark done, move, remove from a list), and don't ask first: Undo instead of confirm.","Use `showToast()` so toasts stack in one place and are announced."],"dont":["Don't use a toast as the only sign of an error: show the error next to what failed (a banner or field error) too.","Don't put essential information or links the merchant must follow in a toast.","Don't show more than one toast for one action.","Don't offer Undo for something that can't be undone (a sent email, a real delete): ask first with a modal instead."],"content":["Noun and past-tense verb: \"Product saved\", not \"Your product has been saved successfully!\".","About 50 characters at most, one sentence, no full stop for confirmations.","Action labels are one verb: \"Undo\", \"View\".","With Undo, say what happened in the past tense: \"Lead archived\", \"3 tasks marked done\"."],"accessibility":["`showToast()` adds toasts to `cm-toast-region`, a polite `role=\"status\"` region, so screen readers announce them without moving focus.","Hovering or focusing a toast pauses its timer; it never closes in under 2 seconds, and stays 10 seconds when it has an action.","Keyboard: F6 moves focus to the newest toast's action (`aria-keyshortcuts=\"F6\"`) and F6 again goes back; Esc closes the focused toast; focus returns to where it was when the toast closes, so it is never lost. A toast with an action ends with visually hidden text, \"Press F6 to reach it.\" (built-in string `toast.shortcut`; set it to an empty string to leave it out).","The Dismiss and action buttons are real buttons with visible focus rings; text is white on black (or black on the error tint) and meets 4.5:1 in both themes."],"responsive":["At most 480px wide, and never wider than the window minus 32px."],"related":["banner","spinner","progress-bar"]},{"tag":"cm-spinner","slug":"spinner","name":"Spinner","react":"Spinner","group":"Feedback","summary":"Shows that something is loading when the wait is short or of unknown length.","lead":"A turning arc: 20px (`small`) inside buttons, rows and fields, 44px (`large`) for a section. The arc is `border-strong` on a `border-subtle` track. A product can show its own graphic in place of the arc (since 1.12).","docs_url":"https://commmerce.com/commmerceui/#components--spinner","properties":[{"attribute":"size","property":"size","type":"'small' | 'large'","default":"'large'","description":"`small` (20px) for inline use in buttons, rows and fields; `large` (44px) for a section or page."},{"attribute":"accessible-label","property":"accessibleLabel","type":"string","description":"What screen readers announce. Name what is loading when it helps: \"Loading orders\". Default: the built-in string `loading` (\"Loading\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"Optional graphic shown instead of the arc, such as an inline SVG. Decorative: give it `aria-hidden=\"true\"`. Drawn 12px tall (`small`) or 20px (`large`) with its own width; colour it with `currentColor`."}],"events":[],"parts":[],"examples":[{"title":"Sizes","html":"<div class=\"row\" style=\"align-items:center;gap:var(--cm-space-32)\">\n <cm-spinner size=\"large\"></cm-spinner>\n <cm-spinner size=\"small\"></cm-spinner>\n</div>"},{"title":"Loading a section","description":"Mark the region busy and name what is loading.","html":"<cm-card heading=\"Recent orders\">\n <div aria-busy=\"true\" style=\"display:flex;justify-content:center;padding:var(--cm-space-32)\">\n <cm-spinner accessible-label=\"Loading recent orders\"></cm-spinner>\n </div>\n</cm-card>"},{"title":"Your own graphic","description":"Since 1.12. Put a decorative graphic inside to show it instead of the arc: the spinner keeps the status, the label and the height (12px small, 20px large). The graphic animates itself with `--cm-spinner-duration` and `--cm-spinner-play-state`, which pauses it under reduced motion. Commmerce products use this for the Commmerce loader from Commmerce Brand Assets; the loader itself is not part of Commmerce UI.","html":"<style>\n .demo-bars rect { fill: currentColor; animation: demo-pulse var(--cm-spinner-duration) ease-in-out infinite; animation-play-state: var(--cm-spinner-play-state); }\n .demo-bars rect:nth-child(2) { animation-delay: calc(var(--cm-spinner-duration) / 6); }\n .demo-bars rect:nth-child(3) { animation-delay: calc(var(--cm-spinner-duration) / 3); }\n @keyframes demo-pulse { 0%, 60%, 100% { opacity: 1; } 30% { opacity: .3; } }\n</style>\n<div class=\"row\" style=\"align-items:center;gap:var(--cm-space-32)\">\n <cm-spinner size=\"large\" accessible-label=\"Loading orders\">\n <svg class=\"demo-bars\" viewBox=\"0 0 44 20\" aria-hidden=\"true\"><rect width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"16\" width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"32\" width=\"12\" height=\"20\" rx=\"2\"/></svg>\n </cm-spinner>\n <cm-spinner size=\"small\">\n <svg class=\"demo-bars\" viewBox=\"0 0 44 20\" aria-hidden=\"true\"><rect width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"16\" width=\"12\" height=\"20\" rx=\"2\"/><rect x=\"32\" width=\"12\" height=\"20\" rx=\"2\"/></svg>\n </cm-spinner>\n</div>"}],"do":["Use it for waits of about 1 to 10 seconds where the length is unknown.","Name what is loading with `accessible-label` when there is more than one on the page.","Use a button's own `loading` state for button actions.","With your own graphic, mark it `aria-hidden=\"true\"`, draw it in `currentColor` and run its animation on `--cm-spinner-duration` and `--cm-spinner-play-state`."],"dont":["Don't use it for a whole page's first load: use a skeleton display.","Don't use it when you know how far along the task is: use a progress bar.","Don't show several spinners for one task.","Don't put the Commmerce logo or loader in an app you build for the admin: apps embedded in the admin keep the arc."],"content":["The label is \"Loading\" or \"Loading <thing>\": no ellipsis, no \"please wait\"."],"accessibility":["A `role=\"status\"` with hidden text, so the label is announced; the graphic is hidden from screen readers.","The arc meets 3:1 against the page and card backgrounds in both themes.","Under reduced motion it turns three times slower; a slotted graphic gets `--cm-spinner-play-state: paused`.","A slotted graphic is coloured by the spinner's `color` (`border-strong` by default, which meets 3:1); if you change it, keep 3:1 against the background."],"related":["progress-bar","skeleton","button"]},{"tag":"cm-progress-bar","slug":"progress-bar","name":"Progress bar","react":"ProgressBar","group":"Feedback","summary":"Shows how far a longer task has got, such as an import or a bulk update.","lead":"A label above an 8px (`medium`) or 4px (`small`) rounded track in `bg-inset`, filled with `action-primary`. Without a `value` it is indeterminate: a segment slides along the track.","docs_url":"https://commmerce.com/commmerceui/#components--progress-bar","properties":[{"attribute":"value","property":"value","type":"number | null","default":"null","description":"Percent done, 0–100. Leave unset (or `null`) for an indeterminate bar when the amount is unknown."},{"attribute":"label","property":"label","type":"string","default":"''","description":"What is in progress, shown above the bar and used as its accessible name. Required."},{"attribute":"label-hidden","property":"labelHidden","type":"boolean","default":"false","description":"Keeps the label for screen readers only, when the surrounding text already says what is running."},{"attribute":"show-value","property":"showValue","type":"boolean","default":"false","description":"Shows the percentage next to the label. Determinate bars only."},{"attribute":"size","property":"size","type":"'small' | 'medium'","default":"'medium'","description":"`small` (4px) inside rows and cards; `medium` (8px) for a page-level task."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"clampedValue","type":"number | null","description":"The value clamped to 0–100, or `null` when indeterminate."}],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Determinate","html":"<cm-progress-bar label=\"Importing 1,240 products\" value=\"62\" show-value style=\"max-width:520px\"></cm-progress-bar>"},{"title":"Indeterminate","description":"Leave out `value` when you can't tell how far along it is.","html":"<cm-progress-bar label=\"Syncing inventory with your stores\" style=\"max-width:520px\"></cm-progress-bar>"},{"title":"Small, in a card","html":"<cm-card heading=\"Bulk price update\">\n <div class=\"stack\">\n <p style=\"margin:0\">Updating 350 products. You can leave this page.</p>\n <cm-progress-bar label=\"Bulk price update\" label-hidden size=\"small\" value=\"30\"></cm-progress-bar>\n </div>\n</cm-card>"}],"do":["Use it for tasks over about 10 seconds, and say what is happening in the label.","Update `value` at least every few seconds, so it never looks stuck.","Tell the merchant whether they can leave the page."],"dont":["Don't use it for short waits: use a spinner.","Don't let a determinate bar go backwards."],"content":["Label in the present continuous with the amount: \"Importing 1,240 products\"."],"accessibility":["A WAI-ARIA `progressbar` named by its label, with `aria-valuenow` (0–100) when determinate and no value when indeterminate.","`label-hidden` keeps the name for screen readers when the text around it already says what is running.","The fill meets 3:1 against the track and page in both themes; under reduced motion the indeterminate segment moves three times slower."],"related":["spinner","toast","banner"]},{"tag":"cm-skeleton","slug":"skeleton","name":"Skeleton","react":"Skeleton","group":"Feedback","summary":"Grey placeholder shapes shown where content is loading.","lead":"Lines, square thumbnails (34, 40, 50 or 186px) and blocks in `bg-input-filled`, pulsing gently to `thumb-bg`.","docs_url":"https://commmerce.com/commmerceui/#components--skeleton","properties":[{"attribute":"variant","property":"variant","type":"'text' | 'thumbnail' | 'block'","default":"'text'","description":"`text` (one or more lines), `thumbnail` (a square image placeholder) or `block` (fills the width; set a height)."},{"attribute":"lines","property":"lines","type":"number","default":"1","description":"Number of text lines. The last of several lines is shorter, like a real paragraph."},{"attribute":"size","property":"size","type":"keyof typeof THUMB","default":"'large'","description":"Thumbnail size: `small` 34px, `medium` 40px, `large` 50px, `xlarge` 186px."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Product row loading","html":"<div aria-busy=\"true\" style=\"display:flex;gap:var(--cm-space-12);align-items:center;max-width:520px\">\n <cm-skeleton variant=\"thumbnail\" size=\"large\"></cm-skeleton>\n <cm-skeleton lines=\"2\" style=\"flex:1\"></cm-skeleton>\n</div>"},{"title":"Thumbnail sizes","html":"<div style=\"display:flex;gap:var(--cm-space-20);align-items:flex-end;flex-wrap:wrap\">\n <cm-skeleton variant=\"thumbnail\" size=\"xlarge\"></cm-skeleton>\n <cm-skeleton variant=\"thumbnail\" size=\"large\"></cm-skeleton>\n <cm-skeleton variant=\"thumbnail\" size=\"medium\"></cm-skeleton>\n <cm-skeleton variant=\"thumbnail\" size=\"small\"></cm-skeleton>\n</div>"},{"title":"Block","html":"<cm-skeleton variant=\"block\" style=\"--cm-skeleton-height:90px;max-width:520px\"></cm-skeleton>"}],"do":["Match the shape of the content that will replace it.","Mark the loading region with `aria-busy=\"true\"` and remove it when content arrives.","Use `cm-skeleton-display` for a whole page."],"dont":["Don't use skeletons for actions that take under a second.","Don't mix skeletons and spinners for the same content."],"content":["Skeletons carry no text."],"accessibility":["Each skeleton is `aria-hidden`; announce loading on the region (`aria-busy`) or with `cm-skeleton-display`.","The pulse stops under reduced motion; in forced-colours mode the shapes get an outline.","Shapes are decorative, so they are not part of the contrast checks."],"related":["skeleton-display","empty-state"]},{"tag":"cm-skeleton-display","slug":"skeleton-display","name":"Skeleton display","react":"SkeletonDisplay","group":"Feedback","summary":"A whole-page loading placeholder laid out like a detail page.","lead":"An 80px page-header bar, then a main column (472, 90, 90 and 251px cards) and a 30% side column (five cards), 8px apart. On mobile the columns stack.","docs_url":"https://commmerce.com/commmerceui/#components--skeleton-display","properties":[{"attribute":"layout","property":"layout","type":"'two-column' | 'one-column'","default":"'two-column'","description":"`two-column` (main cards plus a side column, as on detail pages) or `one-column` (lists and settings)."},{"attribute":"navigation","property":"navigation","type":"boolean","default":"false","description":"Adds a 250px side-navigation placeholder on the left. Admin chrome: for Commmerce products only, not for apps."},{"attribute":"label","property":"label","type":"string","description":"What screen readers announce while it shows. Default: the built-in string `loading` (\"Loading\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Detail page","html":"<cm-skeleton-display style=\"max-width:760px\"></cm-skeleton-display>"},{"title":"One column","html":"<cm-skeleton-display layout=\"one-column\" style=\"max-width:760px\"></cm-skeleton-display>"}],"do":["Show it only for the first load of a page; later updates should keep the old content visible.","Pick the layout closest to the page that will load."],"dont":["Don't use `navigation` in apps: the side navigation is admin chrome, for Commmerce products only.","Don't leave it up if loading fails: replace it with an error banner."],"content":["Change `label` if \"Loading\" is too vague, e.g. \"Loading order\"."],"accessibility":["Announces its `label` once through a status region and sets `aria-busy`; the shapes are hidden.","Pulse stops under reduced motion.","Card widths are 70/30 of the space, and the 250px navigation placeholder is opt-in."],"responsive":["When the window is 768px wide or less, the navigation column is hidden, the body is one column and the header placeholder is 60px tall instead of 80px."],"related":["skeleton","page-header"]},{"tag":"cm-comment-box","slug":"comment","name":"Comment","react":"CommentBox","group":"Feedback","summary":"Staff notes on an order or customer: a box to write one and the timeline of earlier ones.","lead":"A 16px semibold \"Comments\" heading, a 128px text box and a primary \"Post comment\" button, 12px apart. Each comment is a bordered 6px-radius box with the time, the text and the author, 12px padding and 8px between comments.","docs_url":"https://commmerce.com/commmerceui/#components--comment","properties":[{"attribute":"heading","property":"heading","type":"string","description":"Section title above the box. Default: the built-in string `heading` (\"Comments\")."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the text box. Default: the built-in string `label` (\"Add a comment\")."},{"attribute":"placeholder","property":"placeholder","type":"string","default":"''","description":"Placeholder in the empty box."},{"attribute":"action","property":"action","type":"string","description":"Text of the post button. Default: the built-in string `action` (\"Post comment\")."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Current text in the box."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Blocks typing and posting (for example while the comment saves)."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level of the title. Default 2."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"submit","description":"Posts the current text, as if Post was pressed."}],"slots":[{"name":"(default)","description":"Existing `cm-comment` elements, shown as a list under the box."}],"events":[{"name":"cm-submit","description":"When Post is pressed with text; `detail.value` is the trimmed text. Cancelable: the default clears the box."}],"parts":[{"tag":"cm-comment","react":"Comment","properties":[{"attribute":"author","property":"author","type":"string","default":"''","description":"Who wrote it (a staff name, \"System\" or an app name)."},{"attribute":"datetime","property":"datetime","type":"string","default":"''","description":"When it was written, as an ISO date-time (`2023-02-09T17:07`). Used for `<time datetime>`."},{"attribute":"time","property":"time","type":"string","default":"''","description":"The date as shown. Leave empty to format `datetime` in the viewer's locale."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The comment text."}],"events":[]}],"examples":[{"title":"Order comments","html":"<cm-comment-box style=\"max-width:720px\">\n <cm-comment author=\"Robinson Painatillo\" datetime=\"2023-02-09T17:07\" time=\"09-02-2023 05:07 PM\">Order status changed from processing to partially fulfilled.</cm-comment>\n <cm-comment author=\"System\" datetime=\"2023-02-09T16:40\" time=\"09-02-2023 04:40 PM\">Order cancelled: the payment confirmation period is over.</cm-comment>\n</cm-comment-box>"},{"title":"A single comment","html":"<cm-comment author=\"Robinson Painatillo\" datetime=\"2023-02-09T17:07\" style=\"max-width:400px\">Called the customer about the delivery address.</cm-comment>"}],"do":["Listen for `cm-submit`, save the text, then add a `cm-comment` for it. Call `preventDefault()` to keep the text if saving fails.","Set `disabled` while a comment saves.","Give `datetime` in ISO format so screen readers and browsers get the exact time."],"dont":["Don't use comments for system errors: use a banner.","Don't edit a posted comment in place without saying so."],"content":["Button: \"Post comment\".","Author is a person's name, \"System\" or the app's name."],"accessibility":["The box is a section named by its heading; the text box has its own label (\"Add a comment\").","Ctrl/⌘ + Enter posts; an empty box does not post and keeps focus in the box.","Comments inside the box form a list; each time is a `<time datetime>`.","Time and author are 12px `text-tertiary` (4.5:1 or more); the text box uses the `border-input` edge for contrast."],"responsive":["When the window is 640px wide or less, the text area starts 96px tall instead of 128px, and the post button moves to the end of the row."],"related":["text-field","card","info-panel","timeline"]},{"tag":"cm-smart-tips","slug":"smart-tip","name":"Smart tip","react":"SmartTips","group":"Feedback","summary":"Short linked tips that lead merchants to guides, with an optional tour banner.","lead":"A dark tour banner at least 56px tall, then a white card titled \"Smart tips\" with tip cards at least 88px tall: a 14px semibold title, a 13px grey description and a 32px round arrow that turns black on hover and focus.","docs_url":"https://commmerce.com/commmerceui/#components--smart-tip","properties":[{"attribute":"heading","property":"heading","type":"string","description":"Title above the tips. Default: the built-in string `heading` (\"Smart tips\")."},{"attribute":"tour-heading","property":"tourHeading","type":"string","default":"''","description":"Text of the dark tour banner (\"Take a tour of Commmerce\"). Leave empty for no banner."},{"attribute":"tour-action","property":"tourAction","type":"string","description":"Label of the tour banner's button. Default: the built-in string `tourAction` (\"Start\")."},{"attribute":"heading-level","property":"headingLevel","type":"2 | 3 | 4 | 5 | 6","default":"2","description":"Heading level of the title. Default 2."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"`cm-smart-tip` elements."}],"events":[{"name":"cm-tour","description":"When the tour banner's button is pressed."}],"parts":[{"tag":"cm-smart-tip","react":"SmartTip","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Tip title, at most two short lines."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Where the tip leads."},{"attribute":"target","property":"target","type":"string","default":"''","description":"Link target. `_blank` adds `rel=\"noopener noreferrer\"` and tells screen readers it opens a new tab."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"One or two lines that say what the merchant gets from the guide."}],"events":[]}],"examples":[{"title":"Home page tips","html":"<cm-smart-tips tour-heading=\"Take a tour of Commmerce\" style=\"max-width:340px\">\n <cm-smart-tip heading=\"Manage your own online store\" href=\"#/components/smart-tip\">Handle shipping, taxes, payments and more in one place.</cm-smart-tip>\n <cm-smart-tip heading=\"Shipping and delivery\" href=\"#/components/smart-tip\">Set rates and delivery areas.</cm-smart-tip>\n <cm-smart-tip heading=\"Importing and exporting products\" href=\"#/components/smart-tip\">Move products in and out with a CSV file.</cm-smart-tip>\n</cm-smart-tips>"}],"do":["Keep three to six tips, most useful first.","Write the title as the outcome: \"Shipping and delivery\".","Use `target=\"_blank\"` only for help-centre pages outside the admin."],"dont":["Don't put actions that change data in a tip: link to the page that does it.","Don't show the tour banner after the merchant has taken the tour."],"content":["Titles at most two short lines; descriptions one or two lines.","The section title is \"Smart tips\", in sentence case."],"accessibility":["Each tip is one link, so it is one tab stop and its name is the title plus description.","Tips form a list inside a section named by its heading.","Links opening a new tab say so to screen readers.","The tour icon is the system `rocket` icon; the tour banner uses `bg-panel-header`."],"related":["card","banner"]},{"tag":"cm-pagination","slug":"pagination","name":"Pagination","react":"Pagination","group":"Lists","summary":"Moves through a long list or table one page at a time.","lead":"A 48px bar under a list or table, in 13px text and tabular numbers: \"Number of rows\" on the left, what is showing in the middle, and \"Page [n] of N\" with compact 32px previous and next arrows on the right. On phones (640px or less) only the page field and arrows remain, 36px tall; on touch screens the fields and arrows are 44px. Since 1.6 (before: 14px text in a 52px bar).","docs_url":"https://commmerce.com/commmerceui/#components--pagination","properties":[{"attribute":"page","property":"page","type":"number","default":"1","description":"Current page, starting at 1."},{"attribute":"total","property":"total","type":"number","default":"0","description":"Total number of items across all pages. 0 hides the summary."},{"attribute":"page-size","property":"pageSize","type":"number","default":"20","description":"Items per page."},{"attribute":"page-sizes","property":"pageSizes","type":"number[]","default":"[10, 20, 50, 100]","description":"Choices for \"Number of rows\". Empty hides the picker. JSON in the attribute: `page-sizes=\"[10,20,50]\"`."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Change it when a page has two paginations. Default: the built-in string `label` (\"Pagination\")."},{"attribute":"resource-name","property":"resourceName","type":"string","default":"''","description":"Plural noun used in the summary, e.g. \"products\": \"Showing 21–40 of 290 products\"."},{"attribute":"_draft","property":"_draft","type":"string | null","default":"null"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"pageCount","description":"Number of pages, at least 1."}],"methods":[{"name":"goTo","description":"Moves to a page (clamped to 1…pageCount) and fires `cm-page-change` if it changed."}],"slots":[],"events":[{"name":"cm-page-change","description":"`detail: { page }` when the merchant asks for another page."},{"name":"cm-page-size-change","description":"`detail: { pageSize }` when rows per page changes. `page` resets to 1."}],"parts":[],"examples":[{"title":"Under a product list","html":"<cm-pagination total=\"290\" page=\"2\" page-size=\"20\" resource-name=\"products\"></cm-pagination>"},{"title":"Without rows per page","description":"Set `page-sizes=\"[]\"` when the page size is fixed.","html":"<cm-pagination total=\"58\" page-size=\"20\" page-sizes=\"[]\" style=\"max-width:480px\"></cm-pagination>"}],"do":["Listen for `cm-page-change` and `cm-page-size-change`, load that page, then set `page` and `total`.","Keep the merchant's page and rows per page in the URL so Back works.","Put it directly under the list it controls."],"dont":["Don't use it for fewer than one page of items: hide it.","Don't use it inside a modal or picker with a few items: let the list scroll."],"content":["Summary reads \"Showing 21–40 of 290 products\"; set `resource-name` to the plural noun.","Labels are \"Number of rows\" and \"Page … of …\"."],"accessibility":["It is a navigation landmark named \"Pagination\"; give each one a different `label` if a page has two.","The summary is a polite live region, so screen readers hear the new range after a page change.","The page field takes a number and commits on Enter or when it loses focus; out-of-range numbers are clamped. Escape restores the current page.","Arrows are real buttons named \"Previous page\" and \"Next page\", disabled at the ends.","The rows and page fields use the `border-input` edge (3:1 or more); the bar has no shadow of its own (put it in a card)."],"responsive":["When the window is 640px wide or less, rows per page and the \"Showing…\" summary are hidden: only the page field and the previous and next arrows remain, the arrows at either end, 36px tall instead of 32px.","On touch screens (any width) the fields and arrows are 44px."],"related":["resource-list","table-header","status-tabs"]},{"tag":"cm-status-tabs","slug":"status-tabs","name":"Status tabs","react":"StatusTabs","group":"Lists","summary":"Filters a list by status, with a count for each status.","lead":"Statuses in a 40px row of 14px medium labels, `space-24` apart, over a hairline. The chosen one is black and semibold with a 2px underline (black, or Commmerce blue in the refined look); the others are grey. A count sits after the label in a small neutral pill. `size=\"small\"` (13px, 32px row) is for view switches inside a card. Since 1.5 (before: 18px labels with counts in brackets).","docs_url":"https://commmerce.com/commmerceui/#components--status-tabs","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Value of the chosen tab. Defaults to the first tab."},{"attribute":"tabs","property":"tabs","type":"Array<string | StatusTab>","default":"[]","description":"Tabs as strings or `{ value, label, count, disabled }`. Used instead of `<option>` children when set."},{"attribute":"controls","property":"controls","type":"string","default":"''","description":"Id of the list or panel the tabs filter (in the same document or shadow root as the tabs). Each tab is linked to it\nwith ARIA element reflection (`ariaControlsElements`), since an `aria-controls` id cannot point out of a shadow root.\nBrowsers without element reflection skip the link."},{"attribute":"size","property":"size","type":"'large' | 'small'","default":"'large'","description":"`large` (the default: 14px labels, page-level statuses) or `small` (13px, tighter, inside a card, e.g. review sorting)."},{"attribute":"mobile","property":"mobile","type":"'scroll' | 'select'","default":"'scroll'","description":"What the tabs become on screens 640px wide or less: `scroll` (default: the row scrolls sideways, with a fade at the\nedge that has more tabs) or `select` (a dropdown of the same choices, with the counts; one control instead of a long\nrow). Since 1.6."},{"attribute":"_slotted","property":"_slotted","type":"StatusTab[]","default":"[]"},{"attribute":"_more","property":"_more","type":"string","default":"''","description":"Which edges have more tabs past them: '' | 'start' | 'end' | 'both'."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"StatusTab[]","description":"The tabs in use, normalised."}],"methods":[{"name":"focus","description":"Focuses the selected tab (or the dropdown, when `mobile=\"select\"` shows it)."}],"slots":[{"name":"(default)","description":"`<option value=\"…\" count=\"23\">Label</option>` elements. `disabled` and `selected` are honoured."}],"events":[{"name":"change","description":"When the merchant picks another status (a tab, or the dropdown). Read `value`."}],"parts":[],"examples":[{"title":"Order statuses","html":"<cm-status-tabs controls=\"order-list\">\n <option value=\"all\" count=\"233\">All</option>\n <option value=\"unprocessed\" count=\"23\" selected>Unprocessed</option>\n <option value=\"processing\" count=\"23\">Processing</option>\n <option value=\"fulfilled\" count=\"23\">Fulfilled</option>\n <option value=\"delivered\" count=\"23\">Delivered</option>\n <option value=\"returned\" count=\"23\">Returned</option>\n <option value=\"cancelled\" count=\"23\">Cancelled</option>\n</cm-status-tabs>"},{"title":"On phones: a dropdown","description":"`mobile=\"select\"` shows the statuses as a dropdown when the window is 640px wide or less (try a phone width); wider, it is the usual row. It fires the same `change` event. Use it when there are more than four or five statuses. Since 1.6.","html":"<cm-status-tabs mobile=\"select\" aria-label=\"Task status\">\n <option value=\"date\" count=\"4\" selected>Needs a date</option>\n <option value=\"week\" count=\"12\">This week</option>\n <option value=\"later\" count=\"40\">Later</option>\n <option value=\"lost\" count=\"2\">Not interested</option>\n <option value=\"archived\">Archived</option>\n</cm-status-tabs>"},{"title":"Small, inside a card","html":"<cm-card heading=\"Reviews\" style=\"max-width:420px\">\n <cm-status-tabs size=\"small\">\n <option value=\"newest\" count=\"233\">Newest</option>\n <option value=\"highest\" count=\"33\">Highest rating</option>\n <option value=\"lowest\">Lowest rating</option>\n </cm-status-tabs>\n</cm-card>"}],"do":["Put it directly above the list it filters and set `controls` to the list's id.","Start with \"All\".","Update counts when the list changes."],"dont":["Don't use it to move between pages: use links or a page header.","Don't use it for more than about eight statuses; use a filter instead.","Don't hide a status with zero items; show a count of 0."],"content":["One or two words per status, in sentence case.","Counts are whole numbers; they are formatted for the merchant's locale."],"accessibility":["It is an ARIA tab list: one tab stop, ←/→ move and select, Home/End jump to the ends. Disabled tabs are skipped.","Each tab's name includes its count, so screen readers hear \"Unprocessed, 23, tab, 2 of 7\".","The chosen tab is marked with `aria-selected`, not only colour and underline.","Differs from Figma: unselected tabs are `text-tertiary` (#707070) because Figma's #9E9E9E is 2.7:1 on white; Figma's mobile row is fixed width, ours scrolls sideways."],"responsive":["Tabs stay on one line; when they don't fit the component's width, the row scrolls sideways, snaps to a tab and fades out at the edge that has more tabs past it (since 1.6), so it reads as a row that scrolls.","When the window is 640px wide or less, tabs are `space-16` apart instead of `space-24`. With `mobile=\"select\"` they become a dropdown of the same choices (with counts) instead (since 1.6)."],"related":["resource-list","pagination","option-group"]},{"tag":"cm-table-header","slug":"table-header","name":"Table header","react":"TableHeader","group":"Lists","summary":"The grey label bar at the top of a table or list, with sorting and select all.","lead":"A 40px `bg-hover` bar with a `border-subtle` edge and rounded top corners, the heading row of the table standard. Column names are 12px semibold `text-tertiary`, in sentence case; with `selectable` a 20px select-all box leads the row. In a resource list the bar runs edge to edge with hairlines above and below, as tall as the list's selection row. Rows below share its grid through `--cm-table-columns`. Since 1.6 (before: 32px, 12px medium).","docs_url":"https://commmerce.com/commmerceui/#components--table-header","properties":[{"attribute":"columns","property":"columns","type":"Array<string | TableColumn>","default":"[]","description":"Columns as strings or `{ key, label, sortable, align, hidden }`. Used instead of `<option>` children when set."},{"attribute":"sort","property":"sort","type":"string","default":"''","description":"Key of the sorted column."},{"attribute":"direction","property":"direction","type":"'ascending' | 'descending'","default":"'ascending'","description":"Sort direction of the `sort` column."},{"attribute":"selectable","property":"selectable","type":"boolean","default":"false","description":"Adds a leading \"select all\" checkbox column."},{"attribute":"checked","property":"checked","type":"boolean","default":"false","description":"Select-all box is ticked."},{"attribute":"indeterminate","property":"indeterminate","type":"boolean","default":"false","description":"Select-all box shows a dash: some rows are selected."},{"attribute":"resource-rows","property":"resourceRows","type":"'plain' | 'selectable' | undefined","description":"Lines the columns up with `cm-resource-item` rows: `plain` matches the rows' padding, `selectable` also leaves\nroom for the rows' checkboxes. Set by `cm-resource-list` on a header in its `header` slot (from its own\n`selectable`); you don't need to set it. Unset (the default) is the standalone bar."},{"attribute":"_slotted","property":"_slotted","type":"TableColumn[]","default":"[]"},{"attribute":"_inTable","property":"_inTable","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"TableColumn[]","description":"The columns in use, normalised."}],"methods":[],"slots":[{"name":"(default)","description":"`<option value=\"key\" sortable align=\"end\">Label</option>` elements."}],"events":[{"name":"cm-sort","description":"`detail: { key, direction }` when a sortable column is clicked. Set `sort` and `direction` yourself."},{"name":"cm-select-all","description":"`detail: { checked }` when the select-all box is toggled."}],"parts":[],"examples":[{"title":"Products table","html":"<div role=\"table\" aria-label=\"Products\" style=\"--cm-table-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr 80px\">\n <cm-table-header sort=\"price\">\n <option value=\"product\" sortable>Product</option>\n <option value=\"sku\">SKU</option>\n <option value=\"code\">Code</option>\n <option value=\"price\" sortable>Selling price</option>\n <option value=\"stock\" sortable>Stock</option>\n <option value=\"category\">Category</option>\n <option value=\"status\">Status</option>\n <option value=\"action\" align=\"end\">Action</option>\n </cm-table-header>\n</div>"},{"title":"With select all, on a phone","html":"<div role=\"table\" aria-label=\"Products\" style=\"max-width:384px;--cm-table-columns: 2fr 1fr 1fr 1fr\">\n <cm-table-header selectable indeterminate>\n <option>Product name</option><option>SKU</option><option>Code</option><option align=\"end\">Price</option>\n </cm-table-header>\n</div>"},{"title":"In a resource list","description":"Put it in the `header` slot of a `cm-resource-list` and give each row `columns`, with one element per column. The list lines the headings up with the cells, leaving room for the rows' checkboxes when it is `selectable`. Don't set `selectable` on the header here: the list puts its own select-all box in the header's checkbox column. The headings form a plain bar (the rows are a list, not a table), and sort buttons say their state.","html":"<cm-resource-list selectable resource-name=\"lead\" style=\"--cm-table-columns: 1.4fr 1.2fr 1fr 110px\">\n <cm-table-header slot=\"header\" sort=\"name\">\n <option value=\"name\" sortable>Name</option><option value=\"company\">Company</option><option value=\"owner\">Owner</option><option value=\"status\">Status</option>\n </cm-table-header>\n <cm-resource-item value=\"l1\" label=\"Asha Rao\" columns><strong>Asha Rao</strong><span>Rao Textiles</span><span>Rahul Kumar</span><span><cm-badge tone=\"information\">New</cm-badge></span></cm-resource-item>\n <cm-resource-item value=\"l2\" label=\"Ben Cole\" columns><strong>Ben Cole</strong><span>Cole &amp; Sons</span><span>Meera Iyer</span><span><cm-badge tone=\"success\">Contacted</cm-badge></span></cm-resource-item>\n</cm-resource-list>"}],"do":["Put it inside an element with `role=\"table\"` (or a `<table>` wrapper) so it becomes a real header row.","Set `--cm-table-columns` once on the table and use the same grid for the rows, with `column-gap: var(--cm-space-20)` and `min-width: 0` on the cells (or `fr` columns written `minmax(0, 1fr)`).","Above a `cm-resource-list`, put it in the list's `header` slot and set `columns` on the rows: the list lines everything up, checkbox column included.","Listen for `cm-sort`, sort the data, then set `sort` and `direction`."],"dont":["Don't make every column sortable: only those merchants scan by (name, price, stock, date).","Don't leave an icon-only column unnamed: add an option with `hidden` so screen readers hear \"Actions\".","Don't set `selectable` on a header inside a selectable `cm-resource-list`: there would be two select-all boxes. The list already puts one in the header's checkbox column.","Don't use the rows' `actions` or `media` slots with column headings: put buttons and thumbnails in a column instead, so the grid stays the same width as the header."],"content":["Column names in sentence case, one or two words: \"Selling price\", not \"Selling Price\"."],"accessibility":["Inside a table it renders `row` and `columnheader` roles; sorted columns carry `aria-sort`.","Outside a table it is a plain bar and sort buttons say \"sortable\" or \"sorted ascending/descending\".","The select-all box is named \"Select all\" and shows a mixed state when some rows are selected.","In a `cm-resource-list` it stays a plain bar: the rows are a list of resources, not table rows, so the headings are a visual guide and each row's checkbox and link carry its name.","The fill is `bg-hover`; sort arrows appear on hover and on the sorted column."],"related":["resource-list","pagination","checkbox","data-table"]},{"tag":"cm-data-table","slug":"data-table","name":"Data table","react":"DataTable","group":"Lists","summary":"Shows numbers and facts in rows and columns, for reports and lists of records.","lead":"A real table built to the Commmerce table standard (since 1.6): a 40px heading row in 12px semibold `text-tertiary` on `bg-hover`; 48px body rows (40px compact) divided by `border-subtle` lines; cells padded 12px across and 10px down in 13px text and tabular figures. `numeric`, `money` and `actions` columns are right-aligned, numbers and dates never wrap, and text ends in \"…\" with the full value on hover. Columns can sort, resize and be shown or hidden; rows can carry actions; the heading row can stick while the page scrolls; and on phones each table picks cards, sideways scroll or priority columns.","docs_url":"https://commmerce.com/commmerceui/#components--data-table","properties":[{"attribute":"columns","property":"columns","type":"DataTableColumn[]","default":"[]","description":"The columns, in order."},{"attribute":"rows","property":"rows","type":"DataTableRow[]","default":"[]","description":"The rows: objects keyed by column `key`. Values are shown as text."},{"attribute":"totals","property":"totals","type":"DataTableRow | null","default":"null","description":"A totals row shown at the bottom (`<tfoot>`), keyed like a row. Leave a key out for an empty cell."},{"attribute":"caption","property":"caption","type":"string","default":"''","description":"What the table shows, e.g. \"Sales by day\". Every table needs one; it names the table for screen readers."},{"attribute":"caption-hidden","property":"captionHidden","type":"boolean","default":"false","description":"Keeps the caption for screen readers but hides it, when a card or page heading already says it."},{"attribute":"sort","property":"sort","type":"string","default":"''","description":"Key of the sorted column. Empty: rows stay in the order given."},{"attribute":"direction","property":"direction","type":"SortDirection","default":"'ascending'","description":"Direction of the sorted column."},{"attribute":"sort-mode","property":"sortMode","type":"'auto' | 'manual'","default":"'auto'","description":"`auto`: the table sorts its own rows. `manual`: it only fires `cm-sort` (sort on your server, then set `rows`)."},{"attribute":"sticky-header","property":"stickyHeader","type":"boolean","default":"false","description":"Keeps the heading row in view while the rows scroll: inside `--cm-data-table-max-height` when you set one,\notherwise under the top of the page or of the nearest scrolling box (plus `--cm-data-table-sticky-top`)."},{"attribute":"sticky-first-column","property":"stickyFirstColumn","type":"boolean","default":"false","description":"Keeps the first column visible while the table scrolls sideways (on narrow screens)."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows placeholder rows and marks the table busy."},{"attribute":"loading-rows","property":"loadingRows","type":"number","default":"5","description":"How many placeholder rows `loading` shows."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height (since 1.6): `comfortable` 48px rows or `compact` 40px rows. Unset: the nearest `data-cm-density` on an\nancestor, else comfortable. On touch screens rows are at least 44px tall either way."},{"attribute":"mobile","property":"mobile","type":"'scroll' | 'cards' | 'priority'","default":"'scroll'","description":"What the table does when it is 640px wide or less (since 1.6): `scroll` keeps every column, scrolls sideways and\nsays so (\"Scroll for more\", faded edges); `cards` shows each row as a card of label and value pairs with the primary\ncolumn as its title and the actions at the bottom; `priority` hides `priority: 'low'` columns and gives each row a\n\"View all fields\" button that shows them. Pick one per table: see the \"Tables on phones\" pattern."},{"attribute":"row-actions","property":"rowActions","type":"'hover' | 'always'","default":"'hover'","description":"`hover` (default): an `actions` column's buttons appear when the row is hovered or has focus (always on touch screens). `always`: always shown."},{"attribute":"resizable","property":"resizable","type":"boolean","default":"false","description":"Adds a resize handle to each heading: drag it, or focus it and press the left and right arrow keys (16px a press)."},{"attribute":"column-picker","property":"columnPicker","type":"boolean","default":"false","description":"Adds a \"Columns\" button above the table that shows and hides columns."},{"attribute":"_light","property":"_light","type":"boolean","default":"false"},{"attribute":"_announce","property":"_announce","type":"string","default":"''"},{"attribute":"_widths","property":"_widths","type":"Record<string, number>","default":"{}"},{"attribute":"_expanded","property":"_expanded","default":"new Set<DataTableRow>()"},{"attribute":"_picker","property":"_picker","type":"boolean","default":"false"},{"attribute":"_overflows","property":"_overflows","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"sortedRows","type":"DataTableRow[]","description":"The rows in display order: sorted when `sort` is set and `sort-mode` is `auto`."},{"property":"visibleColumns","type":"DataTableColumn[]","description":"The columns shown: every column whose `visible` isn't `false`."}],"methods":[],"slots":[{"name":"(default)","description":"Optional: a native `<table>` to style instead of `columns`/`rows`."},{"name":"empty","description":"Shown instead of the rows when `rows` is empty, e.g. a `cm-empty-state`."}],"events":[{"name":"cm-row-action","description":"`detail: { action, row, index }` when a button in an `actions` column is pressed: the action's `value`, the row object and its index in `rows`."},{"name":"cm-column-resize","description":"`detail: { key, width }` when the merchant resizes a column (`resizable`), in pixels. Store it and pass it back as the column's `width`."},{"name":"cm-columns-change","description":"`detail: { key, visible, columns }` when the merchant shows or hides a column with the column picker. `columns` is the new array (the table has already switched to it); store it to keep the choice."},{"name":"cm-sort","description":"`detail: { key, direction }` when a sortable heading is clicked. Cancelable: call `preventDefault()` to stop the table sorting itself. With `sort-mode=\"manual\"` it never sorts itself."}],"parts":[],"examples":[{"title":"Sales report with totals","description":"Give it `columns`, `rows` and `totals`. `numeric` and `money` columns align right; sortable columns sort themselves.","html":"<cm-data-table caption=\"Sales by day, 1 to 5 November\" sort=\"day\"\n columns='[{\"key\":\"day\",\"label\":\"Day\",\"type\":\"date\",\"sortable\":true},{\"key\":\"orders\",\"label\":\"Orders\",\"type\":\"numeric\",\"sortable\":true},{\"key\":\"items\",\"label\":\"Items sold\",\"type\":\"numeric\"},{\"key\":\"sales\",\"label\":\"Net sales\",\"type\":\"money\",\"sortable\":true}]'\n rows='[{\"day\":\"2026-11-01\",\"orders\":38,\"items\":61,\"sales\":\"Rs. 48,210\"},{\"day\":\"2026-11-02\",\"orders\":45,\"items\":70,\"sales\":\"Rs. 56,980\"},{\"day\":\"2026-11-03\",\"orders\":29,\"items\":41,\"sales\":\"Rs. 33,150\"},{\"day\":\"2026-11-04\",\"orders\":52,\"items\":88,\"sales\":\"Rs. 71,400\"},{\"day\":\"2026-11-05\",\"orders\":41,\"items\":66,\"sales\":\"Rs. 52,075\"}]'\n totals='{\"day\":\"Total\",\"orders\":205,\"items\":326,\"sales\":\"Rs. 2,61,815\"}'></cm-data-table>"},{"title":"Accounts with row actions","description":"An `actions` column (`type: \"actions\"`) lists buttons for every row; they appear when the row is hovered or has keyboard focus, and are always shown on touch screens (`row-actions=\"always\"` shows them everywhere). Each button is named with its row for screen readers (\"Open, Ravi Stores\") and fires `cm-row-action` with the action, the row and its index. The long account name ends in \"…\": hover it to read it all.","html":"<cm-data-table caption=\"Accounts up for renewal\"\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true,\"width\":220},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\",\"sortable\":true},{\"key\":\"actions\",\"label\":\"Actions\",\"type\":\"actions\",\"actions\":[{\"label\":\"Open\",\"value\":\"open\"},{\"label\":\"Snooze\",\"value\":\"snooze\",\"icon\":\"clock\",\"iconOnly\":true}]}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>"},{"title":"Comfortable and compact density","description":"Rows are 48px (comfortable) or 40px (compact); the heading row stays 40px. Set `density` on one table, or `data-cm-density` on any ancestor to switch every table and resource list on a screen. Try the switch.","html":"<div style=\"display:grid;gap:var(--cm-space-16)\">\n <cm-segmented-control size=\"small\" label=\"Density\" data-density-for=\"density-demo\">\n <option value=\"comfortable\" selected>Comfortable</option>\n <option value=\"compact\">Compact</option>\n </cm-segmented-control>\n <div id=\"density-demo\" data-cm-density=\"comfortable\" style=\"display:grid;gap:var(--cm-space-16)\">\n <cm-data-table caption=\"Accounts\" caption-hidden\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>\n <cm-resource-list resource-name=\"account\">\n <cm-resource-item value=\"a1\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Ravi Stores</cm-resource-item>\n <cm-resource-item value=\"a2\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Delhi Spice Co.</cm-resource-item>\n </cm-resource-list>\n </div>\n</div>"},{"title":"Sticky heading row in a 400px box","description":"`sticky-header` keeps the headings in view under the top of the nearest scrolling box, or of the page when nothing else scrolls (add `--cm-data-table-sticky-top` to stick under an app header). Scroll the box. To scroll inside the table itself, set `--cm-data-table-max-height`.","html":"<div tabindex=\"0\" role=\"region\" aria-label=\"Renewals, scrolling\" style=\"height:400px;overflow:auto;border:var(--cm-border-1) solid var(--cm-border-subtle);border-radius:var(--cm-radius-md);padding-inline:var(--cm-space-8)\">\n <cm-data-table caption=\"All renewals\" sticky-header\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 12,750\"},{\"name\":\"Blue Pottery House\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-02\",\"value\":\"Rs. 17,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-03\",\"value\":\"Rs. 21,250\"},{\"name\":\"Mumbai Mart\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-04\",\"value\":\"Rs. 25,500\"},{\"name\":\"Pune Paper Co.\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-05\",\"value\":\"Rs. 29,750\"},{\"name\":\"Goa Gifts\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-06\",\"value\":\"Rs. 34,000\"},{\"name\":\"Surat Silks\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-07\",\"value\":\"Rs. 38,250\"},{\"name\":\"Indore Snacks\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-08\",\"value\":\"Rs. 42,500\"},{\"name\":\"Nagpur Oranges\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 46,750\"},{\"name\":\"Agra Leather\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-10\",\"value\":\"Rs. 51,000\"},{\"name\":\"Vizag Seafoods\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-11\",\"value\":\"Rs. 55,250\"},{\"name\":\"Hubli Cottons\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-12\",\"value\":\"Rs. 59,500\"},{\"name\":\"Kochi Coir Works\",\"owner\":\"Asha Rao\",\"renewal\":\"2026-12-13\",\"value\":\"Rs. 63,750\"},{\"name\":\"Mysuru Silk House\",\"owner\":\"Meera Iyer\",\"renewal\":\"2026-12-14\",\"value\":\"Rs. 68,000\"},{\"name\":\"Patna Pickles\",\"owner\":\"Rahul Kumar\",\"renewal\":\"2026-12-15\",\"value\":\"Rs. 72,250\"},{\"name\":\"Ranchi Crafts\",\"owner\":\"Ben Cole\",\"renewal\":\"2026-12-16\",\"value\":\"Rs. 76,500\"}]'></cm-data-table>\n</div>"},{"title":"Resize and choose columns","description":"`resizable` adds a handle to each heading: drag it, or focus it (Tab) and press ← and → to change the width 16px at a time; each change is announced and fires `cm-column-resize`. `column-picker` adds a Columns button that shows and hides columns (`visible: false` starts one hidden) and fires `cm-columns-change` with the new `columns`; store both to keep the merchant's layout.","html":"<cm-data-table caption=\"Accounts\" resizable column-picker\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"width\":200},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"stage\",\"label\":\"Stage\",\"visible\":false},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>"},{"title":"On a phone: cards","description":"`mobile=\"cards\"`: at 640px or less (the table's own width; here a 390px box) each row becomes a card: the primary column is its title, the other columns label and value pairs, and the actions sit at the bottom, always visible. Use it for short lists people act on, one record at a time.","html":"<div style=\"max-width:390px\">\n <cm-data-table caption=\"At risk\" mobile=\"cards\"\n columns='[{\"key\":\"name\",\"label\":\"Account\",\"sortable\":true},{\"key\":\"owner\",\"label\":\"Owner\"},{\"key\":\"stage\",\"label\":\"Stage\",\"priority\":\"low\"},{\"key\":\"renewal\",\"label\":\"Renewal\",\"type\":\"date\",\"sortable\":true},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\",\"sortable\":true},{\"key\":\"actions\",\"label\":\"Actions\",\"type\":\"actions\",\"actions\":[{\"label\":\"Open\",\"value\":\"open\"},{\"label\":\"Snooze\",\"value\":\"snooze\"}]}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>\n</div>"},{"title":"On a phone: scroll","description":"`mobile=\"scroll\"` (the default) keeps every column and scrolls sideways, and says so: the far edge fades and \"Scroll for more\" shows under the table until the end is reached. `sticky-first-column` keeps each row's name in view. Use it when people compare across columns.","html":"<div style=\"max-width:390px\">\n <cm-data-table caption=\"Team\" mobile=\"scroll\" sticky-first-column\n columns='[{\"key\":\"name\",\"label\":\"Name\"},{\"key\":\"role\",\"label\":\"Role\"},{\"key\":\"region\",\"label\":\"Region\"},{\"key\":\"accounts\",\"label\":\"Accounts\",\"type\":\"numeric\"},{\"key\":\"visits\",\"label\":\"Visits this month\",\"type\":\"numeric\"},{\"key\":\"last\",\"label\":\"Last active\",\"type\":\"date\"}]'\n rows='[{\"name\":\"Asha Rao\",\"role\":\"Field sales\",\"region\":\"Bengaluru\",\"accounts\":42,\"visits\":18,\"last\":\"2026-11-16\"},{\"name\":\"Meera Iyer\",\"role\":\"Account manager\",\"region\":\"Chennai\",\"accounts\":35,\"visits\":11,\"last\":\"2026-11-15\"},{\"name\":\"Rahul Kumar\",\"role\":\"Field sales\",\"region\":\"Delhi\",\"accounts\":51,\"visits\":22,\"last\":\"2026-11-17\"}]'></cm-data-table>\n</div>"},{"title":"On a phone: priority columns","description":"`mobile=\"priority\"` hides columns marked `priority: \"low\"` at 640px or less, and gives each row a \"View all fields\" button that shows them under the row. Use it when two or three columns tell most of the story.","html":"<div style=\"max-width:390px\">\n <cm-data-table caption=\"Renewals\" mobile=\"priority\"\n columns='[{\"key\":\"name\",\"label\":\"Account\"},{\"key\":\"owner\",\"label\":\"Owner\",\"priority\":\"low\"},{\"key\":\"stage\",\"label\":\"Stage\",\"priority\":\"low\"},{\"key\":\"value\",\"label\":\"Value\",\"type\":\"money\"}]'\n rows='[{\"name\":\"Ravi Stores\",\"owner\":\"Asha Rao\",\"stage\":\"Renewal call booked\",\"renewal\":\"2026-12-01\",\"value\":\"Rs. 48,000\"},{\"name\":\"Blue Pottery House, Jaipur and Udaipur showrooms\",\"owner\":\"Meera Iyer\",\"stage\":\"Waiting for the owner\",\"renewal\":\"2026-12-09\",\"value\":\"Rs. 1,20,000\"},{\"name\":\"Delhi Spice Co.\",\"owner\":\"Rahul Kumar\",\"stage\":\"Asked for a discount\",\"renewal\":\"2027-01-15\",\"value\":\"Rs. 9,500\"}]'></cm-data-table>\n</div>"},{"title":"Inside a card, wide on a phone","description":"The card heading names the table, so the caption is kept for screen readers only. `sticky-first-column` keeps the location in view while the merchant scrolls sideways.","html":"<cm-card heading=\"Stock by location\" flush style=\"max-width:384px\">\n <cm-data-table caption=\"Stock by location\" caption-hidden sticky-first-column\n columns='[{\"key\":\"location\",\"label\":\"Location\",\"sortable\":true},{\"key\":\"on_hand\",\"label\":\"On hand\",\"type\":\"numeric\",\"sortable\":true},{\"key\":\"committed\",\"label\":\"Committed\",\"type\":\"numeric\"},{\"key\":\"available\",\"label\":\"Available\",\"type\":\"numeric\"},{\"key\":\"incoming\",\"label\":\"Incoming\",\"type\":\"numeric\"}]'\n rows='[{\"location\":\"Bengaluru warehouse\",\"on_hand\":240,\"committed\":32,\"available\":208,\"incoming\":100},{\"location\":\"Indiranagar store\",\"on_hand\":18,\"committed\":2,\"available\":16,\"incoming\":0},{\"location\":\"Koramangala store\",\"on_hand\":7,\"committed\":0,\"available\":7,\"incoming\":24}]'></cm-data-table>\n</cm-card>"},{"title":"Server-rendered table","description":"In PHP or EJS, write a native `<table>` inside it and it is styled to match. Mark number cells with `data-type=\"numeric\"`. Add `data-sort=\"text|numeric|money|date\"` to a heading to let the merchant sort that column in the browser; give cells a `data-value` when their text is formatted (money, dates). Use `sort-mode=\"manual\"` to sort on the server instead. The phone strategies work here too: cells get their heading as a label for `mobile=\"cards\"`, and headings marked `data-priority=\"low\"` hide with `mobile=\"priority\"` (link each row to its record instead of View all fields). Mark an actions column `data-type=\"actions\"`.","html":"<cm-data-table mobile=\"cards\">\n <table>\n <caption>Order lines</caption>\n <thead><tr><th scope=\"col\" data-sort=\"text\">Product</th><th scope=\"col\" data-sort=\"numeric\">Quantity</th><th scope=\"col\" data-sort=\"money\">Amount</th></tr></thead>\n <tbody>\n <tr><td>Ceramic mug</td><td data-type=\"numeric\">2</td><td data-type=\"money\" data-value=\"798\">Rs. 798</td></tr>\n <tr><td>Linen apron</td><td data-type=\"numeric\">1</td><td data-type=\"money\" data-value=\"1250\">Rs. 1,250</td></tr>\n </tbody>\n <tfoot><tr><td>Total</td><td data-type=\"numeric\">3</td><td data-type=\"money\">Rs. 2,048</td></tr></tfoot>\n </table>\n</cm-data-table>"}],"do":["Use it for reports and lists of records: sales by day, stock by location, accounts, tasks, renewals.","Give every table a `caption`; hide it with `caption-hidden` when a heading above already says it.","Use `numeric` or `money` for numbers so they line up, and `date` for dates so they sort and never wrap.","Pick a phone strategy for every table (`mobile`) and say why in the review: see Tables on phones.","Put row buttons in an `actions` column (one or two short verbs) so they line up at the end and appear on hover and focus.","Store `cm-column-resize` and `cm-columns-change` (for example per user) and pass the widths and `visible` flags back in `columns`.","With thousands of rows, sort on the server: `sort-mode=\"manual\"`, listen for `cm-sort`, then set `rows`.","For long text such as notes or a list of signals, set `lines: 2` (or 3) on the column so rows stay compact: the text wraps onto up to that many lines and ends in \"…\", with the full value on hover. In a server-rendered table, put `data-lines=\"1\"` to `\"4\"` on any element inside a cell (for a list of signals, one per item: `<li><div data-lines=\"1\">…</div></li>`); one-line items are capped at `--cm-data-table-cell-max-width` (320px)."],"dont":["Don't use it for lists merchants select and act on in bulk (products, orders, customers): use Resource list, which has selection and bulk actions.","Don't put more than two buttons in a row: link the row to its record for everything else.","Don't make every column sortable: only those merchants scan by.","Don't mix densities on one screen: set `data-cm-density` once on the page.","Don't hide the column that names the rows: the column picker keeps the primary column."],"content":["Column headings in sentence case, one or two words: \"Net sales\", not \"NET SALES\".","Write money the same way in every row and in the totals (\"Rs. 1,250\").","Label the totals row \"Total\"."],"accessibility":["A native `<table>`: a caption, column headers with `scope=\"col\"` and the first cell of each row as a row header, so screen readers read \"Bengaluru warehouse, Available, 208\".","Text cut off with \"…\" is cut off visually only: screen readers read the whole value, and the mouse shows it on hover.","Row actions are hidden with opacity only: they stay in the tab order and the accessibility tree, show as soon as the row has focus, and are always visible on touch screens and in forced colours. Each is named with its row (\"Open, Ravi Stores\").","Resize handles are focusable separators named \"Resize Owner column\" with the width as their value; ← and → change it by 16px (mirrored in right-to-left) and the new width is announced.","The column picker is a button with `aria-expanded` that opens a group of checkboxes (\"Show columns\"); Esc closes it and returns focus to the button.","Cards (`mobile=\"cards\"`) are a list named by the caption, with each field as a term and value. \"View all fields\" is a button with `aria-expanded` that controls the row of extra fields.","\"Scroll for more\" and the faded edges are visual only; a table that scrolls sideways is a focusable region named by its caption, so keyboard users can scroll it.","Sortable headings are buttons inside the column header, which carries `aria-sort`. Every sort is also announced politely (\"Sorted by Orders, descending\"), because screen readers don't reliably read `aria-sort` changes; in `manual` mode the announcement waits until you set `sort` and `direction`.","Cell values are always shown as text, never as HTML.","A table with a sticky header or first column scrolls in a focusable region named by its caption, so keyboard users can scroll it.","While `loading`, the table is `aria-busy` and the placeholders are hidden from screen readers."],"responsive":["Judged by the table's own width, not the window's: at 640px or less the table follows its `mobile` strategy. `scroll` (default): it keeps every column and scrolls sideways, with a faded edge and \"Scroll for more\" under it while there is more to see. `cards`: each row becomes a card. `priority`: `priority: 'low'` columns are hidden and each row gets \"View all fields\". See Tables on phones.","With `sticky-first-column`, the first column stays visible while the table scrolls sideways.","On touch screens rows are at least 44px tall and row actions are always shown."],"related":["resource-list","table-header","pagination","empty-state"]},{"tag":"cm-resource-list","slug":"resource-list","name":"Resource list","react":"ResourceList","group":"Lists","summary":"Lists products, orders or customers, with bulk selection and actions.","lead":"56px rows with a 16px checkbox, an optional 40px thumbnail and 14px text, divided by `border-subtle` lines; `density=\"compact\"` (or `data-cm-density=\"compact\"` on any ancestor) makes them 40px with a 32px thumbnail. Hovered and selected rows turn `bg-hover`. A selectable list starts with a 40px header row (32px before 1.6), as tall as a table's heading row: the select-all box, lined up with the rows' checkboxes, and a small chevron menu (this page, all matching, none). Once rows are ticked the same row shows \"2 products selected\", a link to select every match and the bulk actions; nothing is added above the list. With a `cm-table-header` in the `header` slot, the header is that row: the box sits in its checkbox column and the selection covers the column names while rows are ticked. Since 1.5 (before: a 40px bordered Select button on a row of its own).","docs_url":"https://commmerce.com/commmerceui/#components--resource-list","properties":[{"attribute":"selectable","property":"selectable","type":"boolean","default":"false","description":"Rows get checkboxes and the selection toolbar appears."},{"attribute":"total","property":"total","type":"number","default":"0","description":"Number of resources matching the current filter across all pages. When higher than the rows shown, offers \"Select all\"."},{"attribute":"resource-name","property":"resourceName","type":"string","description":"Singular noun, e.g. \"product\". Default: the built-in string `resourceName` (\"item\")."},{"attribute":"resource-name-plural","property":"resourceNamePlural","type":"string","default":"''","description":"Plural noun. Defaults to the singular plus \"s\" (or the built-in `resourceNamePlural`, \"items\", when `resource-name` isn't set)."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Dims the rows and shows a spinner while results load."},{"attribute":"all-selected","property":"allSelected","type":"boolean","default":"false","description":"Every matching resource is selected, not just the rows on this page."},{"attribute":"hide-select-menu","property":"hideSelectMenu","type":"boolean","default":"false","description":"Hides the menu next to the select box (select this page, select all matching, select none)."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name of the list, e.g. \"Products\". Defaults to the plural noun."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height (since 1.6): `comfortable` 56px rows with 40px thumbnails, or `compact` 40px rows with 32px thumbnails.\nUnset: the nearest `data-cm-density` on an ancestor, else comfortable. On touch screens rows are at least 44px tall."},{"attribute":"mobile","property":"mobile","type":"'columns' | 'stack'","default":"'columns'","description":"How rows with `columns` (and a `cm-table-header` in the `header` slot) lay out on phones, 640px or less (since 1.13).\n`columns` (default): every column stays on the row's one line. `stack`: each row's first cell gets a line of its\nown and the other cells follow on the next line; the header's column names wrap the same way, so sorting still works.\nUse `stack` when the columns can't fit a phone."},{"attribute":"_count","property":"_count","type":"number","default":"0"},{"attribute":"_rows","property":"_rows","type":"number","default":"0"},{"attribute":"_hasHeader","property":"_hasHeader","type":"boolean","default":"false"},{"attribute":"_hasTable","property":"_hasTable","type":"boolean","default":"false"},{"attribute":"_hasActions","property":"_hasActions","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"CmResourceItem[]","description":"The `cm-resource-item` rows."},{"property":"selected","type":"string[]","description":"Values of the selected rows on this page."}],"methods":[{"name":"selectPage","description":"Ticks or unticks every enabled row on this page."},{"name":"selectAll","description":"Selects every matching resource (`total`), including rows on other pages."},{"name":"clearSelection","description":"Clears the selection."}],"slots":[{"name":"(default)","description":"`cm-resource-item` rows."},{"name":"header","description":"A `cm-table-header` (or anything) above the rows. A `cm-table-header` here is lined up with the rows, checkbox column included, and shares its row with the select-all box."},{"name":"bulk-actions","description":"Buttons that act on the selection, e.g. \"Bulk orders\". Shown once a row is selected, in the header row: use `size=\"slim\"` buttons (32px, in the 40px row)."},{"name":"actions","description":"Buttons at the end of the header row, e.g. \"Customise columns\". With a slotted header they get a row of their own above it."},{"name":"empty","description":"Shown instead of the rows when there are none, e.g. a `cm-empty-state`."}],"events":[{"name":"cm-selection-change","description":"`detail: { selected, all }`: values of the selected rows, and whether every matching resource (all `total`) is selected."}],"parts":[{"tag":"cm-resource-item","react":"ResourceItem","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the row in the list's `selected` array."},{"attribute":"selected","property":"selected","type":"boolean","default":"false","description":"The row is ticked."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"The row cannot be selected or opened."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the row a link to the resource's page."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Name for the checkbox and link, e.g. the product name. Defaults to the row's text."},{"attribute":"selectable","property":"selectable","type":"boolean","default":"false","description":"Shows the checkbox. Set by the parent list from its own `selectable`."},{"attribute":"columns","property":"columns","type":"boolean","default":"false","description":"Lays the row's content out on the `--cm-table-columns` grid (set it on the list), one child element per column,\n`space-20` apart: the same grid as a `cm-table-header` in the list's `header` slot, so cells sit under their headings."},{"attribute":"mobile","property":"mobile","type":"'stack' | undefined","description":"With `columns`, how the row lays out on phones (640px or less). Set by the parent list from its own `mobile`.\n`stack`: the first cell gets a line of its own and the other cells follow on the next line, side by side.\nUnset: the columns stay on one line."},{"attribute":"actions","property":"actions","type":"'auto' | 'wrap' | 'inline'","default":"'auto'","description":"How the `actions` slot behaves when the row gets narrow (issue #31, since 1.6). `auto` (default): on phones (640px or\nless) the buttons wrap onto their own line under the content once the content would get narrower than 12rem.\n`wrap`: the same at any width. `inline`: the buttons always stay on the content's line (the 1.5 behaviour).\nRows with `columns` keep their actions inline unless `actions=\"wrap\"`."},{"attribute":"_hasActions","property":"_hasActions","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"name","description":"Accessible name: `label` or the row's text."}],"methods":[{"name":"toggle","description":"Ticks or unticks the row and fires `cm-resource-select`."}],"slots":[{"name":"(default)","description":"Row content: name, details, badges. To line up with a `cm-table-header`, set `columns` and give one element per column."},{"name":"media","description":"A 40px thumbnail (32px on phones and in compact rows): a `cm-thumbnail` (recommended; `alt=\"\"` when the row names the product), an `<img>`, or a `cm-icon` (centred in the square, for settings and navigation lists)."},{"name":"actions","description":"Buttons at the end of the row. They do not toggle selection. When the row is too narrow for the content and the buttons (the content would get narrower than 12rem), they wrap onto a line of their own under the content, at the start: on phones (640px or less) by default, at any width with `actions=\"wrap\"` (issue #31)."}],"events":[{"name":"cm-resource-select","description":"`detail: { value, selected }` when the merchant ticks or unticks the row. The list handles it."}]}],"examples":[{"title":"Selectable, with bulk actions","html":"<cm-resource-list selectable total=\"15000\" resource-name=\"product\">\n <cm-button slot=\"bulk-actions\" size=\"slim\">Bulk orders</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Customise columns</cm-button>\n <cm-resource-item value=\"p1\" selected>New normal modern classic darkness T-shirt</cm-resource-item>\n <cm-resource-item value=\"p2\" selected>Linen overshirt, sand</cm-resource-item>\n <cm-resource-item value=\"p3\">Canvas tote bag</cm-resource-item>\n <cm-resource-item value=\"p4\">Cotton socks, 3 pairs</cm-resource-item>\n</cm-resource-list>"},{"title":"With thumbnails and links","html":"<cm-resource-list resource-name=\"product\" style=\"max-width:520px\">\n <cm-resource-item value=\"p1\" href=\"#/components/resource-list\" label=\"Ceramic mug\">\n <cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>\n Ceramic mug<br><small style=\"color:var(--cm-text-tertiary)\">24 in stock</small>\n </cm-resource-item>\n <cm-resource-item value=\"p2\" href=\"#/components/resource-list\" label=\"Linen napkins\">\n <cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>\n Linen napkins<br><small style=\"color:var(--cm-text-tertiary)\">Out of stock</small>\n </cm-resource-item>\n</cm-resource-list>"},{"title":"Row buttons on phones","description":"Buttons in a row's `actions` slot wrap onto their own line under the content when the content would get narrower than 12rem: on phones (640px or less) by default, at any width with `actions=\"wrap\"` (as here), never with `actions=\"inline\"`. Since 1.6 (issue #31).","html":"<cm-resource-list resource-name=\"task\" style=\"max-width:420px\">\n <cm-resource-item value=\"t1\" actions=\"wrap\"><strong>Ravi Stores</strong><div>Called 12 Nov, no answer</div>\n <cm-button slot=\"actions\" size=\"slim\">Call</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Details</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Set date</cm-button>\n <cm-button slot=\"actions\" size=\"slim\" tone=\"critical\">Not interested</cm-button>\n </cm-resource-item>\n <cm-resource-item value=\"t2\" actions=\"wrap\"><strong>Asha Textiles</strong><div>Visited 10 Nov</div>\n <cm-button slot=\"actions\" size=\"slim\">Call</cm-button>\n </cm-resource-item>\n</cm-resource-list>"},{"title":"With column headings","description":"A `cm-table-header` in the `header` slot, `--cm-table-columns` on the list and `columns` on each row, one element per column. The list lines the headings up with the cells and puts its select-all box in the header's checkbox column. Tick a row: the selection status and bulk actions cover the column names until the selection is cleared.","html":"<cm-resource-list selectable total=\"128\" resource-name=\"lead\" style=\"--cm-table-columns: 1.6fr 1.4fr 1.8fr 1.2fr 1.1fr 1fr 110px\">\n <cm-button slot=\"bulk-actions\" size=\"slim\">Assign owner</cm-button>\n <cm-table-header slot=\"header\" sort=\"created\" direction=\"descending\">\n <option value=\"name\" sortable>Name</option>\n <option value=\"company\">Company</option>\n <option value=\"email\">Email</option>\n <option value=\"phone\">Phone</option>\n <option value=\"owner\">Owner</option>\n <option value=\"created\" sortable>Created</option>\n <option value=\"status\">Status</option>\n </cm-table-header>\n <cm-resource-item value=\"l1\" label=\"Asha Rao\" columns>\n <strong>Asha Rao</strong><span>Rao Textiles</span><span>asha@raotextiles.in</span><span>98450 12345</span><span>Rahul Kumar</span><span>16 Nov</span><span><cm-badge tone=\"information\">New</cm-badge></span>\n </cm-resource-item>\n <cm-resource-item value=\"l2\" label=\"Ben Cole\" columns>\n <strong>Ben Cole</strong><span>Cole &amp; Sons</span><span>ben@coleandsons.com</span><span>99001 55432</span><span>Meera Iyer</span><span>15 Nov</span><span><cm-badge tone=\"success\">Contacted</cm-badge></span>\n </cm-resource-item>\n <cm-resource-item value=\"l3\" label=\"Divya Menon\" columns>\n <strong>Divya Menon</strong><span>Menon Foods</span><span>divya@menonfoods.in</span><span>90080 77881</span><span>Rahul Kumar</span><span>14 Nov</span><span><cm-badge>Qualified</cm-badge></span>\n </cm-resource-item>\n</cm-resource-list>"},{"title":"Compact rows","description":"`density=\"compact\"`: 40px rows and 32px thumbnails, for long lists people scan. Set `data-cm-density=\"compact\"` on the page instead to make every list and table on it compact. On touch screens rows stay at least 44px tall.","html":"<cm-resource-list resource-name=\"product\" density=\"compact\" style=\"max-width:520px\">\n <cm-resource-item value=\"p1\" href=\"#/components/resource-list\" label=\"Ceramic mug\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Ceramic mug</cm-resource-item>\n <cm-resource-item value=\"p2\" href=\"#/components/resource-list\" label=\"Linen napkins\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Linen napkins</cm-resource-item>\n <cm-resource-item value=\"p3\" href=\"#/components/resource-list\" label=\"Canvas tote bag\"><cm-thumbnail slot=\"media\" alt=\"\"></cm-thumbnail>Canvas tote bag</cm-resource-item>\n</cm-resource-list>"},{"title":"Loading","html":"<cm-resource-list loading resource-name=\"order\" style=\"max-width:520px\">\n <cm-resource-item value=\"o1\">#1001 · Asha Rao</cm-resource-item>\n <cm-resource-item value=\"o2\">#1002 · Ben Cole</cm-resource-item>\n</cm-resource-list>"}],"do":["Set `resource-name` (and `resource-name-plural` for irregular nouns) so the toolbar reads \"2 orders selected\".","Set `total` to the number of matches so merchants can select all of them, and act on `detail.all` in `cm-selection-change`.","Pair it with `cm-status-tabs` above and `cm-pagination` below; put a `cm-table-header` in the `header` slot for columns.","With column headings, set `--cm-table-columns` on the list and `columns` on every row, with one element per column (wrap a badge or button in a `<span>`). The list lines the header up with the cells, checkbox column included. Laying a row out yourself works too: a grid on `var(--cm-table-columns)` with `column-gap: var(--cm-space-20)` and `min-width: 0` on the cells.","Give each row a `label` when its text is long, so the checkbox and link names stay short."],"dont":["Don't put more than one link or many buttons in a row: use the `actions` slot for one or two.","Don't squeeze many columns onto a phone: at 640px or less, show the row as text (no `columns`, no header), or set a shorter `--cm-table-columns` and leave out the cells and options that don't fit.","Don't set `selectable` on a `cm-table-header` inside a selectable list: the list already puts its select-all box in the header. With column headings, put row buttons and thumbnails in a column rather than the `actions` and `media` slots, so the cells stay under their headings.","Don't use it for settings or navigation: use cards or a nested list.","Don't show bulk actions that can't apply to every selected row."],"content":["Header row text: \"2 products selected. Select all 15,000 products\" and \"All 15,000 products selected. Clear selection\".","Bulk actions are verbs: \"Bulk orders\", \"Archive\", \"Add tags\"."],"accessibility":["The rows form a list named after the resource (\"Products\"); each checkbox is named \"Select {row name}\".","The Select box is named \"Select all 4 products on this page\" and shows a mixed state when some rows are ticked. Its menu button is named \"Selection options\" and is a standard menu button (↓ opens, arrows move, Esc closes). Over a column header it appears once rows are ticked (until then the box selects the page). Hide it with `hide-select-menu`.","Selection changes are announced through a polite status message.","Linked rows are one link each; the checkbox and actions stay separate tab stops. Clicking a plain row ticks it, but never when clicking a button or link inside.","While `loading`, the list is `aria-busy` and the spinner is named \"Loading products\".","Differs from Figma: the selection lives in the list's header row instead of a separate toolbar; rows, thumbnails (40px desktop / 32px phone and compact) and text follow the 1.5 scale and the 1.6 table standard. Any image works as a thumbnail."],"responsive":["When the window is 640px wide or less, rows have no side padding, a 20px checkbox (easier to tap) and 32px thumbnails; bulk actions wrap under the \"2 orders selected\" status when they don't fit.","Row buttons (`slot=\"actions\"`) wrap onto their own line under the content, at the start, when the content would get narrower than 12rem: on phones by default, at any width with `actions=\"wrap\"` on the `cm-resource-item`, never with `actions=\"inline\"` (since 1.6, issue #31).","On touch screens rows are at least 44px tall at either density."],"related":["table-header","pagination","status-tabs","checkbox","data-table"]},{"tag":"cm-timeline","slug":"timeline","name":"Timeline","react":"Timeline","group":"Lists","summary":"The activity on a record: emails, calls, notes, field changes and system events, newest first.","lead":"One row per event: a 32px round icon for its kind, a 14px title with an optional badge, the time at the end of the line (\"2 hours ago\"; the full date and time on hover and focus), a 12px `text-tertiary` meta line, an optional body clamped to 3 lines with Show all, and optional actions. A 2px `border-subtle` line joins the icons. \"Show more\" at the end asks for older events.","docs_url":"https://commmerce.com/commmerceui/#components--timeline","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name of the list, e.g. \"Activity for Asha Rao\". Default: the built-in string `label` (\"Activity\")."},{"attribute":"has-more","property":"hasMore","type":"boolean","default":"false","description":"There are older events: shows the \"Show more\" button, which fires `cm-load-more`."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Events are loading: the Show more button shows a spinner, or placeholder rows show when there are no items yet. Announced politely."},{"attribute":"more-label","property":"moreLabel","type":"string","description":"Text of the Show more button. Default: the built-in string `showMore` (\"Show more\")."},{"attribute":"_items","property":"_items","type":"CmTimelineItem[]","default":"[]"},{"attribute":"_empty","property":"_empty","type":"Element[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"CmTimelineItem[]","description":"The `cm-timeline-item` children, in order."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-timeline-item` elements, in the order to show them. Other children are not shown."},{"name":"empty","description":"Shown when there are no items and nothing is loading, e.g. a `cm-empty-state`."}],"events":[{"name":"cm-load-more","description":"When \"Show more\" is pressed. Fetch the next page, append the items and clear `loading`; clear `has-more` on the last page."}],"parts":[{"tag":"cm-timeline-item","react":"TimelineItem","properties":[{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon name from `@commmerce/icons` for the kind of event (\"mail\", \"note\", \"edit\", \"chat\"). Empty shows a small dot."},{"attribute":"tone","property":"tone","type":"Tone | 'neutral'","default":"'neutral'","description":"Colours the icon: `neutral` (default), `information`, `attention`, `success` or `critical`."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"What happened: \"Email sent\", \"Status changed\". Use the `heading` slot for a link."},{"attribute":"datetime","property":"datetime","type":"string","default":"''","description":"When it happened, as an ISO date-time (`2026-11-16T10:30:00+05:30`). Shown relative to now; used for `<time datetime>`."},{"attribute":"time","property":"time","type":"string","default":"''","description":"The time as shown, instead of the relative time worked out from `datetime` (which still gives the full date on hover)."},{"attribute":"meta","property":"meta","type":"string","default":"''","description":"A line under the title: \"by Rahul Kumar · sent\". Use the `meta` slot for links."},{"attribute":"lines","property":"lines","type":"number","default":"3","description":"Lines of body shown before \"Show all\". 0 shows the whole body."},{"attribute":"expanded","property":"expanded","type":"boolean","default":"false","description":"The whole body is shown (after \"Show all\")."},{"attribute":"_overflow","property":"_overflow","type":"boolean","default":"false"},{"attribute":"_body","property":"_body","type":"boolean","default":"false"},{"attribute":"_meta","property":"_meta","type":"boolean","default":"false"},{"attribute":"_actions","property":"_actions","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"date","type":"Date | undefined","description":"The `datetime` as a Date, or undefined when missing or invalid."},{"property":"relativeTime","type":"string","description":"The time as shown: `time`, or `datetime` relative to now (\"2 hours ago\"), or a date when over a week away."},{"property":"fullTime","type":"string","description":"The full date and time, for the tooltip and screen readers."}],"methods":[],"slots":[{"name":"(default)","description":"The body: an email excerpt, a note, a call summary. Clamped to `lines` lines."},{"name":"heading","description":"Rich title (e.g. with a link), instead of `heading`."},{"name":"meta","description":"Rich meta line, instead of `meta`."},{"name":"badge","description":"A `cm-badge` for the kind or state, after the title."},{"name":"actions","description":"Links or buttons under the body, e.g. \"Read email\"."}],"events":[]}],"examples":[{"title":"Record activity","description":"Emails, calls and WhatsApp messages on a lead. The badge names the kind; the action opens the full message. `has-more` adds Show more, which fires `cm-load-more`.","html":"<cm-timeline label=\"Activity for Asha Rao\" has-more style=\"max-width:720px\">\n <cm-timeline-item icon=\"mail\" tone=\"information\" heading=\"Quote for 200 cotton tote bags\" datetime=\"2026-11-26T08:31Z\" meta=\"by Rahul Kumar · sent\">\n <cm-badge slot=\"badge\" tone=\"information\">Email</cm-badge>\n Hi Asha, thanks for your time on the call. As discussed, here is the quote for 200 printed cotton tote bags with your logo on one side. Prices include GST and delivery to Bengaluru. The quote is valid for 30 days; let me know if you would like samples first.\n <cm-button slot=\"actions\" size=\"slim\" href=\"#/components/timeline\">Read email</cm-button>\n </cm-timeline-item>\n <cm-timeline-item icon=\"mail\" heading=\"Email opened\" datetime=\"2026-11-26T09:01Z\" meta=\"by Asha Rao · 2 times\"></cm-timeline-item>\n <cm-timeline-item icon=\"chat\" tone=\"success\" heading=\"Call: discussed bulk pricing\" datetime=\"2026-11-25T08:36Z\" meta=\"by Rahul Kumar · outgoing · 12 min\">\n <cm-badge slot=\"badge\" tone=\"success\">Call</cm-badge>\n Asha needs 200 bags by 5 December for a store opening. Wants a quote with printing on one side.\n </cm-timeline-item>\n <cm-timeline-item icon=\"send\" heading=\"WhatsApp message delivered\" datetime=\"2026-11-24T08:36Z\" meta=\"by Rahul Kumar · template: Introduction\">\n <cm-badge slot=\"badge\">WhatsApp</cm-badge>\n </cm-timeline-item>\n</cm-timeline>"},{"title":"Notes","description":"Long notes are clamped to `lines` lines (3 by default) with Show all. Put the author in the meta line.","html":"<cm-timeline label=\"Notes\" style=\"max-width:560px\">\n <cm-timeline-item icon=\"note\" heading=\"Note\" datetime=\"2026-11-26T09:56Z\" meta=\"by Meera Iyer\" lines=\"2\">\n Visited the Indiranagar store. They stock our mugs on the front shelf and sold out of the blue glaze last week. The owner wants to try the linen napkins next month and asked for a display stand. Follow up after Diwali with a sample set and the wholesale price list.\n </cm-timeline-item>\n <cm-timeline-item icon=\"note\" heading=\"Note\" datetime=\"2026-11-23T10:36Z\" meta=\"by Rahul Kumar\">Prefers calls after 4 pm.</cm-timeline-item>\n</cm-timeline>"},{"title":"System events and field changes","description":"Changes made by people, automations and imports. Write a field change as \"Field: old → new\" in the title; no body is needed.","html":"<cm-timeline label=\"History\" style=\"max-width:560px\">\n <cm-timeline-item icon=\"edit\" heading=\"Status: New → Contacted\" datetime=\"2026-11-26T10:21Z\" meta=\"by Rahul Kumar\"></cm-timeline-item>\n <cm-timeline-item icon=\"user\" heading=\"Owner: Meera Iyer → Rahul Kumar\" datetime=\"2026-11-26T05:36Z\" meta=\"by assignment rule · Round robin, Bengaluru\"></cm-timeline-item>\n <cm-timeline-item icon=\"tag\" heading=\"Tag added: Wholesale\" datetime=\"2026-11-26T05:34Z\" meta=\"by Meera Iyer\"></cm-timeline-item>\n <cm-timeline-item icon=\"plus\" heading=\"Lead created\" datetime=\"2026-11-02T09:30:00+05:30\" meta=\"by Website form · Contact us\">\n <cm-badge slot=\"badge\">System</cm-badge>\n </cm-timeline-item>\n</cm-timeline>"}],"do":["Show the newest event first, and page older ones with `has-more` and `cm-load-more`.","Give `datetime` as an ISO date-time with its offset, so the relative time, the full time and `<time datetime>` are right.","Pick one icon per kind and keep it: `mail` for emails, `chat` for calls, `note` for notes, `edit` for field changes, `user` for owner changes.","Name the kind in the title or a badge too: the icon is decoration and is not read out.","Filter by kind with `cm-status-tabs` above the timeline, with a count on each tab.","Set `label` when there is more than one timeline on the page, e.g. \"Notes\" and \"History\"."],"dont":["Don't put long forms or several buttons in an item: one or two actions, such as \"Read email\" or \"Open task\".","Don't use it for comments people write together on an order: use Comment.","Don't show the whole body of every email: let it clamp, and link to the full message."],"content":["Titles say what happened, briefly: \"Email sent\", \"Call: discussed bulk pricing\", \"Status: New → Contacted\".","Meta line: who, then details, joined with \" · \": \"by Rahul Kumar · sent\".","Badges are one word for the kind: Email, Call, WhatsApp, Note, System."],"accessibility":["An ordered list (`<ol>`, named \"Activity\" or `label`) with one `<li>` per event; the line between icons is decoration.","Each time is a `<time datetime>`. Screen readers hear the relative time and then the full date and time (\"2 hours ago, Monday, 16 November 2026 at 10:30\"). The time is a Tab stop so keyboard users can see the full date in its tooltip.","Show all / Show less is a button with `aria-expanded`, controlling the body. The clamped text is still read in full by screen readers.","Show more is a button; while `loading` it is busy and \"Loading activity\" is announced. When the last page arrives and the button goes away, focus moves to the list.","Screen readers read \"→\" as \"right arrow\" or \"to\", depending on the reader."],"responsive":["The time moves under the title when the row is too narrow for both; the Show more button lines up with the text on wide screens and with the icons on phones (640px or less)."],"related":["comment","status-tabs","badge","empty-state"]},{"tag":"cm-board","slug":"board","name":"Board","react":"Board","group":"Lists","summary":"Records in columns by status (Kanban), moved between columns by dragging or with the keyboard.","lead":"One column per status, with its heading and count, and one card per record: the name (a link to the record), a few 12px `text-tertiary` lines, badges and the owner's avatar. Columns are `bg-page` with a `border-subtle` line and 8px corners; cards are `bg-surface` with a `border-subtle` line. A card is moved by dragging it (press and hold on touch) or by focusing it and pressing Space, then the arrow keys. Each move fires a cancelable `cm-move` for your app to save.","docs_url":"https://commmerce.com/commmerceui/#components--board","properties":[{"attribute":"label","property":"label","type":"string","description":"Accessible name of the board, e.g. \"Merchants by status\". Default: the built-in string `label` (\"Board\")."},{"attribute":"hide-empty","property":"hideEmpty","type":"boolean","default":"false","description":"Empty columns shrink to a narrow rail (heading on its side and the count). Rails still take cards: drop on them or move to them with the keyboard."},{"attribute":"controlled","property":"controlled","type":"boolean","default":"false","description":"You move the cards: the board fires `cm-move` but never moves card elements or changes `total`. Re-render the\ncard into its new column (and update totals) in your `cm-move` listener. Use it with React, Vue and other\nframeworks that render from data. `preventDefault()` still means the move was refused."},{"attribute":"dragging","property":"dragging","type":"boolean","default":"false","description":"Set while a card is being dragged with a pointer. Read it for styling; don't set it."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"columns","type":"CmBoardColumn[]","description":"The `cm-board-column` children, in order."},{"property":"heldCard","type":"CmBoardCard | null","description":"The card picked up with the keyboard, if any."},{"property":"announcement","type":"string","description":"The last message announced (for tests and logging)."}],"methods":[{"name":"column","description":"The column with this `value` (or heading)."},{"name":"card","description":"The card with this `value` (or name), in any column."},{"name":"announce","description":"Announces a message in the board's live region, e.g. after your own \"Move to\" menu."},{"name":"pickUp","description":"Picks up a card for moving with the arrow keys, as Space does: e.g. from a \"Move\" item in your own menu. Focuses the card."},{"name":"cancelMove","description":"Cancels a keyboard move or a drag in progress: the card stays where it was."},{"name":"moveCard","description":"Moves a card to a column and position (default: the end), as a drop would: fires `cm-move`, and unless it is\ncancelled (or the board is `controlled`) moves the element. Use it for your own \"Move to\" menu. Returns false\nwhen the move was cancelled or the card or column was not found."},{"name":"revert","description":"Puts a card back where it was before its last move by the board, restores the two columns' `total`, clears\n`pending` and announces it. Call it when saving the move failed (a rejected `waitUntil()` promise does this\nfor you). Does nothing with `controlled` (put it back in your data) or when the card has not moved. Returns\nwhether the card went back."}],"slots":[{"name":"(default)","description":"`cm-board-column` elements, in order."}],"events":[{"name":"cm-move","description":"Before a card moves. Cancelable: `preventDefault()` keeps it where it was. `detail: { value, card, from, to, fromColumn, toColumn, fromIndex, toIndex, source, waitUntil }` (see `BoardMoveDetail`). Pass the save request to `detail.waitUntil(promise)` to show the card as saving and put it back if the promise rejects."},{"name":"cm-load-more","description":"From a column's Load more button (bubbles from `cm-board-column`). `detail: { column, value }`."}],"parts":[{"tag":"cm-board-column","react":"BoardColumn","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the column in `cm-move` (e.g. the status id). Defaults to `heading`."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The column's name, e.g. the status \"Contacted\"."},{"attribute":"total","property":"total","type":"number | undefined","description":"How many cards the column has in all, when more than are loaded (shown as the count). Unset: the number of cards. The board keeps it in step when it moves cards."},{"attribute":"has-more","property":"hasMore","type":"boolean","default":"false","description":"Shows \"Load more\", which fires `cm-load-more`. Also shown when `total` is more than the cards loaded."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Cards are loading: Load more shows a spinner, or placeholder cards show in an empty column. Announced politely."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"3","description":"Level of the heading for screen readers (2 to 6)."},{"attribute":"_cards","property":"_cards","type":"CmBoardCard[]","default":"[]"},{"attribute":"_drop","property":"_drop"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"collapsed","type":"boolean","description":"Whether the column is shown as a narrow rail: the board has `hide-empty` and the column is empty. Also the `collapsed` attribute, for styling."},{"property":"cards","type":"CmBoardCard[]","description":"The `cm-board-card` children, in order."},{"property":"key","type":"string","description":"The column's `value`, or its heading."},{"property":"count","type":"number","description":"The number shown in the heading: `total`, or the cards loaded."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-board-card` elements, in order. Other children are not shown."},{"name":"actions","description":"A small control at the end of the heading row, e.g. an icon-only \"Add\" button."},{"name":"empty","description":"Shown in a column with no cards, instead of \"No cards\"."}],"events":[{"name":"cm-load-more","description":"When \"Load more\" is pressed. `detail: { column, value }`. Set `loading`, append the cards, then clear `loading` (and `has-more` on the last page)."}]},{"tag":"cm-board-card","react":"BoardCard","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the record in `cm-move` (e.g. its id). Defaults to the card's name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"The card's name, read by screen readers and in announcements (\"Picked up Ravi Stores\"). Defaults to `heading` or the `heading` slot's text."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The title: the record's name."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the title a link to the record. Enter on the focused card opens it too."},{"attribute":"locked","property":"locked","type":"boolean","default":"false","description":"The card can't be moved (e.g. no permission). It can still be opened."},{"attribute":"pending","property":"pending","type":"boolean","default":"false","description":"The move is being saved: the card is greyed with a spinner and can't be moved again until it is cleared. Set by `waitUntil()` in `cm-move`, or by you."},{"attribute":"moving","property":"moving","type":"boolean","default":"false","description":"Set by the board while the card is picked up or dragged; it then marks where the card came from. Read it for styling; don't set it."},{"attribute":"_badges","property":"_badges","type":"boolean","default":"false"},{"attribute":"_slottedTitle","property":"_slottedTitle","type":"string","default":"''"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"name","type":"string","description":"The card's name: `label`, `heading`, the `heading` slot's text, or its first line of text."},{"property":"key","type":"string","description":"The value used in `cm-move`: `value`, or the name."},{"property":"opener","type":"HTMLElement | null","description":"The link or button that opens the record: the `href` title, or the first link or button in the `heading` slot."}],"methods":[{"name":"focusHandle","description":"Focuses the card's handle (its single Tab stop), even when a control inside the card has focus."},{"name":"open","description":"Opens the record: clicks the `href` title or the link or button in the `heading` slot. Returns false when there is none."}],"slots":[{"name":"(default)","description":"Secondary lines under the title (owner, phone, city), one element per line."},{"name":"heading","description":"Rich title instead of `heading`, e.g. a link. A link here is a second Tab stop; prefer `href`."},{"name":"badges","description":"`cm-badge`s (grade, tags) under the lines."},{"name":"avatar","description":"A `cm-avatar` for the owner, at the end of the title line."},{"name":"actions","description":"A small control at the end of the title line, e.g. a `cm-action-menu` with \"Move to…\". Pressing it never starts a drag."}],"events":[]}],"examples":[{"title":"CRM pipeline by status","description":"Merchants by status. Drag a card to another column, or Tab to a card, press Space, use the arrow keys and press Enter. Each move fires `cm-move` with `{ value, from, to, fromIndex, toIndex }`; save it there, and pass the request to `detail.waitUntil(promise)` so the card shows as saving and goes back if it fails. `total` is the column's full count; with more than are loaded, Load more appears.","html":"<cm-board label=\"Merchants by status\" style=\"height:560px\">\n <cm-board-column value=\"new\" heading=\"New\" total=\"24\">\n <cm-board-card value=\"m101\" heading=\"Ravi Stores\" href=\"#/components/board\">\n <span>Asha Rao</span><span>+91 98450 12345 · Bengaluru</span><span>Modified 2 hours ago</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Asha Rao\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"m102\" heading=\"Lakshmi Textiles\" href=\"#/components/board\">\n <span>Rahul Kumar</span><span>+91 99000 23456 · Chennai</span><span>Modified yesterday</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Rahul Kumar\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"m103\" heading=\"Green Basket Organics\" href=\"#/components/board\">\n <span>Meera Iyer</span><span>+91 90080 34567 · Mysuru</span><span>Modified 3 days ago</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Meera Iyer\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"contacted\" heading=\"Contacted\">\n <cm-board-card value=\"m104\" heading=\"Blue Pottery House\" href=\"#/components/board\">\n <span>Asha Rao</span><span>+91 98860 45678 · Jaipur</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Asha Rao\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"m105\" heading=\"Kiran Foods\" href=\"#/components/board\">\n <span>Rahul Kumar</span><span>+91 97400 56789 · Pune</span><span>Modified 5 days ago</span>\n <cm-badge slot=\"badges\">Grade C</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Rahul Kumar\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"demo\" heading=\"Demo booked\">\n <cm-board-card value=\"m106\" heading=\"Delhi Spice Co.\" href=\"#/components/board\">\n <span>Meera Iyer</span><span>+91 98110 67890 · New Delhi</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Meera Iyer\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"won\" heading=\"Won\">\n <cm-board-card value=\"m107\" heading=\"Coastal Crafts\" href=\"#/components/board\">\n <span>Asha Rao</span><span>+91 94470 78901 · Kochi</span><span>Modified last week</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Asha Rao\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"lost\" heading=\"Lost\"></cm-board-column>\n</cm-board>"},{"title":"Load more","description":"Show the first page of each column and set `total`. Load more (also shown with `has-more`) fires `cm-load-more` with `{ column, value }`: set `loading` on the column, append the next cards, then clear `loading`. This example adds three cards after a short wait.","html":"<cm-board label=\"Tickets by status\" style=\"height:480px\">\n <cm-board-column value=\"open\" heading=\"Open\" total=\"8\">\n <cm-board-card value=\"t201\" heading=\"Refund not received\" href=\"#/components/board\">\n <span>Priya Nair</span><span>Order #10482 · Payments</span><span>Modified 1 hour ago</span>\n <cm-badge slot=\"badges\">High</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Priya Nair\" decorative></cm-avatar>\n </cm-board-card>\n <cm-board-card value=\"t202\" heading=\"Wrong size delivered\" href=\"#/components/board\">\n <span>Arjun Mehta</span><span>Order #10477 · Returns</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Medium</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Arjun Mehta\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"waiting\" heading=\"Waiting on customer\" total=\"3\">\n <cm-board-card value=\"t203\" heading=\"GST invoice needed\" href=\"#/components/board\">\n <span>Priya Nair</span><span>Order #10391 · Billing</span><span>Modified yesterday</span>\n <cm-badge slot=\"badges\">Low</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Priya Nair\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"closed\" heading=\"Closed\" loading></cm-board-column>\n</cm-board>"},{"title":"Hide empty columns","description":"`hide-empty` shrinks empty columns to a 48px rail with the heading on its side and the count. Rails still take cards: drop a card on one, or move to it with the arrow keys, and it opens up again. A column with a `total` above 0 is never treated as empty.","html":"<cm-board label=\"Partners by status\" hide-empty style=\"height:420px\">\n <cm-board-column value=\"new\" heading=\"New\">\n <cm-board-card value=\"p301\" heading=\"Sharma Logistics\" href=\"#/components/board\">\n <span>Rahul Kumar</span><span>+91 98200 11122 · Mumbai</span><span>Modified today</span>\n <cm-badge slot=\"badges\">Grade B</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Rahul Kumar\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"contacted\" heading=\"Contacted\"></cm-board-column>\n <cm-board-column value=\"onboarding\" heading=\"Onboarding\">\n <cm-board-card value=\"p302\" heading=\"Nair Packaging\" href=\"#/components/board\">\n <span>Meera Iyer</span><span>+91 94460 33344 · Thiruvananthapuram</span><span>Modified 2 days ago</span>\n <cm-badge slot=\"badges\">Grade A</cm-badge>\n <cm-avatar slot=\"avatar\" size=\"small\" name=\"Meera Iyer\" decorative></cm-avatar>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"live\" heading=\"Live\"></cm-board-column>\n <cm-board-column value=\"paused\" heading=\"Paused\"></cm-board-column>\n</cm-board>"},{"title":"Keyboard instructions and a Move menu","description":"Where many people use the keyboard (a sales floor), say how moving works on the page as well; screen readers already hear it with each card. A \"Move to\" menu in the `actions` slot gives a way that needs no arrow keys: on `cm-select`, call `board.moveCard(card, value)`, or `board.pickUp(card)` for \"Move…\" (then the arrow keys). This example does both.","html":"<p id=\"board-keys\" style=\"margin:0 0 12px;font-size:14px\">To move a card: Tab to it, press Space, choose a column and position with the arrow keys, then press Enter. Escape cancels. Enter on a card opens it.</p>\n<cm-board label=\"Follow-ups by stage\" style=\"height:380px\">\n <cm-board-column value=\"today\" heading=\"Today\">\n <cm-board-card value=\"f401\" heading=\"Call Ravi Stores\" href=\"#/components/board\">\n <span>Asha Rao · 11:30 am</span>\n <cm-action-menu slot=\"actions\" icon-only align=\"end\" label=\"Move Call Ravi Stores\" data-board-move>\n <cm-menu-item value=\"pick\">Move…</cm-menu-item><hr>\n <cm-menu-item value=\"week\">Move to This week</cm-menu-item>\n <cm-menu-item value=\"later\">Move to Later</cm-menu-item>\n </cm-action-menu>\n </cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"week\" heading=\"This week\">\n <cm-board-card value=\"f402\" heading=\"Demo for Kiran Foods\" href=\"#/components/board\"><span>Rahul Kumar · Thursday</span></cm-board-card>\n </cm-board-column>\n <cm-board-column value=\"later\" heading=\"Later\"></cm-board-column>\n</cm-board>"}],"do":["Use one column per status, in the order records move through them, and keep the same order everywhere the statuses appear.","Give every card a `value` (the record id) and every column a `value` (the status id): `cm-move` reports those.","Save the move in `cm-move` and pass the request to `detail.waitUntil()`. Cancel the event (`preventDefault()`) for moves that are never allowed, and say why nearby.","Set `total` from your API and page each column with Load more; don't load every record into a board.","Use `href` for the record link, so each card is one Tab stop and Enter opens it.","In React, Vue and other frameworks that render from data, set `controlled` and move the record in your state in the `cm-move` listener.","Offer a list view of the same records for searching, sorting and bulk actions: see Board or list.","To confirm a move first (for example into a closing stage), call `preventDefault()` in `cm-move`, ask with a Modal, and on confirm call `board.moveCard(detail.value, detail.to, detail.toIndex)`. The second move fires `cm-move` again, so let it through with a flag of your own (set `confirmed = true` just before `moveCard`, reset it after); don't rely on `source: 'api'`, which a \"Move to\" menu that calls `moveCard()` also produces."],"dont":["Don't use a board for more than about eight statuses, or for records with no status: use a Resource list or Data table.","Don't make dragging the only way to change a status: the record page should have a status field too.","Don't put more than four lines, a few badges and one small menu on a card.","Don't put form fields on cards: they can't start a drag and make the card hard to move."],"content":["Column headings are the status names merchants know (\"Demo booked\"), in sentence case, without the count (the board adds it).","Card title: the record's name. Lines: owner, then phone and city, then when it last changed (\"Modified 2 hours ago\").","Badges: one word or a grade (\"Grade A\", \"High\")."],"accessibility":["The board is a group named by `label`; each column is a region named by its heading and count (\"Contacted, 12 cards\"), with a heading (`heading-level`, 3 by default) and a list of cards. Cards are list items.","Each card has one Tab stop: a handle covering the card, a button with the role description \"movable card\", named after the card, and described by the instructions (\"Press Space to pick up. Then use the arrow keys…\"; \"Press Enter to open.\" first when the card has a link). The `aria-grabbed` and `aria-dropeffect` attributes are deprecated and not used.","Keyboard: Space picks the card up; Left and Right choose the previous or next column (in right-to-left languages they swap, so Left goes to the next column); Up and Down, Home and End choose the position; Space or Enter drops; Escape cancels, and so does Tab or moving focus away. Without a card picked up, the arrow keys move focus between cards and Enter opens the card.","Every step is announced through an assertive live region: \"Picked up Ravi Stores. Column New, position 1 of 3.\", \"Column Contacted, position 2 of 3.\", \"Moved Ravi Stores to Contacted, position 2 of 3.\", \"Move cancelled. Ravi Stores is back in New.\" Refused and failed moves are announced too. Focus stays on the card after it moves.","Screen readers in browse mode keep the arrow keys for reading, so a \"Move to\" menu (see the example) or the status field on the record page is the way for many screen-reader users. Dragging is never the only way.","Pointer: drag with a mouse after moving 4px; on touch, press and hold for 0.3 seconds, so swiping still scrolls. A copy of the card follows the pointer, a dashed outline marks where the card came from, and a dashed placeholder shows where it will land. Escape cancels a drag.","Load more is a button; while a column is `loading` its list is busy and \"Loading Contacted\" is announced. Placeholder cards are hidden from screen readers.","Not yet tested with screen readers by people (automated checks only)."],"responsive":["Columns are 272px wide (`--cm-board-column-width`) side by side, 12px apart, and the board scrolls sideways.","When the board itself is 480px wide or less (a phone, or a narrow panel), each column takes the board's width less 40px, so the next column peeks in, and the board snaps from column to column. Rails stay 48px. It works down to 320px.","Give the board a height (`style=\"height: 70vh\"` or `block-size`) and each column scrolls on its own; without one the columns grow with their cards and the page scrolls.","While a card is dragged near the board's start or end edge the board scrolls sideways; near the top or bottom of a column, the column scrolls; near the top or bottom of the window, the window scrolls."],"related":["resource-list","data-table","status-tabs","badge","avatar","action-menu"]},{"tag":"cm-calendar","slug":"calendar","name":"Calendar","react":"Calendar","group":"Lists","summary":"Events by month, week or day: calls, follow-ups and demos that move between days and times by dragging or with the keyboard.","lead":"A month grid, a week of day columns with an all-day row and an hour axis, or one day's hours, with Previous, Today and Next, the range shown and a view switch. Events are `cm-calendar-event` children, drawn as chips with a time, a title, the kind (as text, or as the icon in the month view) and a tone colour on a 3px bar. Drag a chip to another day or time, or focus it, press Space and use the arrow keys. Each move fires a cancelable `cm-move` for your app to save; each new range fires `cm-range-change` so you can load its events.","docs_url":"https://commmerce.com/commmerceui/#components--calendar","properties":[{"attribute":"view","property":"view","type":"CalendarView","default":"'month'","description":"`month`, `week` or `day`."},{"attribute":"date","property":"date","type":"string","default":"''","description":"A day in the range shown, ISO `yyyy-mm-dd`. Previous, Next and Today change it. Empty: today. On narrow screens it is also the day listed under the month."},{"attribute":"today","property":"today","type":"string","default":"''","description":"Today's date, ISO `yyyy-mm-dd`, for the Today button and the highlight. Empty: the device's date. Set it from your server, or to fix the date in tests."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the calendar, e.g. \"Outreach planner\". Default: the built-in string `label` (\"Calendar\")."},{"attribute":"step","property":"step","type":"number","default":"15","description":"Minutes events snap to when moved in the week and day views (1 to 240). Default 15."},{"attribute":"locale","property":"locale","type":"string","description":"BCP 47 language for month and weekday names, times and the first day of the week. Empty: the same language as every other component."},{"attribute":"first-day-of-week","property":"firstDayOfWeek","type":"number | undefined","description":"First day of the week: 0 = Sunday, 1 = Monday … 6 = Saturday. Defaults to the locale's custom where the browser knows it (as in `cm-date-picker`), else Sunday."},{"attribute":"hour-cycle","property":"hourCycle","type":"'' | 'h12' | 'h23'","default":"''","description":"`h12` or `h23` to force a 12- or 24-hour clock. Empty: the locale's clock."},{"attribute":"day-start","property":"dayStart","type":"number","default":"8","description":"The hour the week and day views scroll to when they open (0 to 23). Default 8."},{"attribute":"max-events","property":"maxEvents","type":"number","default":"3","description":"Most chips in a month day; with more, the last place shows \"+N more\", which lists the whole day. Default 3."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"2","description":"Level of the range heading for screen readers (1 to 6). Default 2."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Events are loading: the grid is busy and \"Loading events\" is announced."},{"attribute":"readonly","property":"readonly","type":"boolean","default":"false","description":"No \"+\" buttons and no moving: events can only be opened."},{"attribute":"controlled","property":"controlled","type":"boolean","default":"false","description":"You move the events: the calendar fires `cm-move` but never changes `start` and `end`. Change them (or re-render\nthe event) in your `cm-move` listener. Use it with React, Vue and other frameworks that render from data."},{"attribute":"dragging","property":"dragging","type":"boolean","default":"false","description":"Set while an event is dragged with a pointer. Read it for styling; don't set it."},{"attribute":"_narrow","property":"_narrow","type":"boolean","default":"false"},{"attribute":"_more","property":"_more","type":"string","default":"''","description":"The day whose \"+N more\" list is open."},{"attribute":"_target","property":"_target","type":"{ iso: string; min?: number } | null","default":"null","description":"Where the moving event would land."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"events","type":"CmCalendarEvent[]","description":"The `cm-calendar-event` children."},{"property":"range","type":"CalendarRange","description":"The view and the first and last day shown, as in `cm-range-change`."},{"property":"heldEvent","type":"CmCalendarEvent | null","description":"The event picked up with the keyboard, if any."},{"property":"announcement","type":"string","description":"The last message announced (for tests and logging)."}],"methods":[{"name":"event","description":"The event with this `value` (or title)."},{"name":"announce","description":"Announces a message in the calendar's live region."},{"name":"scrollToHour","description":"Scrolls the week or day view so `hour` (0–23) is at the top. Useful after loading events, e.g. to open at the first one.\nDoes nothing in the month view."},{"name":"previous","description":"Shows the previous month, week (three days when narrow) or day."},{"name":"next","description":"Shows the next month, week (three days when narrow) or day."},{"name":"goToToday","description":"Shows the range with today in it."},{"name":"pickUp","description":"Picks up an event for moving with the arrow keys, as Space does: e.g. from a \"Move\" item in your own menu.\n`day` (ISO) is the day it is picked up from, for an all-day event over several days. Returns false when the\nevent is not shown, `locked`, `pending` or the calendar is `readonly`."},{"name":"cancelMove","description":"Cancels a keyboard move or a drag in progress: the event stays where it was."},{"name":"moveEvent","description":"Moves an event to a new start (local ISO; `end` defaults to keeping its length), as a drop would: fires\n`cm-move`, and unless it is cancelled (or the calendar is `controlled`) changes `start` and `end`. Returns false\nwhen the move was cancelled or the event was not found."},{"name":"revert","description":"Puts an event back where it was before its last move by the calendar, clears `pending` and announces it. Call\nit when saving the move failed (a rejected `waitUntil()` promise does this for you). Does nothing with\n`controlled` (put it back in your data) or when the event has not moved. Returns whether it went back."}],"slots":[{"name":"(default)","description":"`cm-calendar-event` elements, in any order."}],"events":[{"name":"cm-range-change","description":"When the days shown change (view, Previous/Next/Today, `date`, or the width crossing 600px), and once on first render. `detail: { view, start, end }` (ISO dates, both included). Load the events for those days."},{"name":"cm-move","description":"Before an event moves. Cancelable: `preventDefault()` keeps it where it was. `detail: { value, event, from: { start, end }, to: { start, end }, allDay, source, waitUntil }` (see `CalendarMoveDetail`)."},{"name":"cm-add","description":"From a \"+\" button or an empty hour. `detail: { start, allDay, view }`: `start` is `yyyy-mm-dd` for a day, `yyyy-mm-ddThh:mm` for an hour."},{"name":"cm-open","description":"When an event chip is activated (click or Enter). `detail: { value, event }`. Cancelable: on a chip with `href`, `preventDefault()` stops the link."}],"parts":[{"tag":"cm-calendar-event","react":"CalendarEvent","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the event in `cm-move` and `cm-open` (e.g. its id). Defaults to the title."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"The title, e.g. \"Call Ravi Stores\"."},{"attribute":"label","property":"label","type":"string","default":"''","description":"The title for screen readers and announcements, when it should differ from `heading`."},{"attribute":"start","property":"start","type":"string","default":"''","description":"Local start, ISO `yyyy-mm-ddThh:mm`; for an all-day event `yyyy-mm-dd` (a date alone makes it all-day)."},{"attribute":"end","property":"end","type":"string","default":"''","description":"Local end, ISO `yyyy-mm-ddThh:mm` (default: 30 minutes after `start`); for an all-day event, its last day `yyyy-mm-dd` (default: the start day)."},{"attribute":"all-day","property":"allDay","type":"boolean","default":"false","description":"Lasts the whole day (or days): shown in the all-day row of the week and day views, and first in a month day."},{"attribute":"kind","property":"kind","type":"string","default":"''","description":"What it is, in a word or two: \"Follow-up\", \"Demo\", \"Call\". Shown on the chip and read in its name, so colour is never the only signal."},{"attribute":"tone","property":"tone","type":"CalendarEventTone","default":"'neutral'","description":"Colour of the chip, from the semantic tones. Pick one per kind and keep it."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"A `cm-icon` name shown before the title (e.g. `phone` for calls). The month view shows the icon instead of `kind`."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the chip a link to the record. Without it, activating the chip fires `cm-open`."},{"attribute":"locked","property":"locked","type":"boolean","default":"false","description":"The event can't be moved (e.g. no permission). It can still be opened."},{"attribute":"pending","property":"pending","type":"boolean","default":"false","description":"The move is being saved: the chip is greyed and can't be moved again until it is cleared. Set by `waitUntil()` in `cm-move`, or by you."},{"attribute":"moving","property":"moving","type":"boolean","default":"false","description":"Set by the calendar while the event is picked up or dragged. Read it for styling; don't set it."}],"script_properties":[{"property":"name","type":"string","description":"The event's name: `label`, `heading`, or its text."},{"property":"key","type":"string","description":"The value used in events: `value`, or the name."}],"methods":[],"slots":[{"name":"(default)","description":"The title, when `heading` is not set."}],"events":[]}],"examples":[{"title":"Outreach planner: month","description":"Everyone's calls, follow-ups, demos and meetings for November. A day with more than three events shows \"+N more\", which lists the whole day. Drag a chip to another day (the time stays), or Tab to it, press Space, use the arrow keys (Down is a week later) and press Enter. \"+\" on a day fires `cm-add` with the date; this example adds a follow-up at 10 am.","html":"<cm-calendar label=\"Outreach planner\" date=\"2026-11-18\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Week","description":"Seven day columns with an all-day row and the hours. Events sit at their time and are as tall as they last; events at the same time share the hour side by side. Drag a chip to another day or time (it snaps to `step`, 15 minutes), or press Space and use Up and Down (15 minutes), Page Up and Page Down (an hour), Left and Right (a day). Click an empty hour to add at that time.","html":"<cm-calendar label=\"Outreach planner\" view=\"week\" date=\"2026-11-18\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Day","description":"One day's hours, for a sales rep's own plan. `step=\"30\"` moves events in half hours.","html":"<cm-calendar label=\"My day\" view=\"day\" date=\"2026-11-18\" step=\"30\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Loading the range from your API","description":"Listen for `cm-range-change`: it fires on the first render and whenever the days shown change, with `{ view, start, end }` (ISO dates, both included). Set `loading` while you fetch, replace the `cm-calendar-event` children, then clear `loading`. Save moves in `cm-move` and pass the request to `detail.waitUntil(promise)`: the event shows as saving and goes back if it fails. This example shows `loading` for a moment on each new range.","html":"<cm-calendar label=\"Outreach planner\" date=\"2026-11-18\" data-calendar-load>\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"},{"title":"Keyboard instructions","description":"Where many people use the keyboard, say how moving works on the page too; screen readers already hear it with each event.","html":"<p style=\"margin:0 0 12px;font-size:14px\">Tab into the calendar and use the arrow keys to move between days, hours and events; Page Up and Page Down show the previous or next period. To move an event: press Space, choose a day or time with the arrow keys, then press Enter. Escape cancels. Enter on an event opens it; Enter on \"+\" adds one.</p>\n<cm-calendar label=\"Follow-ups\" view=\"week\" date=\"2026-11-18\">\n <cm-calendar-event value=\"f101\" heading=\"Call Ravi Stores\" start=\"2026-11-16T10:00\" end=\"2026-11-16T10:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f102\" heading=\"Demo for Kiran Foods\" start=\"2026-11-17T11:00\" end=\"2026-11-17T12:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f103\" heading=\"Email Lakshmi Textiles\" start=\"2026-11-18T09:30\" end=\"2026-11-18T09:45\" kind=\"Email\" tone=\"information\" icon=\"mail\"></cm-calendar-event>\n <cm-calendar-event value=\"f104\" heading=\"Meet Blue Pottery House\" start=\"2026-11-18T12:00\" end=\"2026-11-18T13:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f105\" heading=\"Call Ravi Stores\" start=\"2026-11-18T15:00\" end=\"2026-11-18T15:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f106\" heading=\"Call Green Basket Organics\" start=\"2026-11-18T16:00\" end=\"2026-11-18T16:30\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f107\" heading=\"Demo for Delhi Spice Co.\" start=\"2026-11-19T14:00\" end=\"2026-11-19T15:00\" kind=\"Demo\" tone=\"success\" icon=\"users\"></cm-calendar-event>\n <cm-calendar-event value=\"f108\" heading=\"GST filing due\" start=\"2026-11-20\" all-day kind=\"Deadline\" tone=\"critical\" icon=\"alert\"></cm-calendar-event>\n <cm-calendar-event value=\"f109\" heading=\"Call Coastal Crafts\" start=\"2026-11-23T11:30\" end=\"2026-11-23T12:00\" kind=\"Follow-up\" tone=\"attention\" icon=\"phone\"></cm-calendar-event>\n <cm-calendar-event value=\"f110\" heading=\"Visit Sharma Logistics\" start=\"2026-11-25T10:00\" end=\"2026-11-25T12:00\" kind=\"Meeting\" tone=\"neutral\" icon=\"handshake\"></cm-calendar-event>\n <cm-calendar-event value=\"f111\" heading=\"Seller meet, Bengaluru\" start=\"2026-11-27\" end=\"2026-11-28\" all-day kind=\"Event\" tone=\"information\" icon=\"megaphone\"></cm-calendar-event>\n</cm-calendar>"}],"do":["Give every event a `value` (the record id), a `kind` and a `tone`, and keep one tone per kind everywhere. Add an `icon` per kind as well: the month view shows the icon instead of the kind's name.","Load events in `cm-range-change`, for the days it reports, and set `loading` while you fetch.","Save each move in `cm-move` and pass the request to `detail.waitUntil()`. Cancel the event (`preventDefault()`) for moves that are never allowed (a past day, a holiday), and say why nearby.","Set `today` from your server when the device's clock or time zone may be wrong, and `first-day-of-week` when your users expect a different start than their language's.","In React, Vue and other frameworks that render from data, set `controlled` and change the event's `start` and `end` in your state in the `cm-move` listener.","Offer a list of the same events (a Resource list or Data table) for searching and bulk changes.","To open the week or day view at the first event after loading, set `day-start` to its hour (the view scrolls again when it changes), or call `scrollToHour(h)`."],"dont":["Don't make dragging the only way to reschedule: the record's own page should have a date and time field too (Date picker with `time`).","Don't rely on colour alone: every event needs a `kind` (or an `icon`).","Don't put long text in titles: chips are one line in the month view. Put the record's name first (\"Call Ravi Stores\").","Don't use it to pick a date: use Date picker or Date range picker."],"content":["Titles start with the action and the record: \"Call Ravi Stores\", \"Demo for Kiran Foods\".","Kinds are one or two words, in sentence case: \"Follow-up\", \"Demo\", \"Meeting\", \"Deadline\"."],"accessibility":["**Structure:** the calendar is a group named by `label`. The range (\"November 2026\") is a heading (`heading-level`, 2 by default) and a polite live region, so Previous and Next are announced. The view switch is a group of toggle buttons (`aria-pressed`).","**Month view** is a `grid` (a table) with the weekday names as column headers and one row per week. Each day cell holds its \"+\" button (\"Add on Wednesday 18 November\"), its event chips and \"+N more\" (\"2 more on Wednesday 18 November\", a button that opens a non-modal dialog listing the whole day). Today has `aria-current=\"date\"`. **Why a grid, and why focus goes to the things inside the cells:** grid semantics give screen readers the weekday and week as you move, and the arrow keys are free for moving focus, which the move model needs once an event is picked up. Focus lands on the buttons inside each cell, not on the cell, so every action is one key away.","**Week and day views** are a `grid` too: a row of day headings, an all-day row and one row per hour (the hour is the row header), with a cell per day. An empty hour is a button (\"Add at 3:00 pm, Wednesday 18 November\"); events sit in the cell of the hour they start in.","**Events** are buttons (links with `href`) named in full: \"Call Ravi Stores, Wednesday 18 November, 3:00 to 3:30 pm, Follow-up\", with the role description \"movable event\" and a description of the keys. The kind is also written on the chip (or shown as its icon), so colour is never the only signal.","**Keyboard, moving focus:** the grid is one Tab stop. In the month view, Left and Right go to the previous or next day (keeping the position in the day), Up and Down through a day's \"+\", events and \"+N more\" and on to the week above or below, Home and End to the start or end of the week. In the week and day views, Up and Down go through a day's all-day row and hours, Left and Right to the same hour in the next day, Home and End to the first or last day. Page Up and Page Down show the previous or next period everywhere. In right-to-left languages Left and Right swap.","**Keyboard, moving an event** (the shared move model of Board): Space picks it up. In the month view Left and Right choose the previous or next day and Up and Down the same day a week before or after; in the week and day views Up and Down move it by `step` (15 minutes), Page Up and Page Down by an hour, Home and End to the start or end of the day, and Left and Right to another day. Space or Enter drops, Escape cancels, and so does Tab or moving focus away. Moves stay inside the days shown. Focus stays on the event after it moves.","Every step is announced through an assertive live region: \"Picked up Call Ravi Stores. Wednesday 18 November, 3:00 to 3:30 pm.\", \"Thursday 19 November, 3:00 to 3:30 pm.\", \"Moved Call Ravi Stores to Thursday 19 November, 3:00 to 3:30 pm.\", \"Move cancelled. Call Ravi Stores is back on Wednesday 18 November.\" Refused and failed moves are announced too.","Pointer: drag with a mouse after moving 4px; on touch, press and hold for 0.3 seconds, so swiping still scrolls. The event stays where it was with a dashed outline and a dashed placeholder shows where it will land; in the week and day views the time grid scrolls when you drag near its top or bottom. Escape cancels a drag.","Narrow month view: the days are buttons named with their date and count (\"Tuesday 24 November, 4 events\"); the chosen day has `aria-selected`, and its list follows the grid under a heading.","Screen readers in browse mode keep the arrow keys for reading, so the record page's date field (or your own \"Move to\" menu calling `moveEvent()` or `pickUp()`) is the way for many screen-reader users. Dragging is never the only way.","Not yet tested with screen readers by people (automated checks only)."],"responsive":["Follows the calendar's own width, not the window. From 600px wide: a month grid with chips in each day, a week of seven day columns, or one day.","Narrower than 600px (phones, side panels), the month view becomes a compact grid of day buttons with a dot per event (up to three, in the events' colours), and the chosen day's events are listed under it with an Add button. Tapping a day chooses it. The week view shows three days from `date` instead of seven, and Previous and Next move three days; `cm-range-change` reports those three days. Three days keep the hours readable at 320px, where seven columns would be under 40px wide.","The week and day views scroll inside the calendar (at most 600px tall, `--cm-calendar-time-height`) with the day headings and the all-day row kept in view, and open scrolled to `day-start` (8 am). An hour is 48px (`--cm-calendar-hour-height`).","The header wraps: the navigation, then the range, then the view switch, on as many lines as it needs. It works down to 320px."],"related":["board","date-picker","date-range-picker","resource-list","badge"]},{"tag":"cm-nested-list","slug":"nested-list","name":"Nested list","react":"NestedList","group":"Lists","summary":"Rows that nest inside each other, such as menu links or sub-categories, with reordering.","lead":"A grey bar at least 64px tall with a 20px semibold title and actions, then 48px bordered rows of 14px text indented 48px per level. With `sortable`, each row starts with a drag handle; with `collapsible`, a round black button shows and hides the rows.","docs_url":"https://commmerce.com/commmerceui/#components--nested-list","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Title in the grey bar, e.g. \"Header\" or \"Clothing & accessories\"."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"2","description":"Heading level for the title (1–6)."},{"attribute":"sortable","property":"sortable","type":"boolean","default":"false","description":"Rows get drag handles and can be reordered among their siblings."},{"attribute":"collapsible","property":"collapsible","type":"boolean","default":"false","description":"Adds a show/hide button to the heading bar."},{"attribute":"open","property":"open","type":"boolean","default":"true","description":"Whether the rows are shown when `collapsible`."},{"attribute":"group","property":"group","type":"string","default":"''","description":"Name shared by sortable lists that accept each other's top-level rows (since 1.3), e.g. every section of a\nform layout. Rows then move between them by drag and drop (mouse or touch) and from the keyboard: ↑ on the\nfirst row or ↓ on the last moves it into the list before or after. The component moves the element and fires\na cancelable `cm-move`. An empty list in a group shows a drop area."},{"attribute":"_msg","property":"_msg","type":"string","default":"''"},{"attribute":"_empty","property":"_empty","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"items","type":"CmNestedItem[]","description":"The top-level `cm-nested-item` rows, in order."}],"methods":[{"name":"announce","description":"Reads a message to screen readers, e.g. after a move."}],"slots":[{"name":"(default)","description":"`cm-nested-item` rows."},{"name":"actions","description":"Controls in the heading bar, e.g. an \"Add links\" button or a toggle."}],"events":[{"name":"cm-toggle","description":"`detail: { open }` when a collapsible list is shown or hidden."},{"name":"cm-reorder","description":"When a row is moved. See `cm-nested-item`."},{"name":"cm-move","description":"When a row moves into another list with the same `group`. Fired on the row before it moves, so it bubbles through the list it leaves. See `cm-nested-item`."}],"parts":[{"tag":"cm-nested-item","react":"NestedItem","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Row text, e.g. a menu link or category name."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the item in `cm-reorder` handlers."},{"attribute":"sortable","property":"sortable","type":"boolean","default":"false","description":"Shows the drag handle. Set by the parent list from its own `sortable`."},{"attribute":"_hasChildren","property":"_hasChildren","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"list","type":"CmNestedList | null","description":"The `cm-nested-list` this item is a top-level row of, or null when it is nested in another item."},{"property":"siblings","type":"CmNestedItem[]","description":"Sibling `cm-nested-item`s, including this one."}],"methods":[{"name":"moveToList","description":"Moves this top-level row into another `cm-nested-list` with the same `group`, at position `to` (default: the\nend), firing a cancelable `cm-move` first. With its own list it is the same as `moveTo(to)`. Use it for a\n\"Move to…\" menu. Returns false if nothing moved. Since 1.3."},{"name":"moveTo","description":"Moves this item to a position among its siblings, firing a cancelable `cm-reorder` first.\nReturns false if nothing moved."}],"slots":[{"name":"(default)","description":"Child `cm-nested-item`s."},{"name":"actions","description":"Controls at the end of the row: a badge, a toggle, edit and delete buttons."}],"events":[{"name":"cm-move","description":"Bubbles from the item before it moves into another list with the same `group` (since 1.3): `detail: { item, from, to, fromList, toList }`, where `from` is its position in `fromList` and `to` its position in `toList` after the move. Cancelable: the component moves the element unless you call `preventDefault()`."},{"name":"cm-reorder","description":"Bubbles from the moved item: `detail: { item, from, to }` (positions among its siblings). Cancelable."}]}],"examples":[{"title":"Categories, sortable","html":"<cm-nested-list heading=\"Clothing & accessories\" sortable>\n <cm-toggle slot=\"actions\" checked aria-label=\"Show Clothing & accessories\"></cm-toggle>\n <cm-nested-item label=\"Footwear and shoes\"><cm-toggle slot=\"actions\" aria-label=\"Show Footwear and shoes\"></cm-toggle></cm-nested-item>\n <cm-nested-item label=\"Games & toys\"><cm-toggle slot=\"actions\" aria-label=\"Show Games & toys\"></cm-toggle></cm-nested-item>\n <cm-nested-item label=\"Pet items\">\n <cm-toggle slot=\"actions\" checked aria-label=\"Show Pet items\"></cm-toggle>\n <cm-nested-item label=\"Accessories\"><cm-toggle slot=\"actions\" checked aria-label=\"Show Accessories\"></cm-toggle></cm-nested-item>\n <cm-nested-item label=\"Exclusive items\">\n <cm-toggle slot=\"actions\" checked aria-label=\"Show Exclusive items\"></cm-toggle>\n <cm-nested-item label=\"Limited editions\"><cm-toggle slot=\"actions\" checked aria-label=\"Show Limited editions\"></cm-toggle></cm-nested-item>\n </cm-nested-item>\n </cm-nested-item>\n</cm-nested-list>"},{"title":"Navigation menu, collapsible","html":"<cm-nested-list heading=\"Header\" collapsible sortable>\n <cm-button slot=\"actions\" variant=\"primary\" size=\"large\">Add links</cm-button>\n <cm-nested-item label=\"Home\">\n <cm-badge slot=\"actions\" tone=\"success\">Accepted</cm-badge>\n <cm-button slot=\"actions\" size=\"slim\">Edit</cm-button>\n <cm-button slot=\"actions\" size=\"slim\">Delete</cm-button>\n </cm-nested-item>\n</cm-nested-list>"},{"title":"Move rows between lists","description":"Since 1.3. Give sortable lists the same `group` and their top-level rows move between them: drag a handle onto another list (mouse or touch), or focus a handle and press ↓ on the last row (↑ on the first) to move it into the next (previous) list. The component moves the element and fires a cancelable `cm-move` on the row, with `detail: { item, from, to, fromList, toList }`; it bubbles through the list the row leaves, so listen on a common container or `document`. Moves inside one list still fire `cm-reorder`. For a \"Move to…\" menu, call `item.moveToList(list, index)`. An empty list in a group shows a drop area.","html":"<div class=\"stack\">\n<cm-nested-list heading=\"Lead details\" group=\"layout\" sortable heading-level=\"3\">\n <cm-nested-item label=\"Lead name\" value=\"name\"></cm-nested-item>\n <cm-nested-item label=\"Company\" value=\"company\"></cm-nested-item>\n <cm-nested-item label=\"Phone\" value=\"phone\"></cm-nested-item>\n</cm-nested-list>\n<cm-nested-list heading=\"Contact details\" group=\"layout\" sortable heading-level=\"3\">\n <cm-nested-item label=\"Email\" value=\"email\"></cm-nested-item>\n <cm-nested-item label=\"City\" value=\"city\"></cm-nested-item>\n</cm-nested-list>\n<cm-nested-list heading=\"Hidden fields\" group=\"layout\" sortable heading-level=\"3\"></cm-nested-list>\n</div>"}],"do":["Listen for `cm-reorder` to save the new order; call `preventDefault()` to refuse a move.","Between lists with a `group`, listen for `cm-move` (on `document` or a container of all the lists) to save which list each row is in; `preventDefault()` refuses the move, and the row stays where it was.","Give icon-only controls in a row a name that includes the row: \"Edit Home\", \"Delete Home\".","Keep nesting to three levels or fewer."],"dont":["Don't use it for long lists of products or orders: use a resource list.","Don't rely on drag and drop alone to explain reordering: the handles also move with ↑/↓."],"content":["Row labels are the names merchants gave the links or categories.","Heading is the menu or parent category name."],"accessibility":["The rows are nested lists (`list`/`listitem`), so screen readers announce the level and position.","Drag handles are buttons named \"Reorder {label}\": ↑/↓ move the row among its siblings, Home/End to the ends. The new position is announced.","In lists with a `group` (since 1.3), ↓ on the last row moves it to the top of the next list in the group and ↑ on the first row to the end of the previous one (lists that are collapsed, not sortable or in another group are skipped). Focus stays on the handle, and the target list announces \"Phone moved to Contact details, position 1 of 3.\"; the handle's hint says the arrows cross lists.","Touch: the handle drags with pointer events (and doesn't scroll the page); the row moves when the finger lifts. Mouse drags use HTML drag and drop.","Only top-level rows move between lists; nested rows move among their siblings. To change a row's parent item, edit it.","The collapse button has `aria-expanded` and is named \"Hide {heading}\" / \"Show {heading}\".","The heading is 20px semibold (16px on phones); drag handles use the `drag` icon; row actions come from your own components (toggle, buttons, badge)."],"responsive":["When the window is 640px wide or less, rows keep their 48px height with 8px side padding; child rows are indented 20px instead of 48px, and the list header is at least 56px tall with a 16px title."],"related":["accordion","toggle","resource-list"]},{"tag":"cm-report-tiles","slug":"report-tile","name":"Report tile","react":"ReportTiles","group":"Lists","summary":"Square tiles that open reports, grouped under a title such as \"Sales\".","lead":"146 × 120px tiles with a `border-subtle` edge, a 40px icon and a 14px medium name, 12px apart. Pinned tiles show a pin in the corner. On phones tiles are 104px high, three to a row, with a 32px icon.","docs_url":"https://commmerce.com/commmerceui/#components--report-tile","properties":[{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Group title, e.g. \"Sales\"."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"2","description":"Heading level for the title (1–6)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"`cm-report-tile` elements."}],"events":[],"parts":[{"tag":"cm-report-tile","react":"ReportTile","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Report name, two or three words."},{"attribute":"icon","property":"icon","type":"IconName","default":"'chart'","description":"System icon shown above the name."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Opens the report page."},{"attribute":"pinned","property":"pinned","type":"boolean","default":"false","description":"Shows a pin: the report is pinned to the dashboard."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"icon","description":"Your own 40px illustration, used instead of `icon`."}],"events":[{"name":"click","description":"When a tile without `href` is chosen."}]}],"examples":[{"title":"Sales reports","html":"<cm-report-tiles heading=\"Sales\">\n <cm-report-tile label=\"Hourly sales\" icon=\"clock\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Daily sales\" icon=\"calendar\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Monthly sales\" icon=\"chart\" href=\"#/components/report-tile\" pinned></cm-report-tile>\n <cm-report-tile label=\"Sales by product\" icon=\"box\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Sales by payment\" icon=\"cart\" href=\"#/components/report-tile\"></cm-report-tile>\n <cm-report-tile label=\"Customers\" icon=\"users\" href=\"#/components/report-tile\"></cm-report-tile>\n</cm-report-tiles>"}],"do":["Group tiles by subject (\"Sales\", \"Customers\", \"Inventory\") with one `cm-report-tiles` each.","Use `href` so tiles open in a new tab with a middle click.","Pin the reports merchants use most; pinned tiles also appear on the dashboard."],"dont":["Don't put numbers or charts in a tile: tiles only open reports. To show a total, use a Metric.","Don't use long names that wrap to three lines."],"content":["Names are two or three words in sentence case: \"Hourly sales\", \"Sales by payment\".","Group titles are one word where possible: \"Sales\"."],"accessibility":["Tiles form a list named by the group heading; each tile is one link (or button) named by its label.","A pinned tile adds \", pinned\" to its name; the pin icon itself is hidden.","Icons are decorative and hidden from screen readers.","Tiles use the line icons (`clock`, `calendar`, `chart`, …); pass your own artwork in the `icon` slot. Tiles stretch to fill the row on phones."],"responsive":["When the window is wider than 640px, tiles are 146px wide and each row holds as many as fit.","At 640px or less, each row holds exactly three tiles, which share the width; tiles are 104px tall with 32px icons and 13px names."],"related":["card","smart-tip","nested-list"]},{"tag":"cm-sparkline","slug":"sparkline","name":"Sparkline","react":"Sparkline","group":"Lists","summary":"A word-sized chart of one series over time, beside the figure it explains: visits in the last 30 days, orders this week.","lead":"Since 1.10.0. Bars (the default) for counts per day or week, a line (`type=\"line\"`) for a level that moves. No axes or numbers of its own: put the figure next to it. Neutral bars are grey with the latest one in the text colour; `tone=\"information\"` or `\"success\"` colours them. Time runs left to right in every language. Screen readers hear one sentence: the total, the peak (and when, with `labels`) and the latest value.","docs_url":"https://commmerce.com/commmerceui/#components--sparkline","properties":[{"attribute":"values","property":"values","type":"number[]","default":"[]","description":"The points, oldest first. In HTML: `values=\"[0,2,1,4]\"` or `values=\"0,2,1,4\"`."},{"attribute":"labels","property":"labels","type":"string[]","default":"[]","description":"Optional name of each point, oldest first (\"12 Nov\"), for the summary and the hover text."},{"attribute":"label","property":"label","type":"string","default":"''","description":"What the series is, e.g. \"Visits, last 30 days\". Used in the accessible summary."},{"attribute":"type","property":"type","type":"SparklineType","default":"'bars'","description":"`bars` (default) for counts; `line` for a level."},{"attribute":"tone","property":"tone","type":"SparklineTone","default":"'neutral'","description":"Colour: `neutral` (default, the text colour at 60%), `information` or `success`."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"summary","type":"string","description":"The sentence screen readers hear."}],"methods":[],"slots":[],"events":[],"parts":[],"examples":[{"title":"Visits on a record","description":"With `labels`, pointing at a bar shows its day and count.","html":"<cm-info-panel heading=\"Website visit summary\" style=\"max-width:360px\">\n <cm-info-item half label=\"Visits\">14</cm-info-item>\n <cm-info-item half label=\"Last visit\">Today, 10:42</cm-info-item>\n <cm-info-item label=\"Visits, last 14 days\">\n <cm-sparkline label=\"Visits, last 14 days\" values=\"[0,1,0,0,2,1,0,3,0,1,2,0,1,3]\"\n labels='[\"4 Nov\",\"5 Nov\",\"6 Nov\",\"7 Nov\",\"8 Nov\",\"9 Nov\",\"10 Nov\",\"11 Nov\",\"12 Nov\",\"13 Nov\",\"14 Nov\",\"15 Nov\",\"16 Nov\",\"17 Nov\"]'></cm-sparkline>\n </cm-info-item>\n</cm-info-panel>"},{"title":"Line and tones","html":"<div style=\"display:grid;gap:16px;max-width:240px\">\n <cm-sparkline type=\"line\" label=\"Visitor score, last 8 weeks\" values=\"[12,18,15,22,30,28,35,41]\"></cm-sparkline>\n <cm-sparkline tone=\"information\" label=\"Leads per day\" values=\"4,6,3,8,5,9,7\"></cm-sparkline>\n <cm-sparkline tone=\"success\" label=\"Orders per day\" values=\"2,3,5,4,6,8,9\"></cm-sparkline>\n</div>"}],"do":["Say what it covers in the label next to it (\"Visits, last 14 days\") and give the same words to `label`.","Use bars for counts and a line for levels."],"dont":["Don't use it where people need exact values or comparisons between series: use a table or a full chart.","Don't put more than about 60 points in it."],"content":["The label names the series and the period: \"Visits, last 14 days\"."],"accessibility":["One `role=\"img\"` with a sentence: \"Visits, last 14 days: 14 in all, peak 3 on 11 Nov, latest 3\". The words are built-in strings (`sparkline.*`), numbers follow the locale.","The hover text per bar is for mouse users only; everything in it is also in the sentence or the figure beside the chart."],"responsive":["32px tall by default (`--cm-sparkline-height`); as wide as its container, at most `--cm-sparkline-width`."],"related":["metric","info-panel","report-tile"]},{"tag":"cm-metric","slug":"metric","name":"Metric","react":"Metric","group":"Lists","summary":"One number with its name, such as a report total or KPI, optionally linking to the list behind it.","lead":"A card-like tile: a 14px medium label, a 24px semibold figure in tabular numerals (`type-heading-lg`), then an optional change (\"+12%\" with an arrow) and a quieter hint line. A number in `value` is formatted for the page language (\"1,240\"; lakh grouping \"12,40,000\" in `en-IN`); any other text is shown as given. With `href` the whole tile is one link. For a row of totals use Grid: there is no separate container.","docs_url":"https://commmerce.com/commmerceui/#components--metric","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"What is counted, e.g. \"SMB leads\". Two to four words."},{"attribute":"value","property":"value","type":"number | string","default":"''","description":"The figure. A number (or a plain number in the attribute, `value=\"1240\"`) is formatted for the locale:\n\"1,240\", and lakh grouping \"12,40,000\" in `en-IN`. Any other text (\"Rs. 2.4 L\", \"3 of 5\") is shown as given."},{"attribute":"hint","property":"hint","type":"string","default":"''","description":"One line under the figure in a quieter colour, e.g. \"2 past demos need a result\"."},{"attribute":"change","property":"change","type":"string","default":"''","description":"The change to show, written as you want it read, e.g. \"+12%\" or \"-3 vs last week\"."},{"attribute":"trend","property":"trend","type":"MetricTrend | undefined","description":"Direction of `change`: `up`, `down` or `flat`. Adds an arrow and says the direction to screen readers."},{"attribute":"trend-sentiment","property":"trendSentiment","type":"MetricSentiment","default":"'auto'","description":"Whether the change is good news. `auto` (default): up is positive (green), down is negative (red), flat is\nneutral. Set `negative` when up is bad (more refunds, more overdue tasks), `positive` when down is good."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the whole tile one link, named by the label and figure, e.g. to the list behind the number."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a placeholder instead of the figure and announces \"Loading <label>\" politely."},{"attribute":"_hasHint","property":"_hasHint","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"hint","description":"A hint with markup (e.g. a bold count), used instead of `hint`. No links or buttons: with `href` the whole tile is already one link."}],"events":[],"parts":[],"examples":[{"title":"Report totals with hints","description":"The CRM Reports row: each total opens its list. `cm-grid min-column-width` fits as many tiles as there is room for; resize the example to see the row wrap.","html":"<cm-grid min-column-width=\"260px\" gap=\"16\" lang=\"en-IN\">\n <cm-metric label=\"SMB leads\" value=\"1240\" href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Enterprise leads\" value=\"86\" href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Demos in the next 7 days\" value=\"3\" hint=\"2 past demos need a result\" href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Pipeline value\" value=\"Rs. 12,40,000\" hint=\"Open deals only\" href=\"#/components/metric\"></cm-metric>\n</cm-grid>"},{"title":"With a change","description":"`change` is the text to show, `trend` its direction. Up is good news and down bad by default; set `trend-sentiment=\"negative\"` when a rise is bad (more overdue tasks, more refunds) or `positive` when a fall is good. The arrow and the words read to screen readers carry the meaning, not only the colour.","html":"<cm-grid min-column-width=\"200px\" gap=\"16\" lang=\"en-IN\">\n <cm-metric label=\"Won deals\" value=\"48\" change=\"+12%\" trend=\"up\" hint=\"vs last month\"></cm-metric>\n <cm-metric label=\"New leads\" value=\"1240\" change=\"-5%\" trend=\"down\" hint=\"vs last month\"></cm-metric>\n <cm-metric label=\"Overdue tasks\" value=\"9\" change=\"+3\" trend=\"up\" trend-sentiment=\"negative\" hint=\"since yesterday\"></cm-metric>\n <cm-metric label=\"Average reply time\" value=\"2 h\" change=\"0%\" trend=\"flat\" hint=\"vs last week\"></cm-metric>\n</cm-grid>"},{"title":"Loading","description":"While the totals are fetched, set `loading`: a placeholder takes the figure's place, the tile is `aria-busy` and \"Loading <label>\" is announced politely. Keep the label visible so the row doesn't jump.","html":"<cm-grid min-column-width=\"200px\" gap=\"16\">\n <cm-metric label=\"SMB leads\" loading href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Demos in the next 7 days\" loading href=\"#/components/metric\"></cm-metric>\n <cm-metric label=\"Pipeline value\" loading href=\"#/components/metric\"></cm-metric>\n</cm-grid>"},{"title":"A single metric","description":"A hint with markup goes in the `hint` slot. Without `href` the tile is plain text: nothing to focus.","html":"<cm-metric label=\"Tickets waiting\" value=\"17\" style=\"max-width:260px\">\n <span slot=\"hint\"><strong>4</strong> older than a day</span>\n</cm-metric>"}],"do":["Pass numbers as numbers (`value=\"1240\"`, or `value={1240}` in React) so they are grouped for the page language; pass text only when it is already formatted, such as money with a currency (\"Rs. 12,40,000\").","Link each total to the list behind it with `href`, filtered to the same records the number counts.","Put a row of metrics in `cm-grid` with `min-column-width` (about 200px) so it wraps on narrow screens.","Say what the change compares with in the hint: \"vs last month\".","Set `trend-sentiment` whenever up is not good news."],"dont":["Don't use it to open a report that has no single number: use a Report tile.","Don't rely on colour for good or bad: always set `trend`, so there is an arrow and the direction is read out.","Don't put buttons or other links inside a linked metric: the whole tile is one link.","Don't show more than one figure in a tile: split it into two metrics."],"content":["Labels name what is counted, in two to four words and sentence case: \"SMB leads\", \"Demos in the next 7 days\".","Hints are one short line, no full stop: \"2 past demos need a result\".","Write the change as it should read, with its sign: \"+12%\", \"-3\"."],"accessibility":["With `href` the tile is a single link whose accessible name is the label and the figure (\"SMB leads 1,240\"); the change and hint are its description. Without `href` nothing in it takes focus.","The change arrow is decorative; screen readers hear the direction and whether it is good news in words (\"Up +12%, good\"). Wording is in the `metric` strings (`up`, `down`, `flat`, `good`, `bad`).","While `loading`, the figure is replaced by a hidden placeholder, the tile has `aria-busy=\"true\"` and \"Loading <label>\" is announced through a polite status region (key `loadingValue`).","Colours meet WCAG AA on `bg-surface` in light and dark: label and figure `text-default`, hint and flat change `text-tertiary`, good `text-success`, bad `text-critical`. These pairs are in the token contrast check.","Arrows follow the reading direction: in right-to-left text up points up-left and down points down-left.","The figure uses the `type-heading-lg` token: 24px semibold (20px on phones)."],"responsive":["Fills the width it is given; put a row of metrics in a `cm-grid` with `min-column-width`, which drops to fewer columns, and to one on phones, as the space shrinks.","When the window is 640px wide or less, the tile padding is 12px instead of 20px and the figure is 20px instead of 24px. Long figures and labels wrap instead of overflowing.","In a grid row, every metric stretches to the height of the tallest, so tiles with and without a hint line up."],"related":["grid","report-tile","card"]},{"tag":"cm-app-frame","slug":"app-frame","name":"App frame","react":"AppFrame","group":"Navigation","summary":"The admin's frame: header bar, side or bottom navigation, mobile menu and the page, in their places.","lead":"One element that puts the parts of the admin together: the Header bar across the top, the Side navigation down the start side, the page next to it, and on phones and small tablets the Bottom navigation with the Mobile menu instead. Every Commmerce product gets the same grid without writing its own CSS. See Admin frame for the whole thing at desktop and phone widths. Add `panel` for the merchant dashboard look: a white header on the grey page, the side navigation as an inset card, and the page in a white panel with 12px corners and a 1px `border-subtle` edge, `space-20` from the navigation and the window edges (`--cm-app-frame-gutter` changes it). A `cm-page` inside drops its grey background. On phones the panel runs edge to edge.","docs_url":"https://commmerce.com/commmerceui/#components--app-frame","properties":[{"attribute":"menu-open","property":"menuOpen","type":"boolean","default":"false","description":"Shows the mobile menu (on narrow frames). Set it yourself, or let `menu-item` do it."},{"attribute":"menu-item","property":"menuItem","type":"string","default":"''","description":"Value of the bottom navigation item that opens and closes the mobile menu, e.g. `more` for\n`<cm-nav-item label=\"More\" value=\"more\">`. When set, choosing it toggles `menu-open`, Escape closes the\nmenu, and choosing a row in the menu closes it. Empty: you wire the menu yourself."},{"attribute":"panel","property":"panel","type":"boolean","default":"false","description":"Shows the page in a white rounded panel beside the side navigation, with a gutter around it, on the grey page:\nthe merchant dashboard frame. A `cm-page` inside gets a transparent background. Phones: the panel is edge to edge."},{"attribute":"_wide","property":"_wide","type":"boolean","default":"false"}],"script_properties":[{"property":"wide","description":"True while the frame is 1024px wide or more and shows the side navigation instead of the bottom navigation."}],"methods":[{"name":"openMenu","description":"Opens the mobile menu and moves focus into it."},{"name":"closeMenu","description":"Closes the mobile menu and returns focus to where it was before the menu opened."},{"name":"toggleMenu","description":"Opens the mobile menu if it is closed, closes it if it is open."}],"slots":[{"name":"header","description":"A `cm-header-bar`."},{"name":"navigation","description":"A `cm-side-navigation`. Shown when the frame is 1024px wide or more. Collapse it with its `collapsed` attribute; the frame follows its width."},{"name":"(default)","description":"The page, usually a `cm-page`. Wrapped in the frame's `main` landmark."},{"name":"bottom-navigation","description":"A `cm-bottom-navigation`. Shown, fixed to the bottom of the window, when the frame is narrower than 1024px. No need to set its `fixed` attribute."},{"name":"mobile-menu","description":"A `cm-mobile-menu`. Shown over the page while `menu-open` is set and the frame is narrower than 1024px."}],"events":[{"name":"cm-menu-toggle","description":"When the frame opens or closes the mobile menu itself: from the `menu-item` in the bottom navigation, Escape, or a choice in the menu. `detail: { open }`. Not fired when you set `menu-open` yourself. With `panel` the frame takes the merchant dashboard's look: the page sits in a white rounded panel (`bg-surface`, `radius-lg`, a 1px `border-subtle`) with a `space-20` gutter beside and below the side navigation card, on the grey `bg-page` under the white header. A `cm-page` inside drops its own grey background. Narrower than 1024px (bottom navigation) the panel runs edge to edge, white, without a gutter or corners, so phones keep every pixel of width."}],"parts":[],"examples":[{"title":"Desktop, with panel","description":"`panel`: the page in a white rounded panel beside the side navigation card, on the grey page under the white header. The frame is 1100px wide here (scroll sideways in a narrow preview), so it shows the desktop layout.","html":"<div style=\"height:520px;overflow:auto;border-radius:12px;--cm-app-frame-height:520px\">\n<div style=\"width:1100px;transform:translateZ(0)\">\n<cm-app-frame panel>\n <cm-header-bar slot=\"header\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"152\" height=\"11\">\n </cm-header-bar>\n <cm-side-navigation slot=\"navigation\">\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#/components/app-frame\" current badge=\"12\"></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#/components/app-frame\"></cm-nav-item>\n </cm-side-navigation>\n <cm-page>\n <cm-page-header slot=\"header\" heading=\"Orders\"><cm-button slot=\"actions\" variant=\"primary\">Create order</cm-button></cm-page-header>\n <cm-card heading=\"Today\">12 orders · Rs. 18,400</cm-card>\n </cm-page>\n</cm-app-frame>\n</div>\n</div>"},{"title":"Phone: bottom navigation and menu","description":"The preview is narrower than 1024px, so it shows the phone layout. Press More to open the Mobile menu, and again (or Esc) to close it. The two outer divs only keep the example in its box: in your app, `cm-app-frame` is the top element of the page. The desktop layout is on the Admin frame page.","html":"<div style=\"height:560px;transform:translateZ(0);overflow:hidden;border-radius:12px;--cm-app-frame-height:560px\">\n<div style=\"height:100%;overflow:auto\">\n<cm-app-frame panel menu-item=\"more\">\n <cm-header-bar slot=\"header\" store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n </cm-header-bar>\n <cm-side-navigation slot=\"navigation\" collapsible>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#/components/app-frame\" current badge=\"12\"></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#/components/app-frame\"></cm-nav-item>\n </cm-side-navigation>\n <cm-page>\n <cm-page-header slot=\"header\" heading=\"Orders\"></cm-page-header>\n <cm-card heading=\"Today\">12 orders · Rs. 18,400</cm-card>\n </cm-page>\n <cm-bottom-navigation slot=\"bottom-navigation\">\n <cm-nav-item label=\"Home\" icon=\"home\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#/components/app-frame\" current></cm-nav-item>\n <cm-nav-item label=\"Quick add\" icon=\"plus\" primary></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"More\" icon=\"more\" value=\"more\"></cm-nav-item>\n </cm-bottom-navigation>\n <cm-mobile-menu slot=\"mobile-menu\" store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <cm-nav-item label=\"Panels\">\n <cm-nav-item label=\"Customers\" icon=\"users\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Reports\" icon=\"chart\" href=\"#/components/app-frame\"></cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\" href=\"#/components/app-frame\"></cm-nav-item>\n </cm-nav-item>\n </cm-mobile-menu>\n</cm-app-frame>\n</div>\n</div>"}],"do":["Make it the top element of every page of a Commmerce product, with the same navigation items on every page.","Use `panel` for products built on the merchant dashboard frame (the admin, CRM). It replaces hand-written margins and corners around the page: delete those when you add it.","Set `menu-item=\"more\"` and give the bottom navigation's More item `value=\"more\"`, unless you need to open the menu yourself.","Remember the merchant's collapsed side navigation: listen for `cm-collapse` and set `collapsed` from what you stored."],"dont":["Don't use it inside an app: the admin already draws this frame around apps.","Don't put another `main`, `header` or `nav` around its parts: the frame and the parts bring their own landmarks.","Don't set `fixed` on the bottom navigation or position the parts yourself: the frame does it."],"content":["The frame has no text of its own. Words come from the parts."],"accessibility":["Adds one landmark, `main`, around the page. The header bar is the `banner` and each navigation is a `nav`; only the one that fits the width is shown, so screen readers find a single main menu.","While the mobile menu is open, the header and page behind it are inert, so Tab and screen readers stay in the menu and the bottom navigation.","With `menu-item`, opening the menu moves focus to its first row; Esc or More closes it and focus goes back to More. Choosing a row closes it.","Logical CSS: in right-to-left languages the side navigation is on the right.","The bottom navigation's More button does not say whether the menu is open (no `aria-expanded`): it is a navigation item, like the other tabs."],"responsive":["Follows the frame's own width (normally the window's): at 1024px and wider the side navigation sits on the start side under the header; narrower, the side navigation is hidden and the bottom navigation is fixed to the bottom of the window, with the page padded so nothing hides behind it.","With `panel`, at 1024px and wider the page sits in a white rounded panel with a `space-20` gutter; narrower, the panel is edge to edge without corners.","The header sticks to the top, below the device's notch or status bar (`env(safe-area-inset-top)`). The side navigation sticks under the header and scrolls on its own when it is taller than the window. The page scrolls with the window.","The mobile menu, while `menu-open` is set and the frame is narrower than 1024px, covers the window above the page and header and below the bottom navigation."],"related":["side-navigation","header-bar","bottom-navigation","mobile-menu","page"]},{"tag":"cm-side-navigation","slug":"side-navigation","name":"Side navigation","react":"SideNavigation","group":"Navigation","summary":"The admin's main menu down the left of the page, with sections that open.","lead":"A 220px black panel (owner standard, 1.6; was 250px) with 12px corners, inset 20px from the page edges. Each 36px row (44px on touch screens), padded 12px at the sides, has a 20px line icon and a 14px label (sub-items 32px); badges are small sentence-case pills; sections end in a chevron and open to show their sub-items. The current page is white and bold, the rest light grey. Items come from `cm-nav-item` children or a JSON `items` property, so every Commmerce product can fill it with its own destinations.","docs_url":"https://commmerce.com/commmerceui/#components--side-navigation","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Items as data. Used instead of `cm-nav-item` children when set."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Default: the built-in string `label` (\"Main\")."},{"attribute":"collapsed","property":"collapsed","type":"boolean","default":"false","description":"Shows only the icons, in a narrow rail. Labels become tooltips and stay the items' accessible names; sub-items are hidden."},{"attribute":"collapsible","property":"collapsible","type":"boolean","default":"false","description":"Adds a button at the bottom that collapses the menu to icons and expands it again, firing `cm-collapse`."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"_open","property":"_open","default":"new Set<string>()"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"navItems","type":"NavItem[]","description":"The items in use."}],"methods":[{"name":"toggle","description":"Opens or closes the section at `index`."}],"slots":[{"name":"(default)","description":"`cm-nav-item` elements (nest them for sub-items)."},{"name":"header","description":"Optional content above the items, such as a store switcher on narrow layouts."},{"name":"footer","description":"Optional content below the items."}],"events":[{"name":"cm-expand","description":"When a section opens or closes. `detail: { item, expanded }`."},{"name":"cm-collapse","description":"When the merchant collapses the menu to icons or expands it again: from the built-in button (`collapsible`), or by choosing a section while collapsed (that expands the menu and opens the section). `detail: { collapsed }`. Cancelable: call `preventDefault()` to keep the current state. Not fired when you set `collapsed` yourself."},{"name":"cm-navigate","description":"When an item is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app instead of following the link."}],"parts":[{"tag":"cm-nav-item","react":"NavItemElement","properties":[{"attribute":"label","property":"label","type":"string","default":"''","description":"Visible text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Where the item goes. Leave empty on a parent that only opens its sub-items."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the item in `cm-navigate` handlers."},{"attribute":"current","property":"current","type":"boolean","default":"false","description":"The page the merchant is on."},{"attribute":"badge","property":"badge","type":"string","default":"''","description":"Short text after the label, e.g. \"New\"."},{"attribute":"expanded","property":"expanded","type":"boolean","default":"false","description":"Sub-items start open."},{"attribute":"primary","property":"primary","type":"boolean","default":"false","description":"Bottom navigation only: the one main action, drawn as a black square (Quick add)."}],"script_properties":[],"methods":[{"name":"toItem","description":"This item and its sub-items as plain data."}],"slots":[{"name":"(default)","description":"Child `cm-nav-item`s (sub-items)."}],"events":[]}],"examples":[{"title":"Commmerce admin","description":"The items of the live admin. A section that holds the current page opens on its own.","html":"<cm-side-navigation>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#dashboard\" current></cm-nav-item>\n <cm-nav-item label=\"Catalog\" icon=\"box\">\n <cm-nav-item label=\"Products\" href=\"#products\"></cm-nav-item>\n <cm-nav-item label=\"Categories\" href=\"#categories\"></cm-nav-item>\n <cm-nav-item label=\"Inventory\" href=\"#inventory\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\">\n <cm-nav-item label=\"All orders\" href=\"#orders\"></cm-nav-item>\n <cm-nav-item label=\"Abandoned carts\" href=\"#abandoned\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"WebPOS\" icon=\"pos\" href=\"#webpos\"></cm-nav-item>\n <cm-nav-item label=\"Customers\" icon=\"users\">\n <cm-nav-item label=\"All customers\" href=\"#customers\"></cm-nav-item>\n <cm-nav-item label=\"Customer groups\" href=\"#customer-groups\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Subscriptions\" icon=\"repeat\" href=\"#subscriptions\"></cm-nav-item>\n <cm-nav-item label=\"Website\" icon=\"website\">\n <cm-nav-item label=\"Themes\" href=\"#themes\"></cm-nav-item>\n <cm-nav-item label=\"Pages\" href=\"#pages\"></cm-nav-item>\n <cm-nav-item label=\"Menus\" href=\"#menus\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Apps\" icon=\"apps\" href=\"#apps\"></cm-nav-item>\n <cm-nav-item label=\"Reports\" icon=\"chart\" href=\"#reports\"></cm-nav-item>\n <cm-nav-item label=\"Marketing\" icon=\"megaphone\">\n <cm-nav-item label=\"Discounts\" href=\"#discounts\"></cm-nav-item>\n <cm-nav-item label=\"Campaigns\" href=\"#campaigns\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Staff\" icon=\"staff\">\n <cm-nav-item label=\"Team members\" href=\"#staff\"></cm-nav-item>\n <cm-nav-item label=\"Roles\" href=\"#roles\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\">\n <cm-nav-item label=\"Store details\" href=\"#store\"></cm-nav-item>\n <cm-nav-item label=\"Payments\" href=\"#payments\"></cm-nav-item>\n <cm-nav-item label=\"Shipping\" href=\"#shipping\"></cm-nav-item>\n </cm-nav-item>\n</cm-side-navigation>"},{"title":"Inside a sub-section","description":"Mark the sub-item as `current`; its section opens and its label turns white.","html":"<cm-side-navigation>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#dashboard\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\">\n <cm-nav-item label=\"All orders\" href=\"#orders\" current></cm-nav-item>\n <cm-nav-item label=\"Abandoned carts\" href=\"#abandoned\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Apps\" icon=\"apps\" href=\"#apps\" badge=\"New\"></cm-nav-item>\n</cm-side-navigation>"},{"title":"Collapsed to icons","description":"`collapsed` shows a 72px rail. Hover or focus an item to see its label; a numeric badge stays as a small count, any other badge as a dot. `collapsible` adds the button at the bottom, which fires `cm-collapse` so your app can remember the choice. Choosing a section in the rail expands the menu and opens the section.","html":"<cm-side-navigation collapsed collapsible>\n <cm-nav-item label=\"Dashboard\" icon=\"home\" href=\"#dashboard\"></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#orders\" current badge=\"12\"></cm-nav-item>\n <cm-nav-item label=\"Customers\" icon=\"users\" href=\"#customers\"></cm-nav-item>\n <cm-nav-item label=\"Apps\" icon=\"apps\" href=\"#apps\" badge=\"New\"></cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\">\n <cm-nav-item label=\"Store details\" href=\"#store\"></cm-nav-item>\n <cm-nav-item label=\"Payments\" href=\"#payments\"></cm-nav-item>\n </cm-nav-item>\n</cm-side-navigation>"}],"do":["Use one side navigation per product, on every page, with the same items in the same order.","Mark exactly one item `current`.","Use the `cm-navigate` event (and `preventDefault()`) when your app routes on the client.","Below 1024px, hide it and show a Bottom navigation with a Mobile menu instead. The App frame does this for you.","To let merchants collapse it, add `collapsible` (or your own button that sets `collapsed`), listen for `cm-collapse` and store the choice, so the menu stays collapsed on the next page.","Give every item an icon if the menu can be collapsed: without one, the rail shows the label's first letter."],"dont":["Don't use it inside an app: apps run inside the admin, which already has this menu.","Don't nest more than one level: deeper items are listed under their section, indented.","Don't put actions (\"Add product\") in the menu: it only goes to places."],"content":["One or two words per item, naming a place: \"Orders\", \"Staff\". Keep each label to about 18 characters so it fits the 220px menu on one line; a longer label wraps and crowds its row.","Keep the order merchants know: Dashboard first, Settings last."],"accessibility":["A `nav` landmark named \"Main\" (set `label` to change it). Items are links; the current one has `aria-current=\"page\"`.","Sections are buttons with `aria-expanded` and `aria-controls`. Enter or Space opens and closes them; → opens, ← closes or goes back to the section from a sub-item.","↑/↓ move between visible items, Home/End jump to the first and last. Tab still moves through every item.","Collapsed: each item keeps its label as its accessible name (visually hidden, with the badge in brackets) and shows it in a tooltip on hover and keyboard focus. The tooltip only repeats the name, so it is not added as a description. Sub-items are hidden; a section is a button that expands the menu and opens it. ← and → do nothing in the rail. The built-in button is named \"Collapse menu\" or \"Expand menu\" (translatable: `collapse`, `expand`).","Unselected items use the new `text-on-dark-secondary` token (#B5B5B5, 10:1 on black, AA on the hover fill); icons are decorative.","Differs from the live admin screenshot: icons are our line icons (the admin uses filled glyphs); new icons drawn for this: `pos`, `repeat`, `website`, `apps`, `megaphone`, `staff`. The source of truth is the admin screenshot, not the older Figma \"Dashboard\" page."],"related":["app-frame","header-bar","bottom-navigation","mobile-menu","tooltip"]},{"tag":"cm-header-bar","slug":"header-bar","name":"Header bar","react":"HeaderBar","group":"Navigation","summary":"The white bar across the top of the admin: logo, store switcher, account actions and the user.","lead":"A 56px white bar with 14px text. The logo sits on the left, then the store switcher (with a chevron). On the right: your action buttons, the wallet balance in an outlined 36px pill and the user in a 36px rounded pill with the name and a 28px avatar. It fits its own width: under 900px the action buttons hide, and under 640px only the logo, the store and the avatar remain (put the rest in the Mobile menu). A product-wide search goes in the `search` slot: inline after the store switcher on wide bars, and behind a search button that opens it full screen at 900px or narrower.","docs_url":"https://commmerce.com/commmerceui/#components--header-bar","properties":[{"attribute":"store","property":"store","type":"string","default":"''","description":"Current store's address or name, shown as the store switcher (\"preprod.commmerce.com\"). Empty hides it."},{"attribute":"balance","property":"balance","type":"string","default":"''","description":"Wallet balance, already formatted (\"₹ 2,312\"). Empty hides the pill."},{"attribute":"user-name","property":"userName","type":"string","default":"''","description":"Signed-in user's name. Empty hides the user pill."},{"attribute":"avatar-src","property":"avatarSrc","type":"string","default":"''","description":"Avatar image URL. Without it, the initials of `user-name` are shown."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the header's toolbar region. Default: the built-in string `label` (\"Admin\")."},{"attribute":"search-label","property":"searchLabel","type":"string","description":"Accessible name of the search button on narrow bars and of the search layer. Default: the built-in string `search` (\"Search\")."},{"attribute":"_narrow","property":"_narrow","type":"boolean","default":"false"},{"attribute":"_hasSearch","property":"_hasSearch","type":"boolean","default":"false"},{"attribute":"_searchOpen","property":"_searchOpen","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"searchOpen","type":"boolean","description":"True while the full-screen search layer is open."}],"methods":[{"name":"openSearch","description":"Brings up the search: focuses it on wide bars, or opens the full-screen layer on narrow ones."},{"name":"closeSearch","description":"Closes the full-screen search layer, and returns focus to the search button."}],"slots":[{"name":"logo","description":"The product logo (an `<img>` or `<svg>`), linked to the dashboard if you wrap it in `<a>`."},{"name":"actions","description":"Buttons such as \"Hire an Expert\" (secondary) and \"My Subscription\" (primary)."},{"name":"end","description":"Controls before the signed-in person, in this order: refresh, then notifications (1.9.2: the user comes last)."},{"name":"account","description":"The signed-in person's menu, last in the bar: a `cm-account-menu` (since 1.9.2). Use it instead of `user-name`."},{"name":"search","description":"One search box for the whole product, usually `cm-global-search`. Inline on wide bars; behind a search button that opens a full-screen layer at 900px or narrower."}],"events":[{"name":"name"},{"name":"cm-store-switch","description":"When the store switcher is pressed. Open your store list in response."},{"name":"cm-wallet","description":"When the wallet balance is pressed."},{"name":"cm-account","description":"When the user pill is pressed. Open the account menu in response."},{"name":"cm-search-toggle","description":"When the full-screen search layer opens or closes (narrow bars), with `detail: { open }`."}],"parts":[],"examples":[{"title":"Commmerce admin","html":"<cm-header-bar store=\"preprod.commmerce.com\" balance=\"₹ 2,312\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n <cm-button slot=\"actions\" size=\"large\">Hire an Expert</cm-button>\n <cm-button slot=\"actions\" variant=\"primary\" size=\"large\">My Subscription</cm-button>\n</cm-header-bar>"},{"title":"With global search","description":"Put a Global search in the `search` slot. This preview is narrower than 900px, so the bar shows the search button: press it to open the search full screen (Escape, the close button or choosing a result closes it). In a full-width admin the box sits inline after the store switcher.","html":"<cm-header-bar store=\"preprod.commmerce.com\" user-name=\"Demo user\">\n <img slot=\"logo\" src=\"assets/logo-placeholder-mark.svg\" alt=\"Store logo\" width=\"24\" height=\"24\">\n <cm-global-search slot=\"search\" label=\"Search the CRM\" placeholder=\"Search leads, deals, contacts\" shortcut=\"/\"\n results='[{\"label\": \"Leads\", \"items\": [{\"title\": \"Ravi Stores\", \"description\": \"Lead · Mumbai\", \"href\": \"#lead-ravi-stores\"}]}]'></cm-global-search>\n</cm-header-bar>"},{"title":"Logo and user only","description":"Products without stores or a wallet leave those attributes out.","html":"<cm-header-bar user-name=\"Asha Rao\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n</cm-header-bar>"},{"title":"Notifications bell","description":"Put an icon-only Button in the `end` slot with the unread count, and open the Notification panel when it is pressed (here with `data-opens`; in your product, call the panel's `show()` in a click listener). Keep `count` in step with the unread items. The bar has no notifications API of its own: the button and the panel are yours to wire.","html":"<cm-header-bar user-name=\"Asha Rao\">\n <img slot=\"logo\" src=\"assets/logo-placeholder.svg\" alt=\"Store logo\" width=\"190\" height=\"14\">\n <cm-button slot=\"end\" icon-only icon=\"bell\" label=\"Notifications\" count=\"2\" size=\"large\" data-opens=\"header-notes\"></cm-button>\n</cm-header-bar>\n<cm-notification-panel id=\"header-notes\" more-href=\"#notifications\">\n <cm-notification-item time=\"1 min ago\" href=\"#order-1042\" unread>New order received</cm-notification-item>\n <cm-notification-item time=\"12 mins ago\" tone=\"attention\" href=\"#stock\" unread>Product low stock</cm-notification-item>\n <cm-notification-item time=\"1 hr ago\" tone=\"success\" href=\"#order-1041\">Payment received</cm-notification-item>\n</cm-notification-panel>"}],"do":["Show it on every admin page, above the Side navigation.","Put one product-wide search in the `search` slot, not in `actions` (actions hide on narrow bars; the search slot collapses to a button instead).","Keep to two action buttons, with at most one primary.","Open a store list on `cm-store-switch` and an account menu on `cm-account` (menus arrive with batch 4)."],"dont":["Don't use it inside an app: the admin already shows it above the app.","Don't put page actions (\"Save\", \"Add product\") here; they belong in the Page header.","Don't format the balance in the component: pass the text the merchant should see."],"content":["Show the store's address or name exactly as the merchant set it.","Buttons are short and in title case as in the live admin: \"Hire an Expert\", \"My Subscription\"."],"accessibility":["A `banner` landmark. The store switcher, balance and user pill are buttons named \"Store: … Switch store\", \"Wallet balance …\" and \"Account: …\", which include their visible text.","On narrow bars the search button is named \"Search\" (`search-label`) with `aria-haspopup=\"dialog\"` and `aria-expanded`. It opens a full-screen modal `<dialog>` with the same name: focus moves into the search box, the page behind is inert and does not scroll, Escape (once the results are closed) or the close button closes it, and focus returns to the button.","The store and user buttons say they open a menu (`aria-haspopup`).","The logo needs its own `alt` text that names it: the store, product or app.","Differs from the live admin screenshot: the avatar is a person line icon on `bg-input-filled` when there is no photo; the examples show a placeholder logo, since the `logo` slot takes your product's or app's own logo; the 18px store text shrinks to 16px when the bar is under 1100px wide."],"responsive":["Follows the bar's own width, not the window: at 900px or narrower the `actions` slot is hidden and the `search` slot moves behind a search button that opens it full screen; at 640px or narrower the wallet balance is hidden too and the user pill shrinks to the avatar (the name is still read by screen readers). On touch screens every control in the bar is at least 44 × 44px."],"related":["side-navigation","mobile-menu","button"]},{"tag":"cm-bottom-navigation","slug":"bottom-navigation","name":"Bottom navigation","react":"BottomNavigation","group":"Navigation","summary":"The admin's tab bar on phones: five destinations along the bottom of the screen.","lead":"A white bar with 12px top corners and a hairline along its top. Each item is a 20px line icon over a 12px label in sentence case. The current item is black, the others grey; the main action (`primary`, Quick add) is a black square with a white plus. The last item, \"More\", opens the Mobile menu.","docs_url":"https://commmerce.com/commmerceui/#components--bottom-navigation","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Items as data. Used instead of `cm-nav-item` children when set."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Default: the built-in string `label` (\"Main\")."},{"attribute":"fixed","property":"fixed","type":"boolean","default":"false","description":"Pins the bar to the bottom of the viewport, above the device's home indicator."},{"attribute":"menu-item","property":"menuItem","type":"string","default":"''","description":"Value of the item that opens the Mobile menu (usually `more`). It gets `aria-expanded`."},{"attribute":"menu-open","property":"menuOpen","type":"boolean","default":"false","description":"The Mobile menu is open: the `menu-item` shows as the current tab instead of the page's own tab."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"navItems","type":"NavItem[]","description":"The items in use."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-nav-item` elements (no nesting)."}],"events":[{"name":"cm-navigate","description":"When an item is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app. Items without `href` only fire this event (e.g. \"More\" opens the Mobile menu)."}],"parts":[],"examples":[{"title":"Commmerce admin on a phone","html":"<div style=\"max-width:414px\">\n<cm-bottom-navigation>\n <cm-nav-item label=\"Home\" icon=\"home\" href=\"#home\" current></cm-nav-item>\n <cm-nav-item label=\"Products\" icon=\"box\" href=\"#products\"></cm-nav-item>\n <cm-nav-item label=\"Quick add\" icon=\"plus\" primary></cm-nav-item>\n <cm-nav-item label=\"Orders\" icon=\"bag\" href=\"#orders\"></cm-nav-item>\n <cm-nav-item label=\"More\" icon=\"more\" value=\"more\"></cm-nav-item>\n</cm-bottom-navigation>\n</div>"}],"do":["Show it below 1024px instead of the Side navigation, pinned with `fixed`, or put it in the App frame's `bottom-navigation` slot, which pins it and pads the page for you.","Keep to five items; the fifth is \"More\" and opens the Mobile menu (listen for `cm-navigate` with `value` \"more\").","While the Mobile menu is open, \"More\" is the current tab: set `menu-item=\"more\"` and toggle `menu-open` with the menu, so More is highlighted and reports `aria-expanded`. The page's own tab keeps `aria-current`. In the App frame with `menu-item`, the frame does this for you.","Leave space at the bottom of the page so the bar never covers content.","`fixed` pins the bar with `position: fixed` on the element itself, so a `position` you set on `cm-bottom-navigation` in your own CSS (for example `position: relative` from a reset or a utility class) wins and the bar stops being pinned. Don't set `position` on a fixed bar, or wrap it in your own fixed container. The App frame handles this for you: in its `bottom-navigation` slot the bar is pinned by the frame's own container, whatever position the element has."],"dont":["Don't use it inside an app.","Don't mark more than one item `primary`.","Don't use labels longer than one word: they are truncated."],"content":["One word per item: \"Home\", \"Products\", \"Orders\", \"More\". Write them in sentence case; they are shown as written."],"accessibility":["A `nav` landmark named \"Main\". Items are links (current one with `aria-current=\"page\"`) or buttons for actions such as Quick add and More.","Targets are at least 48px tall and a fifth of the width.","Labels are 12px, the smallest text in the system; unselected items are `text-tertiary` grey. With `fixed`, the bar pads for the device's home indicator."],"related":["app-frame","mobile-menu","side-navigation"]},{"tag":"cm-mobile-menu","slug":"mobile-menu","name":"Mobile menu","react":"MobileMenu","group":"Navigation","summary":"The admin's full menu on phones, opened from \"More\": store, user and every section.","lead":"A grey page of white cards with 12px corners. The Profile card shows the store (\"Logged in to store\") and the signed-in user. Then come labelled sections (13px grey headings in sentence case) of 48px rows with 16px text, a grey 20px icon and a chevron. Rows with sub-items open them on a second screen with a back arrow. A section can end with a centred action such as \"Add channel\".","docs_url":"https://commmerce.com/commmerceui/#components--mobile-menu","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Sections as data: `[{ label: 'Panels', items: [{ label: 'Reports', icon: 'chart', href }] }]`. Used instead of children when set."},{"attribute":"store","property":"store","type":"string","default":"''","description":"Store the merchant is signed in to. Empty hides the store row."},{"attribute":"user-name","property":"userName","type":"string","default":"''","description":"Signed-in user's name. Empty hides the user row."},{"attribute":"user-email","property":"userEmail","type":"string","default":"''","description":"Signed-in user's email, under the name."},{"attribute":"avatar-src","property":"avatarSrc","type":"string","default":"''","description":"Avatar image URL. Without it, the first letter of the name is shown."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation landmark. Default: the built-in string `label` (\"Menu\")."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"_page","property":"_page","type":"[number, number] | null","default":"null","description":"Path of the open sub-page as [section, row], or null on the main page."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"sections","type":"NavItem[]","description":"The sections in use."}],"methods":[{"name":"back","description":"Returns to the main page from a sub-page."}],"slots":[{"name":"(default)","description":"`cm-nav-item` sections, each holding row items."}],"events":[{"name":"name"},{"name":"cm-navigate","description":"When a row is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app."},{"name":"cm-store-switch","description":"When the store card is pressed."},{"name":"cm-account","description":"When the user row is pressed."}],"parts":[],"examples":[{"title":"Commmerce admin","html":"<div style=\"max-width:414px\">\n<cm-mobile-menu store=\"Obiroye Garments Zix\" user-name=\"Robinson Jain\" user-email=\"robinson@example.com\">\n <cm-nav-item label=\"Channels\">\n <cm-nav-item label=\"Online Store\" icon=\"store\" href=\"#online-store\"></cm-nav-item>\n <cm-nav-item label=\"Point of sale\" icon=\"pos\" href=\"#pos\"></cm-nav-item>\n <cm-nav-item label=\"ONDC\" icon=\"globe\" href=\"#ondc\"></cm-nav-item>\n <cm-nav-item label=\"Add channel\" primary value=\"add-channel\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Panels\">\n <cm-nav-item label=\"Customers\" icon=\"users\" href=\"#customers\"></cm-nav-item>\n <cm-nav-item label=\"Reports\" icon=\"chart\" href=\"#reports\"></cm-nav-item>\n <cm-nav-item label=\"Marketing\" icon=\"megaphone\" href=\"#marketing\"></cm-nav-item>\n <cm-nav-item label=\"Application\" icon=\"apps\" href=\"#apps\" badge=\"3 apps active\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Support\">\n <cm-nav-item label=\"Hire an Expert\" icon=\"user\" href=\"#expert\" badge=\"New\"></cm-nav-item>\n <cm-nav-item label=\"Help Centre\" icon=\"help\" href=\"#help\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item label=\"Subscription\">\n <cm-nav-item label=\"Subscription\" icon=\"repeat\" href=\"#subscription\"></cm-nav-item>\n <cm-nav-item label=\"Refer and Earn\" icon=\"gift\" href=\"#refer\"></cm-nav-item>\n </cm-nav-item>\n <cm-nav-item>\n <cm-nav-item label=\"Settings\" icon=\"settings\">\n <cm-nav-item label=\"Shipping\" href=\"#shipping\"></cm-nav-item>\n <cm-nav-item label=\"Packaging Material\" href=\"#packaging\"></cm-nav-item>\n <cm-nav-item label=\"Tax\" href=\"#tax\"></cm-nav-item>\n <cm-nav-item label=\"Domain Setup\" href=\"#domain\"></cm-nav-item>\n <cm-nav-item label=\"Password Protection\" href=\"#password\"></cm-nav-item>\n <cm-nav-item label=\"Staff Management\" href=\"#staff\"></cm-nav-item>\n <cm-nav-item label=\"Configuration\" href=\"#configuration\"></cm-nav-item>\n </cm-nav-item>\n </cm-nav-item>\n</cm-mobile-menu>\n</div>"}],"do":["Open it from \"More\" in the Bottom navigation and keep the Bottom navigation visible under it.","Group rows the way merchants think: channels, panels, support, subscription, settings.","Put what the Header bar hides on phones (store, account, Hire an Expert, subscription) in here."],"dont":["Don't use it inside an app.","Don't nest deeper than one sub-screen.","Don't put more than one action per section."],"content":["Section headings are one word: \"Channels\", \"Support\".","Badges are two or three words: \"3 apps active\", \"New\"."],"accessibility":["A `nav` landmark named \"Menu\"; each section is a region named by its heading, and rows are links or buttons.","Opening a row with sub-items shows a second screen and moves focus to its back button (named after the section); Back or Escape returns focus to the row.","Icons are decorative; the avatar letter is hidden and the row is named by the user's name.","Icons are line icons in `icon-responsive-menu` grey; badges use `nav-badge` blue with white 12px text (AA)."],"related":["app-frame","bottom-navigation","side-navigation","header-bar"]},{"tag":"cm-flash-offer-bar","slug":"flash-offer-bar","name":"Flash offer bar","react":"FlashOfferBar","group":"Navigation","summary":"A dark strip across the top of the page with one short offer and a green link.","lead":"A 48px `bg-flash-bar` strip with a green send icon and one centred 14px line of white text. The link inside it is green and medium weight. On phones the text starts at the left.","docs_url":"https://commmerce.com/commmerceui/#components--flash-offer-bar","properties":[{"attribute":"icon","property":"icon","type":"string","default":"'send'","description":"Leading icon from"},{"attribute":"dismissible","property":"dismissible","type":"boolean","default":"false","description":"Shows a close button."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the bar's region. Default: the built-in string `label` (\"Offer\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"(default)","description":"The message. Put one `<a>` inside it for the action."},{"name":"icon","description":"Replaces the leading icon."}],"events":[{"name":"cm-dismiss","description":"When the close button is pressed (with `dismissible`). The bar hides itself unless the event is cancelled."}],"parts":[],"examples":[{"title":"Plan offer","html":"<cm-flash-offer-bar>\n Publish your store with a Commmerce plan - <a href=\"#plans\">Click here</a> to pick a plan\n</cm-flash-offer-bar>"},{"title":"Dismissible","description":"The bar hides itself on close; remember the choice so it doesn't come back on every page.","html":"<cm-flash-offer-bar dismissible icon=\"percent\">\n Festive sale: 20% off annual plans until 30 November. <a href=\"#plans\">See plans</a>\n</cm-flash-offer-bar>"}],"do":["Use it for one time-limited offer or a setup step that blocks selling (publishing the store).","Keep it to one line on desktop.","Let merchants dismiss offers that are not required."],"dont":["Don't use it for errors or warnings: use a Banner.","Don't stack two bars.","Don't put more than one link in it."],"content":["Lead with the benefit, then the action: \"Publish your store with a Commmerce plan - Click here to pick a plan\".","The link text says what happens: \"See plans\", not just \"Click here\", where you can."],"accessibility":["A region named \"Offer\" (set `label` to change it), so screen-reader users can find or skip it.","The link is a normal link inside the text; the green (`text-speciality-on-dark`) is 6.3:1 on the bar.","The close button is named \"Dismiss offer\".","The icon is the line `send` icon; the bar fills its container."],"responsive":["When the window is 640px wide or less, the text starts at the left instead of the centre, and the bar is at least 44px tall."],"related":["banner","header-bar"]},{"tag":"cm-link-tabs","slug":"link-tabs","name":"Link tabs","react":"LinkTabs","group":"Navigation","summary":"Links between sibling pages, such as the sections of Settings.","lead":"A row of 14px medium links over a thin rule, 24px apart. The page you are on is black with a underline (black, or Commmerce blue in the refined look); the others are grey. Each tab is its own page with its own address, so it can be bookmarked and opened in a new tab. To filter one list in place, use Status tabs.","docs_url":"https://commmerce.com/commmerceui/#components--link-tabs","properties":[{"attribute":"items","property":"items","type":"NavItem[]","default":"[]","description":"Tabs as data (`{ label, href, current }`). Used instead of `cm-nav-item` children when set."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the navigation, e.g. \"Settings sections\". Default: the built-in string `label` (\"Sections\")."},{"attribute":"_slotted","property":"_slotted","type":"NavItem[]","default":"[]"},{"attribute":"_more","property":"_more","type":"string","default":"''"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"tabs","type":"NavItem[]","description":"The tabs in use."}],"methods":[],"slots":[{"name":"(default)","description":"`cm-nav-item` elements with `href`; mark the page you are on `current`."}],"events":[{"name":"cm-navigate","description":"When a tab is chosen. `detail: { item, value, href }`. Cancelable: call `preventDefault()` to route in your app."}],"parts":[],"examples":[{"title":"Settings sections","html":"<cm-link-tabs label=\"Settings sections\">\n <cm-nav-item label=\"General\" href=\"#general\" current></cm-nav-item>\n <cm-nav-item label=\"Payments\" href=\"#payments\"></cm-nav-item>\n <cm-nav-item label=\"Shipping\" href=\"#shipping\"></cm-nav-item>\n <cm-nav-item label=\"Tax\" href=\"#tax\"></cm-nav-item>\n <cm-nav-item label=\"Domains\" href=\"#domains\"></cm-nav-item>\n <cm-nav-item label=\"Notifications\" href=\"#notifications\"></cm-nav-item>\n</cm-link-tabs>"},{"title":"Parts of a product, with counts","html":"<cm-link-tabs label=\"Product sections\">\n <cm-nav-item label=\"Details\" href=\"#details\"></cm-nav-item>\n <cm-nav-item label=\"Variants\" href=\"#variants\" badge=\"12\" current></cm-nav-item>\n <cm-nav-item label=\"Inventory\" href=\"#inventory\"></cm-nav-item>\n <cm-nav-item label=\"Reviews\" href=\"#reviews\" badge=\"233\"></cm-nav-item>\n</cm-link-tabs>"}],"do":["Put it under the Page header, above the page content.","Give each tab its own URL and mark the page you are on `current`.","Name it with `label` (\"Settings sections\")."],"dont":["Don't use it to filter a list: use Status tabs.","Don't use it for steps in a sequence.","Don't use more than about seven tabs."],"content":["One or two words per tab, in sentence case.","Counts (`badge`) are whole numbers."],"accessibility":["A `nav` landmark of links, not ARIA tabs: each tab loads a page, so links and `aria-current=\"page\"` are the right semantics. Tab moves between them.","The current page is marked with `aria-current`, not only colour and underline.","Link tabs share the Status tabs styling, with 14px labels."],"responsive":["Tabs stay on one line; when they don't fit the component's width, the row scrolls sideways.","When the window is 640px wide or less, tabs are 16px apart instead of 24px."],"related":["status-tabs","page-header","side-navigation"]},{"tag":"cm-app-card","slug":"app-card","name":"App card","react":"AppCard","group":"Marketplace","summary":"One app in the Commmerce app marketplace: logo, name, rating, pricing, offer and actions.","lead":"A white card with a `border-subtle` edge and 8px corners. A 128×56 logo tile leads, then the 16px semibold app name, \"By\" and the developer, a gold star with the rating and an underlined reviews link, the pricing line, an optional offer on a pale blue line, and the actions: Sign Up (primary), Contact (secondary) and an underlined View Details link. In narrow columns the padding and logo tile shrink.","docs_url":"https://commmerce.com/commmerceui/#components--app-card","properties":[{"attribute":"name","property":"name","type":"string","default":"''","description":"App name, the card's heading."},{"attribute":"developer","property":"developer","type":"string","default":"''","description":"Who made the app, shown as \"By …\"."},{"attribute":"rating","property":"rating","type":"number | undefined","description":"Average rating out of 5. Leave unset for apps without reviews."},{"attribute":"reviews","property":"reviews","type":"number | undefined","description":"Number of reviews."},{"attribute":"reviews-href","property":"reviewsHref","type":"string","default":"''","description":"Link for the reviews count."},{"attribute":"pricing","property":"pricing","type":"string","default":"''","description":"Pricing summary: \"Free plan available. 7-day free trial.\""},{"attribute":"offer","property":"offer","type":"string","default":"''","description":"Optional offer, shown on a pale blue line with a percent icon."},{"attribute":"href","property":"href","type":"string","default":"''","description":"App details page. Shows a \"View Details\" link."},{"attribute":"heading-level","property":"headingLevel","type":"number","default":"3","description":"Heading level of the app name (2–6), to fit the page outline."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[],"slots":[{"name":"logo","description":"The app's logo, an `<img>` with `alt` set to the app name. Shown in a 130×54 tile."},{"name":"actions","description":"Buttons, e.g. `<cm-button variant=\"primary\">Sign Up</cm-button>` and `<cm-button>Contact</cm-button>`."},{"name":"status","description":"Top-right corner, e.g. a `cm-toggle` that turns an installed app on and off."}],"events":[],"parts":[],"examples":[{"title":"Marketplace grid","html":"<div style=\"display:grid;gap:var(--cm-space-24);grid-template-columns:repeat(auto-fill,minmax(300px,1fr))\">\n <cm-app-card name=\"Paywise Payments\" developer=\"Appsell\" rating=\"4.3\" reviews=\"902\" reviews-href=\"#reviews\"\n pricing=\"Free plan available. 7-day free trial.\" offer=\"Bundle products and kits with Bundle Manager: 20% off\" href=\"#paywise\">\n <cm-icon slot=\"logo\" name=\"wallet\" size=\"32\" label=\"Paywise Payments\"></cm-icon>\n <cm-button slot=\"actions\" variant=\"primary\">Sign Up</cm-button>\n <cm-button slot=\"actions\">Contact</cm-button>\n </cm-app-card>\n <cm-app-card name=\"ShipQuick\" developer=\"Lumen Labs\" rating=\"4.1\" reviews=\"318\" reviews-href=\"#reviews\"\n pricing=\"From ₹ 499 a month.\" href=\"#shipquick\">\n <cm-icon slot=\"logo\" name=\"send\" size=\"32\" label=\"ShipQuick\"></cm-icon>\n <cm-button slot=\"actions\" variant=\"primary\">Sign Up</cm-button>\n <cm-button slot=\"actions\">Contact</cm-button>\n </cm-app-card>\n</div>"},{"title":"Installed, with an on/off switch","description":"The `status` slot sits in the top-right corner.","html":"<div style=\"max-width:410px\">\n<cm-app-card name=\"Paywise Payments\" developer=\"Appsell\" rating=\"4.3\" reviews=\"902\" pricing=\"Free plan available. 7-day free trial.\" href=\"#paywise\">\n <cm-icon slot=\"logo\" name=\"wallet\" size=\"32\" label=\"Paywise Payments\"></cm-icon>\n <cm-toggle slot=\"status\" checked aria-label=\"Paywise Payments on\"></cm-toggle>\n <cm-button slot=\"actions\">Settings</cm-button>\n</cm-app-card>\n</div>"}],"do":["Show cards in a grid of equal columns (about 300–410px each); they stretch to the same height.","Use the app's real logo image with `alt` set to the app name.","Set `heading-level` to fit the page: 2 under the page title, 3 under a section heading."],"dont":["Don't tint the logo tile with the app's brand colour: the admin uses Commmerce's palette only.","Don't put more than two buttons in `actions`.","Don't round ratings to whole stars; show one decimal."],"content":["Pricing is one sentence: \"Free plan available. 7-day free trial.\"","Offers are short and specific: what, how much, until when.","Keep the standard button words: \"Sign Up\", \"Contact\", \"View Details\"."],"accessibility":["An `article` named by the app name, which is a heading (level 3 by default).","The rating is read as \"Rated 4.3 out of 5\"; the star is decorative. The reviews count is a link when `reviews-href` is set.","View Details is named \"View details of <app>\", so a page of cards doesn't have ten identical links.","The logo tile is neutral `bg-inset`, not a brand tint (owner decision: Commmerce palette only); the offer text is 12px; the star and discount icons are the `star` and `percent` line icons; cards fill their grid column."],"responsive":["Follows the card's own width, not the window: at 380px or narrower, the padding drops from 20px to 8px, the logo box shrinks from 128 × 56px to 100 × 40px, and the details link moves to the end of the actions row."],"related":["card","button","toggle"]},{"tag":"cm-modal","slug":"modal","name":"Modal","react":"Modal","group":"Overlays","summary":"A dialog over the page for a short task or a decision that has to be made before going on.","lead":"A white panel with 12px corners over a dimmed page: a black header with the 14px title and a close button, the content with 20px padding, and the actions in a footer, right-aligned. Three widths: `small` (400px) for confirmations, `medium` (620px) and `large` (900px) for lists. It is a native modal `<dialog>`: the page behind is inert, Esc and the backdrop ask to close, the page stops scrolling, and focus returns to the button that opened it. Open it with `show()` or the `open` attribute.","docs_url":"https://commmerce.com/commmerceui/#components--modal","properties":[{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"Width: `small` (400px, confirmations), `medium` (620px, default) or `large` (900px, lists and tables). Never wider than the screen."},{"attribute":"_hasFooter","property":"_hasFooter","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"The content."},{"name":"footer","description":"Actions, right-aligned: the main action last. Usually `cm-button`s."}],"events":[{"name":"cm-open","description":"After the modal opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable: call `preventDefault()` to keep it open (e.g. unsaved changes)."},{"name":"cm-closed","description":"After it has closed and focus has gone back."}],"parts":[],"examples":[{"title":"Confirm before deleting","description":"Press the button to open it. In your app, call `show()` or set `open`.","html":"<cm-button data-opens=\"del\">Delete product</cm-button>\n<cm-modal id=\"del\" heading=\"Delete “Linen shirt”?\" size=\"small\">\n <p style=\"margin:0\">The product and its 4 variants will be deleted. This can't be undone.</p>\n <cm-button slot=\"footer\">Cancel</cm-button>\n <cm-button slot=\"footer\" variant=\"primary\">Delete product</cm-button>\n</cm-modal>"},{"title":"A short form","description":"Put `autofocus` on the field the merchant will fill first.","html":"<cm-button data-opens=\"track\">Change tracking info</cm-button>\n<cm-modal id=\"track\" heading=\"Change tracking info\">\n <div style=\"display:grid;gap:var(--cm-space-16)\">\n <cm-text-field label=\"Tracking number\" autofocus></cm-text-field>\n <cm-select label=\"Carrier\"><option>Delhivery</option><option>Blue Dart</option><option>Other</option></cm-select>\n </div>\n <cm-button slot=\"footer\">Cancel</cm-button>\n <cm-button slot=\"footer\" variant=\"primary\">Save</cm-button>\n</cm-modal>"}],"do":["Use it for one short task the merchant must finish or cancel before going on.","Name the main action with a verb that says what happens: \"Delete product\", not \"OK\".","Cancel `cm-close` when closing would lose typed changes, and ask first.","Close it yourself (`close()`) after the main action succeeds."],"dont":["Don't open a modal from a modal.","Don't use it for long forms or pages of content: use a page or a Side panel.","Don't use it for messages that don't need an answer: use a Banner."],"content":["The title is a question or a task: \"Delete “Linen shirt”?\", \"Change tracking info\".","Say what will happen and whether it can be undone, in one or two sentences.","Put the main action last; Cancel first."],"accessibility":["A native modal `<dialog>` named by its heading; the rest of the page is inert, so Tab stays inside (it can still reach the browser's own controls, as with every native dialog).","Opening focuses the child with `autofocus`, otherwise the panel itself so its title is read. Closing returns focus to the element that opened it.","Esc, the close button (\"Close\", `close-label`) and a click on the backdrop fire a cancelable `cm-close` with `detail.reason`.","Page scrolling is locked while it is open.","Corners are 12px (`radius-lg`), with a large shadow (`shadow-lg`); widths are three fixed sizes."],"responsive":["Never wider than the window minus 32px (`small` 400px, `medium` 620px, `large` 900px otherwise)."],"related":["side-panel","banner","button"]},{"tag":"cm-side-panel","slug":"side-panel","name":"Side panel","react":"SidePanel","group":"Overlays","summary":"A panel over the right edge of the page with the details of one item, without leaving the list.","lead":"A full-height white panel on the right (450px; `small` 380px, `large` 720px) over a dimmed page: a black header with the 14px title and a close button, the content with 20px padding, and an optional footer. On phones it becomes a card inset 16px from the screen edges. Like Modal it is a native modal `<dialog>`: Esc and the backdrop ask to close, the page stops scrolling, and focus returns to the opener.","docs_url":"https://commmerce.com/commmerceui/#components--side-panel","properties":[{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"Width on larger screens: `small` (380px), `medium` (450px, default) or `large` (720px)."},{"attribute":"_hasFooter","property":"_hasFooter","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"The content."},{"name":"footer","description":"Actions at the bottom, right-aligned."}],"events":[{"name":"cm-open","description":"After the panel opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed and focus has gone back."}],"parts":[],"examples":[{"title":"Enquiry details","description":"Press the button to open it. In your app, call `show()` or set `open`.","html":"<cm-button data-opens=\"inq\">View enquiry</cm-button>\n<cm-side-panel id=\"inq\" heading=\"Inquiry\">\n <cm-info-panel>\n <cm-info-item label=\"Date added\">Mar 29, 2026 3:45 AM</cm-info-item>\n <cm-info-item label=\"Name\">Robinson Painatillo</cm-info-item>\n <cm-info-item label=\"Email\"><a href=\"mailto:robinson@example.com\">robinson@example.com</a></cm-info-item>\n <cm-info-item label=\"Message\">Do you ship to Pune? I'd like 20 shirts for a team event.</cm-info-item>\n </cm-info-panel>\n <cm-accordion heading=\"Email and phone were found in 2 orders\" style=\"margin-top:var(--cm-space-20)\">\n <p style=\"margin:0\"><a href=\"#order\">#NAY0D0736</a>, 20-12-2025</p>\n </cm-accordion>\n <cm-button slot=\"footer\" variant=\"primary\">Reply</cm-button>\n</cm-side-panel>"}],"do":["Use it to look at or lightly edit one item from a list, keeping the list in place behind.","Keep the title to what the item is: \"Inquiry\", \"Order #1042\"."],"dont":["Don't use it for a task that needs the whole page: open the item's page instead.","Don't stack a Modal on top of it."],"content":["Show the most useful facts first; group the rest in Accordions."],"accessibility":["A native modal `<dialog>` named by its heading; the page behind is inert.","Opening focuses an `autofocus` child, otherwise the panel. Esc, the close button and the backdrop fire a cancelable `cm-close`; focus returns to the opener.","Square corners on desktop, with three widths; on phones a card inset 16px with 12px corners."],"responsive":["Never wider than the window (`small` 380px, `medium` 450px, `large` 720px otherwise).","When the window is narrower than 600px, the panel becomes a card inset 16px from every edge of the screen."],"related":["modal","filter-panel","info-panel","accordion"]},{"tag":"cm-filter-panel","slug":"filter-panel","name":"Filter panel","react":"FilterPanel","group":"Overlays","summary":"\"Search and Filter\": a Side panel with a search field, the fields that narrow a list, and Reset and Search.","lead":"A Side panel titled \"Search and Filter\". With `search` it starts with a search field (\"Search anything\"); then your fields in a `<form>`, 12px apart; then Reset and Search, centred at the bottom. Search fires `cm-filter-apply` with the form's values and the query, then closes. Reset puts the form back to its first values. Open it from the filter button of a Search field (`cm-filter`).","docs_url":"https://commmerce.com/commmerceui/#components--filter-panel","properties":[{"attribute":"search","property":"search","type":"boolean","default":"false","description":"Shows a search field above the filters."},{"attribute":"query","property":"query","type":"string","default":"''","description":"Text in the search field."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Default: the built-in string `heading` (\"Search and Filter\")."},{"attribute":"search-label","property":"searchLabel","type":"string","description":"Accessible name of the search field. Default: the built-in string `searchLabel` (\"Search\")."},{"attribute":"search-placeholder","property":"searchPlaceholder","type":"string","description":"Placeholder of the search field. Default: the built-in string `searchPlaceholder` (\"Search anything\")."},{"attribute":"apply-label","property":"applyLabel","type":"string","description":"Text of the main button. Default: the built-in string `apply` (\"Search\")."},{"attribute":"reset-label","property":"resetLabel","type":"string","description":"Text of the reset button. Default: the built-in string `reset` (\"Reset\")."},{"attribute":"size","property":"size","type":"'small' | 'medium' | 'large'","default":"'medium'","description":"Width on larger screens: `small` (380px), `medium` (450px, default) or `large` (720px)."},{"attribute":"_hasFooter","property":"_hasFooter","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"form","type":"HTMLFormElement | null","description":"The `<form>` holding the fields: a direct child, or the first one inside the panel."},{"property":"values","type":"FilterValues","description":"The current filter values, keyed by field name. Empty values are left out."}],"methods":[{"name":"reset","description":"Puts every field back to its first value and clears the search."},{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"A `<form>` with the filter fields."},{"name":"footer","description":"Actions at the bottom, right-aligned."}],"events":[{"name":"cm-filter-apply","description":"When Search is pressed (or Enter in the search field). `detail: { values, query }`. Cancelable: call `preventDefault()` to keep the panel open (e.g. an invalid date range)."},{"name":"cm-filter-reset","description":"When Reset is pressed, after the fields went back to their first values."},{"name":"cm-open","description":"After the panel opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed."}],"parts":[],"examples":[{"title":"Filter products","description":"Press the filter button in the search field. In your app, listen for `cm-filter` and call `show()`.","html":"<cm-search label=\"Search products\" filter data-opens=\"filters\"></cm-search>\n<cm-filter-panel id=\"filters\" search>\n <form>\n <cm-text-field label=\"Product name\" name=\"name\"></cm-text-field>\n <cm-select label=\"Product status\" name=\"status\"><option value=\"\">Any</option><option value=\"active\">Active</option><option value=\"inactive\">Inactive</option></cm-select>\n <cm-select label=\"Product type\" name=\"type\"><option value=\"\">Any</option><option>Clothing</option><option>Accessories</option></cm-select>\n <div style=\"display:grid;grid-template-columns:1fr 1fr;gap:var(--cm-space-12)\">\n <cm-text-field label=\"From\" name=\"from\" type=\"date\"></cm-text-field>\n <cm-text-field label=\"To\" name=\"to\" type=\"date\"></cm-text-field>\n </div>\n <cm-text-field label=\"Tags\" name=\"tags\"></cm-text-field>\n </form>\n</cm-filter-panel>"}],"do":["Give every field a `name`: it becomes the key in `detail.values`.","Start every field empty or at \"Any\", so Reset means \"no filters\".","Show the number of active filters on the search field (`filter-count`)."],"dont":["Don't apply filters while the merchant is still choosing: apply on Search.","Don't put more than about eight fields here; offer the rarely used ones as a saved view instead."],"content":["Field labels name what is filtered: \"Product status\", not \"Choose status\".","Keep the button words \"Reset\" and \"Search\" unless the list is not searched."],"accessibility":["A Side panel: a native modal `<dialog>` named \"Search and Filter\", inert page behind, Esc closes, focus returns to the filter button.","Enter in the search field applies, like Search. Pressing Search with the form invalid can be stopped by cancelling `cm-filter-apply`.","Empty values are left out of `detail.values`; a name used by several checked boxes gives an array."],"responsive":["The same as Side panel: never wider than the window, and below 600px of window width it becomes a card inset 16px from every edge of the screen."],"related":["side-panel","search","select","resource-list"]},{"tag":"cm-account-menu","slug":"account-menu","name":"Account menu","react":"AccountMenu","group":"Navigation","summary":"The signed-in person's menu, last in a Commmerce product's header bar: who is signed in, the business they work in, then Settings, Lock screen and Log out.","lead":"Since 1.9.2. A round 36px avatar with a ring, always the last control in `cm-header-bar` (its `account` slot, after refresh and notifications). It opens a 320px panel aligned to its end edge: the person (40px avatar with a ring, name 16px, role and place 13px grey), a line, the business (40px round logo, name, kind) with its plan beside a green check, a line, then the `cm-menu-item` choices. With `profile-href` or `org-href` a row is a link with a chevron. Keyboard, outside click and Escape behave like the Action menu. For Commmerce products only, not for apps.","docs_url":"https://commmerce.com/commmerceui/#components--account-menu","properties":[{"attribute":"name","property":"name","type":"string","default":"''","description":"The signed-in person's name. Their initials show when there is no `avatar-src`."},{"attribute":"avatar-src","property":"avatarSrc","type":"string","default":"''","description":"Their photo."},{"attribute":"meta","property":"meta","type":"string","default":"''","description":"One line under the name: role and place (\"Owner · Bangalore\")."},{"attribute":"profile-href","property":"profileHref","type":"string","default":"''","description":"Their profile page; makes the row a link with a chevron."},{"attribute":"org-name","property":"orgName","type":"string","default":"''","description":"The business or store they're working in (\"Bangalore\"). Empty hides the business row."},{"attribute":"org-meta","property":"orgMeta","type":"string","default":"''","description":"One line under it (\"POS store\")."},{"attribute":"org-href","property":"orgHref","type":"string","default":"''","description":"The business's page or switcher; makes the row a link with a chevron."},{"attribute":"plan","property":"plan","type":"string","default":"''","description":"The plan, shown under the business with a check (\"POS Standard\")."},{"attribute":"items","property":"items","type":"MenuItem[]","default":"[]","description":"Choices as data, used instead of children when set: `[{ label: 'Add product', value: 'product' }, { divider: true }, …]`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the menu."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the menu. Also the trigger's name when it is icon-only. Default: the built-in string `label` (\"Actions\")."},{"attribute":"trigger-label","property":"triggerLabel","type":"string","default":"''","description":"Text of the built-in trigger. Empty uses `label`."},{"attribute":"icon-only","property":"iconOnly","type":"boolean","default":"false","description":"The built-in trigger is a \"more\" (⋮) icon button, e.g. for table rows."},{"attribute":"icon","property":"icon","type":"string","default":"'more'","description":"Icon of the icon-only trigger. Default `more` (⋮); `chevron-down` for a menu attached to another control."},{"attribute":"align","property":"align","type":"'start' | 'end'","default":"'start'","description":"Which trigger edge the menu lines up with: `start` (default) or `end` (for triggers at the right edge)."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Bold line above the choices, e.g. the merchant's name in the account menu."},{"attribute":"subheading","property":"subheading","type":"string","default":"''","description":"Smaller line under the heading, e.g. the email."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height: `comfortable` 36px rows (the default) or `compact` 32px rows for dense tables and toolbars. Since 1.6."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner row instead of the choices while you load them (the menu is `aria-busy`). Since 1.6."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"The built-in trigger can't be used (it is a disabled button); a slotted trigger is yours to disable. Since 1.6."},{"attribute":"_slotted","property":"_slotted","type":"MenuItem[]","default":"[]"},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_custom","property":"_custom","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"menuItems","type":"MenuItem[]","description":"The choices in use."}],"methods":[{"name":"show","description":"Opens the menu and highlights the first (or last) choice."},{"name":"hide","description":"Closes the menu. With `returnFocus`, focus goes back to the trigger."}],"slots":[{"name":"(default)","description":"`cm-menu-item` elements, with `<hr>` between groups (as in `cm-action-menu`)."},{"name":"org-logo","description":"The business's logo (an `<img>`, 40px round). Without it, a store icon on the brand tone is shown."},{"name":"trigger","description":"Your own trigger button (optional). The menu sets its ARIA state."}],"events":[{"name":"cm-select","description":"When a choice is picked (as on `cm-action-menu`)."},{"name":"cm-toggle","description":"When the menu opens or closes. `detail: { open }`."}],"parts":[{"tag":"cm-menu-item","react":"MenuItemElement","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the choice in `cm-select`. Defaults to the text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the choice a link."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Can't be chosen right now."},{"attribute":"critical","property":"critical","type":"boolean","default":"false","description":"A destructive choice, shown in the critical colour."},{"attribute":"heading","property":"heading","type":"boolean","default":"false","description":"Makes this a section heading (its text, 12px) instead of a choice. Since 1.6."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"Keyboard shortcut shown at the end of the row (\"Ctrl+E\"). Since 1.6."}],"script_properties":[],"methods":[{"name":"toItem","description":"The item as data."}],"slots":[],"events":[]}],"examples":[{"title":"In the header bar","description":"Refresh, notifications, then the person, left to right. Select the avatar to open the panel.","html":"<div style=\"min-height:420px\"><cm-header-bar>\n <cm-button slot=\"end\" icon-only icon=\"refresh\" label=\"Refresh\"></cm-button>\n <cm-button slot=\"end\" icon-only icon=\"bell\" label=\"Notifications\" count=\"4\"></cm-button>\n <cm-account-menu slot=\"account\" name=\"Asha Rao\" meta=\"Owner · Bangalore\" profile-href=\"#profile\"\n org-name=\"Bangalore\" org-meta=\"POS store\" org-href=\"#store\" plan=\"POS Standard\">\n <cm-menu-item icon=\"settings\" href=\"#settings\">Settings</cm-menu-item>\n <cm-menu-item value=\"lock\">Lock screen</cm-menu-item>\n <cm-menu-item icon=\"log-out\" value=\"log-out\">Log out</cm-menu-item>\n </cm-account-menu>\n</cm-header-bar></div>"}],"do":["Put it in the header bar's `account` slot so it is always last.","Show the business the person is working in, and its plan, so switching stores is one click away (`org-href`)."],"dont":["Don't use it in apps built by other developers: the account belongs to the Commmerce product.","Don't put more than about five choices in it; settings pages hold the rest."],"content":["Choices in sentence case: \"Lock screen\", \"Log out\".","The meta line is the role and the place: \"Owner · Bangalore\"."],"accessibility":["The avatar button is named \"Account: {name}\" and says it opens a menu; the panel is the Action menu's, with the arrow keys, Home, End, Escape and type-ahead.","The person and business rows are links when they have an href, reached with Tab."],"responsive":["The avatar is 36px (40px with a 44px hit area on touch screens). The panel is 320px wide, never wider than the window minus 32px."],"related":["header-bar","action-menu","avatar"]},{"tag":"cm-action-menu","slug":"action-menu","name":"Action menu","react":"ActionMenu","group":"Overlays","summary":"A button that opens a short list of actions: row actions, \"Add…\" menus, or the account menu.","lead":"A white list with 8px corners and a soft shadow (`shadow-md`), 4px under its trigger. Each choice is a 36px row (owner standard, 1.6; `density=\"compact\"` 32px, 44px on touch screens) with 12px side padding, 14px text, an optional 16px icon and an optional `shortcut` hint in 12px grey at the end; the highlighted one is black with white text, a destructive (`critical`) one red on light red. `<cm-menu-item heading>` starts a section with a 12px grey heading (since 1.6). The same rows as the options of Select and Combobox. `<hr>` between `cm-menu-item`s draws a line between groups, and `heading` / `subheading` put a name and email on top (the account menu). The built-in trigger is a button with the label and a chevron, or a ⋮ icon button with `icon-only`; or bring your own with `slot=\"trigger\"`.","docs_url":"https://commmerce.com/commmerceui/#components--action-menu","properties":[{"attribute":"items","property":"items","type":"MenuItem[]","default":"[]","description":"Choices as data, used instead of children when set: `[{ label: 'Add product', value: 'product' }, { divider: true }, …]`."},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the menu."},{"attribute":"label","property":"label","type":"string","description":"Accessible name of the menu. Also the trigger's name when it is icon-only. Default: the built-in string `label` (\"Actions\")."},{"attribute":"trigger-label","property":"triggerLabel","type":"string","default":"''","description":"Text of the built-in trigger. Empty uses `label`."},{"attribute":"icon-only","property":"iconOnly","type":"boolean","default":"false","description":"The built-in trigger is a \"more\" (⋮) icon button, e.g. for table rows."},{"attribute":"icon","property":"icon","type":"string","default":"'more'","description":"Icon of the icon-only trigger. Default `more` (⋮); `chevron-down` for a menu attached to another control."},{"attribute":"align","property":"align","type":"'start' | 'end'","default":"'start'","description":"Which trigger edge the menu lines up with: `start` (default) or `end` (for triggers at the right edge)."},{"attribute":"heading","property":"heading","type":"string","default":"''","description":"Bold line above the choices, e.g. the merchant's name in the account menu."},{"attribute":"subheading","property":"subheading","type":"string","default":"''","description":"Smaller line under the heading, e.g. the email."},{"attribute":"density","property":"density","type":"'comfortable' | 'compact' | undefined","description":"Row height: `comfortable` 36px rows (the default) or `compact` 32px rows for dense tables and toolbars. Since 1.6."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows a spinner row instead of the choices while you load them (the menu is `aria-busy`). Since 1.6."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"The built-in trigger can't be used (it is a disabled button); a slotted trigger is yours to disable. Since 1.6."},{"attribute":"_slotted","property":"_slotted","type":"MenuItem[]","default":"[]"},{"attribute":"_active","property":"_active","type":"number","default":"-1"},{"attribute":"_custom","property":"_custom","type":"boolean","default":"false"},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"menuItems","type":"MenuItem[]","description":"The choices in use."}],"methods":[{"name":"show","description":"Opens the menu and highlights the first (or last) choice."},{"name":"hide","description":"Closes the menu. With `returnFocus`, focus goes back to the trigger."}],"slots":[{"name":"(default)","description":"`cm-menu-item`s, with `<hr>` between groups."},{"name":"trigger","description":"Your own trigger button (optional). The menu sets its ARIA state."}],"events":[{"name":"cm-toggle","description":"When the menu opens or closes. `detail: { open }`."},{"name":"cm-select","description":"When a choice is made. `detail: { value, item }`. Cancelable: for link items, `preventDefault()` stops the navigation."}],"parts":[{"tag":"cm-menu-item","react":"MenuItemElement","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the choice in `cm-select`. Defaults to the text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the choice a link."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Can't be chosen right now."},{"attribute":"critical","property":"critical","type":"boolean","default":"false","description":"A destructive choice, shown in the critical colour."},{"attribute":"heading","property":"heading","type":"boolean","default":"false","description":"Makes this a section heading (its text, 12px) instead of a choice. Since 1.6."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"Keyboard shortcut shown at the end of the row (\"Ctrl+E\"). Since 1.6."}],"script_properties":[],"methods":[{"name":"toItem","description":"The item as data."}],"slots":[],"events":[]}],"examples":[{"title":"Row actions","html":"<div style=\"display:flex;align-items:center;justify-content:space-between;gap:12px;width:min(100%,440px);padding:8px 8px 8px 16px;background:var(--cm-bg-surface);border:1px solid var(--cm-border-subtle);border-radius:8px\">\n <span><strong>#1042</strong> · Priya Sharma · Rs. 2,340</span>\n <cm-action-menu icon-only label=\"Order #1042 actions\">\n <cm-menu-item value=\"cancel\">Cancel shipment</cm-menu-item>\n <cm-menu-item value=\"tracking\">Change tracking info</cm-menu-item>\n </cm-action-menu>\n</div>"},{"title":"Add menu","html":"<cm-action-menu trigger-label=\"Add\">\n <cm-menu-item icon=\"box\" value=\"product\">Add product</cm-menu-item>\n <cm-menu-item icon=\"menu\" value=\"category\">Add category</cm-menu-item>\n <cm-menu-item icon=\"users\" value=\"customer\">Add customer</cm-menu-item>\n <cm-menu-item icon=\"cart\" value=\"order\">Add order</cm-menu-item>\n</cm-action-menu>"},{"title":"Sections and shortcuts","description":"Since 1.6. `<cm-menu-item heading>` names the choices after it (up to the next heading or `<hr>`); `shortcut` shows a key hint at the end of the row and sets `aria-keyshortcuts`. Wire the shortcut itself in your app. The destructive choice is `critical`.","html":"<div style=\"min-height:300px\"><cm-action-menu trigger-label=\"Order\">\n <cm-menu-item heading>Order</cm-menu-item>\n <cm-menu-item icon=\"edit\" value=\"edit\" shortcut=\"E\">Edit order</cm-menu-item>\n <cm-menu-item icon=\"copy\" value=\"duplicate\" shortcut=\"Ctrl+D\">Duplicate</cm-menu-item>\n <cm-menu-item icon=\"download\" value=\"invoice\" disabled>Download invoice</cm-menu-item>\n <hr>\n <cm-menu-item heading>Danger zone</cm-menu-item>\n <cm-menu-item icon=\"trash\" value=\"delete\" critical shortcut=\"Del\">Delete order</cm-menu-item>\n</cm-action-menu></div>"},{"title":"Compact","description":"Since 1.6. `density=\"compact\"` makes the rows 32px, for menus in dense tables and toolbars. Rows stay 44px on touch screens.","html":"<div style=\"min-height:160px\"><cm-action-menu icon-only density=\"compact\" label=\"Product actions\">\n <cm-menu-item value=\"duplicate\">Duplicate</cm-menu-item>\n <cm-menu-item value=\"archive\">Archive</cm-menu-item>\n <cm-menu-item value=\"delete\" critical>Delete</cm-menu-item>\n</cm-action-menu></div>"},{"title":"Account menu","description":"Groups split by `<hr>`; the destructive choice is `critical`. `align=\"end\"` lines the menu up with the right edge of a trigger at the right of the page.","html":"<div style=\"display:flex;justify-content:flex-end\">\n<cm-action-menu trigger-label=\"Robinson\" heading=\"Robinson Jain\" subheading=\"robinson@example.com\" align=\"end\">\n <cm-menu-item href=\"#profile\">My profile</cm-menu-item>\n <cm-menu-item href=\"#subscription\">Subscription</cm-menu-item>\n <cm-menu-item href=\"#support\">Support</cm-menu-item>\n <cm-menu-item href=\"#refer\">Refer and earn</cm-menu-item>\n <hr>\n <cm-menu-item value=\"switch\">Switch store</cm-menu-item>\n <cm-menu-item value=\"new-store\">Create new store</cm-menu-item>\n <hr>\n <cm-menu-item value=\"sign-out\">Sign out</cm-menu-item>\n</cm-action-menu>\n</div>"}],"do":["Use it for actions, not for choosing a value in a form: that is Select.","Keep it to about eight choices, grouped with `<hr>`.","Give icon-only menus a `label` that names the thing acted on: \"Order #1042 actions\"."],"dont":["Don't hide the one main action of a page in a menu: show it as a Button.","Don't put a menu inside a menu."],"content":["Start each choice with a verb: \"Cancel shipment\", \"Add product\".","Use sentence case."],"accessibility":["The WAI-ARIA menu button pattern: the trigger has `aria-haspopup=\"menu\"` and `aria-expanded`; the list is `role=\"menu\"` with `menuitem`s and `separator`s.","↓/↑ on the trigger open the menu on the first/last choice. In the menu: ↓/↑ (wrapping), Home/End and typing the first letters move; Enter/Space choose; Esc closes and returns focus to the trigger; Tab closes. Disabled choices and section headings are skipped.","A section heading (`heading`) names a `role=\"group\"` of the choices after it (`aria-labelledby`); it is not a menu item. A `shortcut` is shown visually (hidden from screen readers) and exposed as `aria-keyshortcuts` on the item.","A custom trigger gets the ARIA attributes set on it, so make it a native `<button>`.","The highlight follows the keyboard and the pointer; the list has 4px inner padding and 8px corners, and rows 6px corners."],"responsive":["The menu is at most 320px wide, and never wider than the window minus 32px."],"related":["button","bottom-sheet","select"]},{"tag":"cm-bottom-sheet","slug":"bottom-sheet","name":"Bottom sheet","react":"BottomSheet","group":"Overlays","summary":"A sheet that rises from the bottom of a phone screen with a few actions or shortcuts.","lead":"White, with 12px top corners and a round 36px black close button on its top edge, over a dimmed page; at most 600px wide on larger screens. Rows are 44px, split by thin lines. Rows without icons are centred (actions, \"Mark as paid order\"); rows with icons line up left and end in a chevron (shortcuts, \"Orders\"). It is the phone version of Action menu and uses the same `cm-menu-item`s. A native modal `<dialog>`, like Modal.","docs_url":"https://commmerce.com/commmerceui/#components--bottom-sheet","properties":[{"attribute":"items","property":"items","type":"MenuItem[]","default":"[]","description":"Rows as data, used instead of `cm-menu-item` children when set."},{"attribute":"_slotted","property":"_slotted","type":"MenuItem[]","default":"[]"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Also the dialog's accessible name."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"sheetItems","type":"MenuItem[]","description":"The rows in use."}],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"`cm-menu-item`s, or your own content."}],"events":[{"name":"cm-select","description":"When a row is chosen. `detail: { value, item }`. Cancelable: `preventDefault()` keeps the sheet open (and stops a link)."},{"name":"cm-open","description":"After the sheet opens."},{"name":"cm-close","description":"Before it closes from Esc, the backdrop or the close button. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed."}],"parts":[{"tag":"cm-menu-item","react":"MenuItemElement","properties":[{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies the choice in `cm-select`. Defaults to the text."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon from"},{"attribute":"href","property":"href","type":"string","default":"''","description":"Makes the choice a link."},{"attribute":"disabled","property":"disabled","type":"boolean","default":"false","description":"Can't be chosen right now."},{"attribute":"critical","property":"critical","type":"boolean","default":"false","description":"A destructive choice, shown in the critical colour."},{"attribute":"heading","property":"heading","type":"boolean","default":"false","description":"Makes this a section heading (its text, 12px) instead of a choice. Since 1.6."},{"attribute":"shortcut","property":"shortcut","type":"string","default":"''","description":"Keyboard shortcut shown at the end of the row (\"Ctrl+E\"). Since 1.6."}],"script_properties":[],"methods":[{"name":"toItem","description":"The item as data."}],"slots":[],"events":[]}],"examples":[{"title":"Order actions","description":"Press the button to open it. In your app, call `show()` or set `open`.","html":"<cm-button data-opens=\"acts\">More actions</cm-button>\n<cm-bottom-sheet id=\"acts\" heading=\"Order actions\">\n <cm-menu-item value=\"paid\">Mark as paid order</cm-menu-item>\n <cm-menu-item value=\"invoice\">Generate invoice</cm-menu-item>\n <cm-menu-item value=\"cancel\" critical>Cancel order</cm-menu-item>\n</cm-bottom-sheet>"},{"title":"Shortcuts with icons","html":"<cm-button data-opens=\"quick\">Quick add</cm-button>\n<cm-bottom-sheet id=\"quick\" heading=\"Shortcuts\">\n <cm-menu-item icon=\"bag\" href=\"#orders\">Orders</cm-menu-item>\n <cm-menu-item icon=\"box\" href=\"#add-order\">Add orders</cm-menu-item>\n <cm-menu-item icon=\"cart\" href=\"#abandoned\">Abandoned cart</cm-menu-item>\n <cm-menu-item icon=\"help\" href=\"#enquiries\">Contact enquiries</cm-menu-item>\n</cm-bottom-sheet>"}],"do":["Use it on phones in place of an Action menu or a small Modal.","Keep it to five rows or fewer.","Set `heading` (it is not shown) so screen readers announce what the sheet is for."],"dont":["Don't mix rows with and without icons in one sheet.","Don't put a long form in a sheet: open a page."],"content":["Start actions with a verb: \"Generate invoice\". Shortcuts are the page name: \"Orders\"."],"accessibility":["A native modal `<dialog>` named by the hidden `heading` (or `label`); the page behind is inert.","The close button is named \"Close\" (`close-label`). Esc and the backdrop fire a cancelable `cm-close`; focus returns to the opener.","Choosing a row fires a cancelable `cm-select`, then closes with reason `action`.","The close button is 36px and rows are 44px tall, so both are easy touch targets."],"responsive":["Full width up to 600px, then 600px wide and centred at the bottom of the window."],"related":["action-menu","modal","bottom-navigation"]},{"tag":"cm-notification-panel","slug":"notification-panel","name":"Notification panel","react":"NotificationPanel","group":"Overlays","summary":"Recent notifications, opened from the bell in the header bar. For Commmerce products only, not for apps.","lead":"A 380px panel under the top-right corner of the page (on phones, the screen width less 8px each side) over a dimmed page. A black \"Notifications\" header with a close button, then one 40px row per notification, alternately white and light grey: a small coloured icon for its kind (`information`, `attention`, `success`, `critical`), what happened, and when. Unread ones are bold. \"See more notifications\" links to the full list. Move it with `--cm-notification-panel-top` and `--cm-notification-panel-end`. It belongs to the admin: apps can't add to it (App Bridge has toasts, not notifications).","docs_url":"https://commmerce.com/commmerceui/#components--notification-panel","properties":[{"attribute":"items","property":"items","type":"NotificationItem[]","default":"[]","description":"Notifications as data, used instead of children when set."},{"attribute":"more-href","property":"moreHref","type":"string","default":"''","description":"Link to all notifications. Empty hides it."},{"attribute":"heading","property":"heading","type":"string","description":"Title in the header. Default: the built-in string `heading` (\"Notifications\")."},{"attribute":"more-label","property":"moreLabel","type":"string","description":"Text of that link. Default: the built-in string `more` (\"See more notifications\")."},{"attribute":"empty-text","property":"emptyText","type":"string","description":"Shown when there are no notifications. Default: the built-in string `empty` (\"No notifications yet.\")."},{"attribute":"mark-all-read","property":"markAllRead","type":"boolean","default":"false","description":"Shows a \"Mark all read\" button in the header while at least one notification is unread. Pressing it fires `cm-mark-all-read`."},{"attribute":"mark-all-label","property":"markAllLabel","type":"string","description":"Text of that button. Default: the built-in string `markAllRead` (\"Mark all read\")."},{"attribute":"loading","property":"loading","type":"boolean","default":"false","description":"Shows placeholder rows while you fetch the notifications, and announces \"Loading\" politely."},{"attribute":"_slotted","property":"_slotted","type":"NotificationItem[]","default":"[]"},{"attribute":"_footer","property":"_footer","type":"boolean","default":"false"},{"attribute":"open","property":"open","type":"boolean","default":"false","description":"Shows the overlay. Set it, or call `show()` / `close()`."},{"attribute":"label","property":"label","type":"string","default":"''","description":"Accessible name when there is no visible heading."},{"attribute":"close-label","property":"closeLabel","type":"string","description":"Accessible name of the close button. Default: the built-in string `close` (\"Close\")."},{"attribute":"strings","property":"strings","type":"Record<string, Message> | null | undefined","description":"Replaces this component's built-in text (labels, accessible names, messages), key by key. In HTML pass JSON:\n`strings='{\"close\":\"Fermer\"}'`. Keys and English defaults are listed under \"Built-in text\" on the component's\npage; set text for every component at once with `configure()` or `setStrings()` (see Localisation)."}],"script_properties":[{"property":"notifications","type":"NotificationItem[]","description":"The notifications in use."}],"methods":[{"name":"show","description":"Opens the overlay."},{"name":"close","description":"Closes the overlay without asking (no `cm-close`)."},{"name":"requestClose","description":"Asks to close: fires a cancelable `cm-close` with `detail: { reason }` and closes unless it was cancelled.\nReturns true when the overlay closed."}],"slots":[{"name":"(default)","description":"`cm-notification-item`s."},{"name":"footer","description":"A control under the list, such as a toggle for push notifications on this device."}],"events":[{"name":"cm-select","description":"When a notification is chosen. `detail: { value, item }`. Cancelable: `preventDefault()` stops a link, to route in your app."},{"name":"cm-mark-all-read","description":"When \"Mark all read\" is pressed (`mark-all-read`). Clear `unread` on your notifications in response; the button hides when none are unread."},{"name":"cm-open","description":"After the panel opens."},{"name":"cm-close","description":"Before it closes. `detail: { reason }`. Cancelable."},{"name":"cm-closed","description":"After it has closed."}],"parts":[{"tag":"cm-notification-item","react":"NotificationItemElement","properties":[{"attribute":"time","property":"time","type":"string","default":"''","description":"When, as shown: \"1 min ago\"."},{"attribute":"tone","property":"tone","type":"Tone","default":"'information'","description":"`information` (default), `attention`, `success` or `critical`."},{"attribute":"href","property":"href","type":"string","default":"''","description":"Where the notification leads."},{"attribute":"unread","property":"unread","type":"boolean","default":"false","description":"Not read yet."},{"attribute":"value","property":"value","type":"string","default":"''","description":"Identifies it in `cm-select`."},{"attribute":"description","property":"description","type":"string","default":"''","description":"A second line under the label, in smaller grey text: \"Follow-up due at 4 pm\"."},{"attribute":"icon","property":"icon","type":"string","default":"''","description":"Icon name from `@commmerce/icons` for the kind (\"user\", \"clock\"), shown in the tone's colours instead of the tone's icon."}],"script_properties":[],"methods":[],"slots":[],"events":[]}],"examples":[{"title":"From the header bell","description":"Press the button to open it. In your app, open it from the header bar's bell.","html":"<cm-button data-opens=\"notes\">Notifications</cm-button>\n<cm-notification-panel id=\"notes\" more-href=\"#notifications\">\n <cm-notification-item time=\"1 min ago\" href=\"#order-1042\" unread>New order received</cm-notification-item>\n <cm-notification-item time=\"12 mins ago\" tone=\"attention\" href=\"#stock\" unread>Product low stock</cm-notification-item>\n <cm-notification-item time=\"1 hr ago\" tone=\"success\" href=\"#order-1041\">Payment received</cm-notification-item>\n <cm-notification-item time=\"3 hrs ago\" tone=\"attention\" href=\"#variants\">Product variant out of stock</cm-notification-item>\n <cm-notification-item time=\"1 day ago\" tone=\"critical\" href=\"#order-1037\">Order cancelled</cm-notification-item>\n</cm-notification-panel>"},{"title":"Mark all read, second lines, icons and a footer control","description":"`mark-all-read` shows \"Mark all read\" in the header while any notification is unread; it fires `cm-mark-all-read` and you clear `unread`. `description` adds a second line, `icon` picks an icon for the kind (in the tone's colours), and the `footer` slot holds a control such as a push-notifications toggle.","html":"<cm-button data-opens=\"notes-crm\">Notifications</cm-button>\n<cm-notification-panel id=\"notes-crm\" mark-all-read more-href=\"#notifications\">\n <cm-notification-item time=\"2 mins ago\" icon=\"clock\" tone=\"attention\" description=\"Follow-up due at 4 pm\" href=\"#task-81\" unread>Call Ravi Stores</cm-notification-item>\n <cm-notification-item time=\"20 mins ago\" icon=\"user\" description=\"From the website form\" href=\"#lead-311\" unread>New lead: Asha Textiles</cm-notification-item>\n <cm-notification-item time=\"1 hr ago\" icon=\"send\" tone=\"success\" description=\"Quote #Q-1043\" href=\"#email-17\">Email opened by Kiran Rao</cm-notification-item>\n <cm-notification-item time=\"3 hrs ago\" icon=\"help\" description=\"Ticket #5531\" href=\"#ticket-5531\">Customer replied</cm-notification-item>\n <cm-toggle slot=\"footer\" label=\"Push notifications on this device\"></cm-toggle>\n</cm-notification-panel>"}],"do":["Show the newest first, and at most about ten; link the rest with `more-href`.","Link every notification to the thing it is about.","Mark notifications read when the merchant opens them; offer `mark-all-read` and clear `unread` on `cm-mark-all-read`.","Set `loading` while the list is fetched instead of a fake \"Loading\" item.","Keep the second line short (`description`): who or when, \"Follow-up due at 4 pm\"."],"dont":["Don't use it for messages that need an answer now: show a Banner on the page.","Don't use it in apps: it is admin chrome."],"content":["Say what happened in a few words: \"New order received\", \"Product low stock\".","Times are relative and short: \"1 min ago\", \"3 hrs ago\", \"1 day ago\"."],"accessibility":["A native modal `<dialog>` named \"Notifications\"; the page behind is inert. Esc, the close button and the backdrop fire a cancelable `cm-close`; focus returns to the bell.","Unread notifications start with \"Unread:\" for screen readers, not only bold text. The kind icon is decorative; the words say what happened. A second line is read after the label, separated by a comma.","\"Mark all read\" is a real button in the header. When it disappears (nothing unread any more), focus moves to the panel instead of being lost.","While `loading`, the placeholder rows are hidden from screen readers and \"Loading\" is announced through a polite status region.","Choosing a notification fires a cancelable `cm-select` (cancel it to route in a single-page app), then closes.","Kind icons are line icons in the tone colours on 24px tiles; rows are at least 40px tall with 13px text and 12px times in tabular numbers."],"responsive":["At most 380px wide, and never wider than the window minus 32px.","When the window is narrower than 600px, the panel spans the screen with 8px on each side."],"related":["header-bar","banner","badge"]}]}