Skip to content

Field row ​

One metadata field on a detail page: its label above its value, editable in place.

metadata-metadatawrapper--defaultOpen in Storybook ↗

When to use ​

  • Every single-valued metadata field on a detail page or in a preview.
  • Relation fields (a single or multiple relation, or a table of relations) that are stored on the entity itself.

When not to use ​

  • A field with several values that belong together per entry, such as ISBN numbers with their edition: use a repeatable row group.
  • A form that creates a new entity: fields there are plain inputs, such as a text input or a dropdown.

Anatomy ​

  1. Label: --text-label, bold, in --color-text-field-label. The space under it is --field-label-gap, so the hover wash and the focus ring clear it.
  2. Label adornments (optional), in this order after the label:
    • a required * in --color-danger, or a ◦ when one of several fields is required;
    • a help icon ? with a tooltip, or one that opens an info panel;
    • a language picker for multilingual fields.
  3. Value: --text-value in --color-text-secondary. Every value row is at least --field-value-min-height high, so rows line up whatever the type.
  4. Editable cue: when the value can be edited in place, a dashed underline in --color-border-dashed sits under the text, and a pencil in --color-text-subtle follows the value. On hover a wash in --color-surface-editable-hover fills the value, --field-value-pad-x wider than the text on both sides.
  5. Copy button (optional): for fields configured to be copied, a small icon button after the value (--button-sm-padding-icon, --color-text-subtle, --color-accent-wash on hover).

Variants ​

Value typeWhat you see
Text, number, datethe value as text
URLa link in link ink with an external-link icon; it opens in a new tab
CheckboxYes with a check in --color-success, or No with a cross in the value colour
Coloura swatch followed by the hex value
Dropdown, relationthe chosen options as chips; a relation chip links to its entity
Imagethe image itself, small
Formatted textsanitised HTML
Copythe value with a copy button after it
metadata-metadatawrapper--value-typesOpen in Storybook ↗

Chip values and tables have no dashed underline: their shape already marks them. A value that is cut off after a set number of lines shows its full text in a tooltip.

States ​

StateWhat you seeTrigger
Editabledashed underline and pencilthe field can be edited in place
Hoverwash behind the valuepointer
Focusfocus ring around the valuekeyboard
Editingthe inline editor replaces the valueclick, Enter or Space
Saveda check in --color-success replaces the pencil for 2 seconds; the block header shows the same checkthe save worked
EmptyNo value at --opacity-empty, no underlineno value
Read-onlythe plain value: no underline, pencil or washthe field or the entity can't be edited by this user
Lockedthe plain value with a lock icon on the right; its tooltip says whythe field is locked on this entity
metadata-metadatawrapper--statesOpen in Storybook ↗
metadata-metadatawrapper--editingOpen in Storybook ↗

A value is editable in place only when all of these hold:

  • the field type has an inline editor: text, number, date, textarea, checkbox, colour, dropdown, or a relation stored on the entity;
  • the field is not read-only, locked or masked;
  • the user may update the entity;
  • the page is not in its page-wide edit mode. In that mode every row shows its form input instead.

Keyboard & accessibility ​

KeyOn an editable value
Tabmoves to the value
Enter / Spaceopens the inline editor
  • An editable value is role="button" and named {label}, edit.
  • A link, a relation chip or the copy button inside the value keeps its own click and keys. Enter and Space open the editor only when the value itself has focus.
  • The pencil and the saved check are decorative (aria-hidden). A successful save is announced as Saved through a role="status" region.
  • The one-of-required ◦ has an accessible name.
  • The copy button is a real <button> named Copy. After copying, its icon turns into a check and Copied shows next to it for 2 seconds, in a role="status" region. A copy that fails shows an error notification.

Content ​

  • Labels are nouns in sentence case, without a colon: Title, Inventory number.
  • Keep labels short; the value carries the detail.
  • Translation keys: metadata.labels.no-value, inline-edit.edit-field, copy-to-clipboard.copy and copy-to-clipboard.copied.

Inline editor · Repeatable row group · Text input · Tooltip · Chip & badge

Powered by Elody - Open Source Semantic Data Platform