primait / pyxis-components / Prima.Pyxis.Link

Configuration


type Config msg

Represent the configuration of a Link.

Configuration Methods

simple : String -> Config msg

Create a simple link. Used when the link itself is in a paragraph.

--

import Prima.Pyxis.Link as Link

...

myLink : Link.Config
myLink =
    Link.simple "Visit site" "https://www.prima.it"

standalone : String -> Config msg

Create a standalone link. Used when the link itself stands alone.

--

import Prima.Pyxis.Link as Link

...

myLink : Link.Config
myLink =
    Link.standalone "Visit site" "https://www.prima.it"

Rendering

render : Config msg -> Html msg

Renders a link by receiving it's configuration.

Options

withAttribute : Html.Attribute msg -> Config msg -> Config msg

Adds a generic attribute to the Link.

withId : String -> Config msg -> Config msg

Adds an id Html.Attribute to the Link.

withClass : String -> Config msg -> Config msg

Adds a class to the Link.

withClassList : List ( String, Basics.Bool ) -> Config msg -> Config msg

Adds classes to the classList of the Link.

withIcon : String -> Config msg -> Config msg

Creates a arrow-right icon.

withHref : String -> Config msg -> Config msg

Adds href attribute to the Link component

withTargetBlank : Config msg -> Config msg

Add a[target="_blank"] attr to the Config.

--

import Prima.Pyxis.Link as Link

...

myLink : Link.Config
myLink =
  "https://www.prima.it"
    |> Link.simple "Visit site"
    |> Link.withTargetBlank

withTargetParent : Config msg -> Config msg

Add a[target="_parent"] attr to the Config.

--

import Prima.Pyxis.Link as Link

...

myLink : Link.Config
myLink =
  "https://www.prima.it"
    |> Link.simple "Visit site"
    |> Link.withTargetParent

withTargetSelf : Config msg -> Config msg

Add a[target="_self"] attr to the Config.

--

import Prima.Pyxis.Link as Link

...

myLink : Link.Config
myLink =
  "https://www.prima.it"
    |> Link.simple "Visit site"
    |> Link.withTargetSelf

withTargetTop : Config msg -> Config msg

Add a[target="_top"] attr to the Config.

--

import Prima.Pyxis.Link as Link

...

myLink : Link.Config
myLink =
  "https://www.prima.it"
    |> Link.simple "Visit site"
    |> Link.withTargetTop

Event Options

withOnClick : msg -> Config msg -> Config msg

Adds an onClick Html.Event to the Link.

withOnMouseDown : msg -> Config msg -> Config msg

Adds an onMouseDown Html.Event to the Link.

withOnMouseUp : msg -> Config msg -> Config msg

Adds an onMouseUp Html.Event to the Link.

withOnMouseEnter : msg -> Config msg -> Config msg

Adds an onMouseEnter Html.Event to the Link.

withOnMouseLeave : msg -> Config msg -> Config msg

Adds an onMouseLeave Html.Event to the Link.

withOnMouseOver : msg -> Config msg -> Config msg

Adds an onMouseOver Html.Event to the Link.

withOnMouseOut : msg -> Config msg -> Config msg

Adds an onMouseOut Html.Event to the Link.