Component DNA

How to choose between small, medium, and large component fit in the Maersk Design System.

MDS core components use a property called fit to control their sizing. Most components support three fit values: small, medium, and large. Fit determines a number of size-related properties including height, padding, border radius and typographic scale. Certain shared elements like icons may remain consistent across fits.


Example required

Components rendered with different fit values

When to use

Default: Use medium unless you have a specific reason not to.

Use small when:

  • The interface is data-dense (tables, dashboards, admin tools)
  • Screen real estate is constrained (small desktop viewports, side panels)
  • You need to provide a very compact layout or view

Use medium when:

  • Building general-purpose customer-facing experiences
  • No specific density or touch requirements apply
  • This is the default used on Maersk.com

Use large, x-large and xx-large when:

  • The layout is spacious and visually driven (marketing pages, landing pages)
  • The primary input method is touch (tablets, kiosks)
  • You need to meet larger touch-target accessibility requirements

Keep it consistent

Use one fit value consistently across a product or area. Mixing fits creates visual inconsistency and maintenance overhead.

If you must mix fits, document which fit applies where and why. Don’t leave it to individual judgment.

Why “fit” and not “size”?

We use fit to keep naming consistent across design and engineering.

  1. “size” conflicts with HTML. The native size attribute on <input> sets character width, not visual scale.
  2. “scale” is inaccurate. Components don’t simply scale up or down; internal proportions change.
  3. “density” is incomplete. Fit adjusts more than just spacing.

The analogy is clothing: a “tailored fit” and “loose fit” shirt differ in overall dimensions, but share parts like button size. Similarly, a small and large MDS component differ in height and padding, but share icon sizes and border radii.

Components

The following components support the fit property.

ComponentValues
mc-accordionsmall, medium, large
mc-accordion-itemsmall, medium, large
mc-avatarx-small, small, medium, large, x-large, xx-large
mc-badgesmall, medium
mc-buttonsmall, medium, large
mc-button-groupsmall, medium, large
mc-button-group-itemsmall, medium, large
mc-cardsmall, medium, large
mc-checkboxsmall, medium, large
mc-checkbox-groupsmall, medium, large
mc-code-previewsmall, medium
mc-date-rangesmall, medium, large
mc-dialogsmall, medium
mc-drawersmall, medium
mc-errorsmall, medium, large
mc-file-uploadsmall, medium, large
mc-hintsmall, medium, large
mc-inputsmall, medium, large
mc-input-datesmall, medium, large
mc-input-groupsmall, medium, large
mc-input-timesmall, medium, large
mc-labelsmall, medium, large
mc-link-buttonsmall, medium, large
mc-listsmall, medium, large
mc-list-itemsmall, medium, large
mc-loading-indicatorsmall, medium, large
mc-menusmall, medium, large
mc-modalsmall, medium
mc-multi-choice-fieldsetsmall, medium, large
mc-multi-selectsmall, medium, large
mc-notificationsmall, medium, large
mc-number-steppersmall, medium, large
mc-optionsmall, medium, large
mc-pickersmall, medium, large
mc-picker-itemsmall, medium, large
mc-popoversmall, medium, large
mc-progress-indicatorsmall, medium, large
mc-radiosmall, medium, large
mc-radio-groupsmall, medium, large
mc-segmented-controlsmall, medium, large
mc-segmented-control-itemsmall, medium, large
mc-selectsmall, medium, large
mc-select-nativesmall, medium, large
mc-split-buttonsmall, medium, large
mc-step-indicatorsmall, medium, large, x-large
mc-step-indicator-itemsmall, medium, large, x-large
mc-switchsmall, medium, large
mc-switch-groupsmall, medium, large
mc-tabsmall, medium, large
mc-tab-barsmall, medium, large
mc-tablesmall, medium, large
mc-tagsmall, medium, large
mc-text-and-iconsmall, medium, large
mc-textareasmall, medium, large
mc-theme-switchsmall, medium, large
mc-time-pickersmall, medium, large
mc-toastsmall, medium, large
mc-toolbarsmall, medium, large
mc-tooltipsmall, medium, large
mc-typeaheadsmall, medium, large
mc-typeahead-multi-selectsmall, medium, large