Links are used to navigate to a new location, open or download an asset, or serve as an inline action.
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:
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.
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.
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.
Links can be rendered as button elements to trigger actions inline while maintaining link styling.
Secondary Links are underlined by default to visually distinguish them from surrounding body text.
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.
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.
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 icons are placed before the label to guide users on the link's destination. Their alignment is set to uppercase by default.
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.
All icons default to small, but can be set to one of the following preset sizes:
fillxxsxssmmdlgxlSecondary 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.
Secondary Links include an underline by default. An underline can be added to Primary Links when extra emphasis is needed.
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.
A spinner overlays the Link content to indicate a background process. The Link is considered disabled while loading.
The danger state applies critical color styling to communicate a destructive action or error condition.
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.
When using Links as inline Buttons, use a verb or short verb phrase that best describes the action taking place.
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.
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.