Link
Inline-friendly styled anchor for prose, nav text, and table cells.
Usage
Mirrors Rails' link_to signature. For button-styled anchors,
use sui.link_to instead.
sui.link "Read more", "#"
Variants
Use variant: to control text color and hover behavior.
sui.link "Default", "#", variant: :default
sui.link "Underline", "#", variant: :underline
sui.link "Muted", "#", variant: :muted
sui.link "Foreground", "#", variant: :foreground
sui.link "Destructive", "#", variant: :destructive
Sizes
sui.link "Small", "#", size: :sm
sui.link "Default", "#", size: :default
sui.link "Large", "#", size: :lg
In prose
Embed inline within paragraphs — text inherits the surrounding color until hover.
Read the documentation or jump straight to examples.
sui.p do "Read the " + sui.link("documentation", "#") + " or jump straight to " + sui.link("examples", "#", variant: :underline) + "." end
vs. link_to
sui.link is for inline text styling.
sui.link_to (in the Button module) renders a button-styled anchor with
padding and border.
sui.link_to "Click me", "#", variant: :outline
API
| Arg | Type | Default | Description |
|---|---|---|---|
| name | String | nil | Link text (or use a block) |
| options | String / Hash | nil | Path or url_for-compatible options (same as Rails link_to) |
| variant | Symbol | :default | :default, :underline, :muted, :foreground, :destructive |
| size | Symbol | :default | :sm, :default, :lg |