Componentsv2.189.1
Iconsv1.19.0
MCPv0.8.62
Tokensv0.34.3

Links are used to navigate to a new location, open or download an asset, or serve as an inline action.

Anatomy

  1. Container: Wraps the anchor and icon.
  2. Label: The Link's text. May be underlined to distinguish between itself and surrounding text.
  3. Icon (optional): Adds visual emphasis to the label's meaning. Can be leading or trailing.

Guidelines

As design trends have evolved over time, it's become more commonplace to style hyperlinks similarly to buttons. This is helpful for creating eye-catching calls-to-action but may encourage button misuse. It's important to know the fundamental difference between hyperlinks and buttons as they are not functionally interchangeable:

  • Hyperlinks, also known as links or anchors, use URLs to navigate to a new location, download a file, or link to an email address or phone number.
  • Buttons are primarily used to perform an action on the current page such as opening a modal or drawer or submitting a form.

When to use as buttons

With the correct component props, Pluma Links can be safely used as buttons as the underlying HTML will be updated. When using Links as actions, prefer to use them within inline text.

When linking to a URL outside of the application, mark it as external and use an appropriate trailing icon to denote it as such. External links open in a new tab with the correct safe HTML attributes already applied.

Best practices

Clickable regions

Wrap only the necessary text within a Link that gives the user the best context on where the Link goes or what action it performs.

Go to your language settings to make changes.
Do: Wrap the most meaningful text in a Link.
Don't: Wrap entire sentences or paragraphs in a Link.

Icon usage

Icons add visual context to a Link but should not replace the label. Use a leading icon when to clarify the destination and a trailing exit icon for external links.

Do: Use a trailing exit icon for external links.
Don't: Use icons that don't relate to the link's purpose.

Types

Regular

Standard Links navigate to a page, file, or external resource.

Button

Links can be rendered as button elements to trigger actions inline while maintaining link styling.

Appearance

Variants

Primary

Primary Links use text accent colors and are best suited for standalone links.

Secondary

Secondary Links are underlined by default to visually distinguish them from surrounding body text.

Icons

Icons add visual context to Links. Common icons are helpful for the user to understand the Link's purpose or destination, or if it may be external.

Custom icons

If a Pluma icon doesn't fit the context, a custom icon may be supplied. By default, custom icons are subject to the same rules as standard Pluma icons. They will render at the same default size and can be placed in the leading or trailing position.

Custom icon

Custom icons can fill a contextual gap that a standard Pluma icon may not.

Positioning and alignment

Icons can be placed in the leading position before the label or the trailing position after the label. Leading and trailing icons both have their vertical alignments set to a default value that can also be adjusted.

Leading icon

Leading icons are placed before the label to guide users on the link's destination. Their alignment is set to uppercase by default.

Trailing icon

Trailing icons are placed after the label to indicate it's external or that a workflow continues. Their alignment is set to lowercase by default.

Size

All icons default to small, but can be set to one of the following preset sizes:

  • fill
  • xxs
  • xs
  • sm
  • md
  • lg
  • xl
Icon sizes

Icons can be set to a variety of preset sizes.

Underline

Secondary Links are underlined by default to visually distinguish them from surrounding body text. If the underline is removed, the font weight updates to bold. Primary Links use color and font weight to differentiate from surrounding text and elements. If the underline is added, its font weight updates to match surrounding body text.

Underline

Secondary Links include an underline by default. An underline can be added to Primary Links when extra emphasis is needed.

No underline

Primary Links have no underline by default. The underline can be removed from Secondary Links when the Link is already visually distinct from surrounding text.

Behaviors

States

Base

Links use base styles in their resting state.

Loading

A spinner overlays the Link content to indicate a background process. The Link is considered disabled while loading.

Hover

On mouse hover, the text color updates to indicate interactivity.

Focus

Focused Links receive the standard 2px light blue outline.

Disabled

Disabled Links cannot be interacted with and use a muted text color.

Danger

The danger state applies critical color styling to communicate a destructive action or error condition.

Content

When interacting with a site or app, it's common for users to scan the page for links to supplemental information or new pages. When using Links, be sure to write labels that accurately describe where the Link goes or what action it will perform.

Do: Write descriptive labels that make sense in isolation.
Don't: Use generic labels that depend on surrounding context.
Do: Use sentence case for link text.

When using Links as inline Buttons, use a verb or short verb phrase that best describes the action taking place.

Do: Use specific action verbs or short verb phrases.
Don't: Use vague labels for action links.

When using Links in a sentence, make them a natural and descriptive part of the sentence structure. Avoid using ambiguous phrases like "click here" as they offer no context for users to understand their destination or action.

Go to your language settings to make changes.
Do: Embed descriptive link text naturally in the sentence.
Click here to change your language settings.
Don't: Use "click here" or generic phrases as link text.

Truncation

Links do not truncate within smaller containers and viewports by default but truncation can be enabled. Be sure to consider writing descriptive labels so truncated Links may still be understood when text is clipped.