PaackEng/paack-ui/3.1.1

NOTE: the latest version is 7.23.0

UI.Link

UI.Link is just a unified-type for both Element.link and `Element.newTabLink

For a pratical example see Link.wrapElement.

Building

Target

The LinkTarget is equivalent to HTML anchor's target.

Modify the link behaviour to open the URL in the same tab or a new one.

Link.link "https://www.googgle.com"
    |> Link.withTarget Link.targetNew

LinkTarget value for opening the link in a new tab.

Link.withTarget Link.targetNew someLink

LinkTarget value for opening the link in the same tab.

Link.withTarget Link.targetRedirect someLink

NOTE: This is the default behaviour.

Rendering

RenderConfig
-> List (Attribute msg)
-> Link
-> Element msg
-> Element msg

Link.wrapElement is similar to Element.el but including the anchor linking behaviour.

Link.wrapElement renderConfig [ Element.centerX, Element.centerY ] (Link.link "https://www.github.com") someOtherElement