Skip to content
Log in

Labeled value styling reference

On this page

A labeled value is a label with a value under it on a POS screen, such as Order total above the amount. Some labeled values have no label, such as the notes under an item in the cart. A badge, loading dots, or an icon can appear before the value. You can change the color, size, and weight of labels and values, the icons and badges before a value, etc. Follow the POS styling API rules when you style labeled values.

Where a labeled value appears

Labeled values appear in these places:

  • The details on record screens, such as the total, reference, and customer on an order
  • The fields on a product screen
  • The totals at checkout and in the cart
  • The details of a fulfillment, a stock adjustment, and a stock request
  • The notes under an item in the cart or on an order, such as a status that needs attention or an order being prepared. These notes have no label.

Some notes have a color for their status, such as red for an alert. A color you set on labeled-value-root replaces the status color. Each note under an item is also named item-details-caption. To style the notes of one status, narrow item-details-caption by the status, as set out in the item details styling reference. To style the loading dots beside a status, see the loading dots styling reference.

Parts

Part What it is Available from
labeled-value-root The whole labeled value: the label above the value, or the value alone. v22.0.17
labeled-value-label The label above the value, when there is one. v22.0.17
labeled-value-value The value’s row: the text, with the badge, loading dots, icon, or tag beside it when there is one. The text takes the row’s type and color. v22.0.17
labeled-value-icon The icon before the value’s text, when there is one. v22.0.17
labeled-value-badge The badge before the value’s text, when there is one. It is a badge, so style it with the badge properties. v22.0.17

The Available from column shows the first release that carries the name.

Attributes

Narrow labeled-value-root by this, inside :where(), to style one size of labeled value.

Attribute Values Default Available from
data-size small, medium, large medium v22.0.17

Each size has a different type for the label and the value. A value with no label has smaller type than a value with a label. A type you set on labeled-value-label or labeled-value-value applies at every size, so narrow by data-size to change one size only.

Component properties

Set these on labeled-value-root or on :root. Both apply only to a labeled value with a copy button, which no screen shows yet.

Property What it sets Default Available from
--sc-labeled-value-max-width The widest a labeled value with a copy button grows, so the value truncates beside the button. 200px v22.0.17
--sc-labeled-value-copy-icon-fill The color of the copy button’s icon. rgb(var(–sc-color-layer-dark) / 60%) v22.0.17

Examples

Each example is tested against the POS on every change.

“Make the labels darker.”

```css

[part~=’labeled-value-label’] { opacity: 1; color: #334155; } ```

“Make the values bolder.”

```css

[part~=’labeled-value-value’] { font-weight: 700; } ```

“Make the large values bigger, and leave the rest.” Narrow by the size:

```css

font-size: 22px; line-height: 28px; } ```

“Color the icons and badges in the notes under an item.”

```css

[part~=’labeled-value-icon’] { color: #b42318; }

[part~=’labeled-value-badge’] { –sc-badge-bg: #b42318; –sc-badge-color: #ffffff; } ```

What can’t be styled yet

  • One labeled value on its own, such as an order’s total: only the notes under an item have a name, item-details-caption
  • One status color of the notes under an item, such as the alert notes, apart from the others, through labeled-value-root: narrow item-details-caption by the theme instead, on the item details styling reference
  • A value with no label, such as a note under an item, apart from one with a label: a rule on labeled-value-value reaches both
  • The value’s text apart from the row around it, such as the text color without the icon’s: the icon has its own part, but the text has none
  • The copy button and its tooltip, apart from the two properties above
  • What a screen puts in the value or beside it, such as a tag or the struck-through price on an item with a discount

Retired

None yet.

Was this article helpful?

Was this article helpful?