RelayUI

Links

RUI::Links is a namespace containing link variants. Links will often be used with href attributes to handle user interations.

Links are meant to navigate between different pages or sections, whereas buttons are meant to trigger actions within the current page.

Parameters

RUI::Links::[Variant].new(icon: nil, **attrs) { &block }

icon (string) optional
→ The tabler icon to be used for this link.

**attrs (hash) (optional)
→ Any additional attributes to be applied to the <a> HTML element.

&block (block) (optional)
→ The text content to be displayed inside the link.

Variants

Link variants are listed below.

render RUI::Links::Primary.new { "Primary Button" }
render RUI::Links::Primary.new(icon: 'star') { "Primary Button" }
render RUI::Links::Primary.new(icon: 'star')
render RUI::Links::Secondary.new { "Secondary Button" }
render RUI::Links::Secondary.new(icon: 'star') { "Secondary Button" }
render RUI::Links::Secondary.new(icon: 'star')
render RUI::Links::Outline.new { "Outline Button" }
render RUI::Links::Outline.new(icon: 'star') { "Outline Button" }
render RUI::Links::Outline.new(icon: 'star')
render RUI::Links::Destructive.new { "Destructive Button" }
render RUI::Links::Destructive.new(icon: 'star') { "Destructive Button" }
render RUI::Links::Destructive.new(icon: 'star')
render RUI::Links::Ghost.new { "Ghost Button" }
render RUI::Links::Ghost.new(icon: 'star') { "Ghost Button" }
render RUI::Links::Ghost.new(icon: 'star')

Additonal attributes

See the following example of passing href attributes to a link:

render RUI::Links::Primary.new(href: root_path) { "Go Home" }

This would result in the following HTML:

<a class="..." href="/">...</a>