Skip to content
On this page
On this page

Use Link for navigating from one page to another. Link styles anchor tags with default blue styling and hover text-decoration.

Arguments

NameTypeDefaultDescription
tagString:aOne of :a and :span.
hrefStringnilURL to be used for the Link. Required if tag is :a. If the requirements are not met an error will be raised in non production environments. In production, an empty link element will be rendered.
schemeSymbol:defaultOne of :default, :primary, or :secondary.
mutedBooleanfalseUses light gray for Link color, and blue on hover.
underlineBooleantrueWhether or not to underline the link.
system_argumentsHashN/ASystem arguments

Examples

Default

<%= render(Primer::LinkComponent.new(href: "#")) { "Link" } %>

Muted

<%= render(Primer::LinkComponent.new(href: "#", muted: true)) { "Link" } %>

Schemes

<%= render(Primer::LinkComponent.new(href: "#", scheme: :primary)) { "Primary" } %>
<%= render(Primer::LinkComponent.new(href: "#", scheme: :secondary)) { "Secondary" } %>

Without underline

<%= render(Primer::LinkComponent.new(href: "#", underline: false)) { "Link" } %>
Span as a link
<%= render(Primer::LinkComponent.new(tag: :span)) { "Span as a link" } %>