lustre/prefab/link
Link component for lustre_prefab.
A hyperlink styled as a button.
Types
Link color style
pub type Style {
Primary
Secondary
Success
Danger
Warning
Info
}
Constructors
-
Primary -
Secondary -
Success -
Danger -
Warning -
Info
Values
pub fn new(label: String, path: String) -> Link(msg)
Create a new link styled as a button
Example
link.new("Home", "/")
|> link.with_style(link.Primary)
|> link.view([])
pub fn view(
link_element: Link(msg),
extra_attrs: List(@internal Attribute(@internal Aligned, msg)),
) -> stylish.Element(msg)
Render the link
Example
link.new("Go to Settings", "/settings")
|> link.with_style(link.Primary)
|> link.view([])
pub fn with_label_hidden(link_element: Link(msg)) -> Link(msg)
Hide the label of the link (useful with icons)
pub fn with_style(
link_element: Link(msg),
style: Style,
) -> Link(msg)
Modify the style of the link
pub fn with_variant(
link_element: Link(msg),
variant: Variant,
) -> Link(msg)
Modify the variant of the link