Skip to content

Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.

C
4.0 KB
Raw Blame

Labels

Source: https://developer.apple.com/design/human-interface-guidelines/labels Section: Components › Layout and organization Platforms covered: iOS, iPadOS, macOS (guidance specific to tvOS, visionOS, watchOS omitted) Last change on Apple's site: 2023-06-05 (Updated guidance to reflect changes in watchOS 10.)

A label is a static piece of text that people can read and often copy, but not edit.


Labels display text throughout the interface, in buttons, menu items, and views, helping people understand the current context and what they can do next.

The term label refers to uneditable text that can appear in various places. For example:

  • Within a button, a label generally conveys what the button does, such as Edit, Cancel, or Send.
  • Within many lists, a label can describe each item, often accompanied by a symbol or an image.
  • Within a view, a label might provide additional context by introducing a control or describing a common action or task that people can perform in the view.

Developer note: To display uneditable text, SwiftUI defines two components: Label and Text.

The guidance below can help you use a label to display text. In some cases, guidance for specific components — such as action buttons, menus, and lists and tables — includes additional recommendations for using text.

Best practices

Use a label to display a small amount of text that people don’t need to edit. If you need to let people edit a small amount of text, use a text field. If you need to display a large amount of text, and optionally let people edit it, use a text view.

Prefer system fonts. A label can display plain or styled text, and it supports Dynamic Type (where available) by default. If you adjust the style of a label or use custom fonts, make sure the text remains legible.

Use system-provided label colors to communicate relative importance. The system defines four label colors that vary in appearance to help you give text different levels of visual importance. For additional guidance, see Color.

System color Example usage iOS, iPadOS, tvOS, visionOS macOS
Label Primary information label labelColor
Secondary label A subheading or supplemental text secondaryLabel secondaryLabelColor
Tertiary label Text that describes an unavailable item or behavior tertiaryLabel tertiaryLabelColor
Quaternary label Watermark text quaternaryLabel quaternaryLabelColor

Make useful label text selectable. If a label contains useful information — like an error message, a location, or an IP address — consider letting people select and copy it for pasting elsewhere.

Platform considerations

No additional considerations for iOS, iPadOS, tvOS, or visionOS.

Desktop (macOS)

Developer note: To display uneditable text in a label, use the isEditable property of NSTextField.

Change log

Date Changes
June 5, 2023 Updated guidance to reflect changes in watchOS 10.

Related guidelines