Skip to content

Latest commit

 

History

History
77 lines (45 loc) · 1.06 KB

Halogen-Target.md

File metadata and controls

77 lines (45 loc) · 1.06 KB

Module Documentation

Module Halogen.HTML.Target

This module defines a type of link targets, which can be used as the target of a hyperlink or button.

This type is quite useful when defining reusable components.

URL

data URL

A type-safe wrapper for a URL

eqURL

instance eqURL :: Eq URL

semigroupURL

instance semigroupURL :: Semigroup URL

showURL

instance showURL :: Show URL

url

url :: String -> URL

Create a URL

runURL

runURL :: URL -> String

Unwrap a URL

Target

data Target a
  = LinkTarget URL
  | DataTarget a

There are two types of target:

  • LinkTarget creates a target which links to a URL.
  • DataTarget creates a target which carries data which may be used to generate inputs or requests.

target

target :: forall i. Target i -> [A.Attr i]

Attach a Target to an element using the href or onclick attribute as appropriate