This module contains helpers for assembling text content that may include links and font style variations. It provides an alternative to Markdown syntax that is still fairly concise, while offering more control over text appearance via CSS modifier classes.
Construct text that will link to some URI. The boolean argument indicates whether the link should open in a new window.
"Click here to download"
|> Ui.Text.link ("http://example.com/files/myfile.pdf", True)
|> Ui.render
--> <a href="http://example.com/files/myfile.pdf" target="_blank">Click here to download</a><a>Construct text that will display as italic
"Time to make the donuts!"
|> Ui.Text.italic
|> Ui.render
--> <span class="is-italic">Time to make the donuts!</span><span>Construct text that will display with a bold font-weight
"Time to make the donuts!"
|> Ui.Text.bold
|> Ui.render
--> <span class="has-text-weight-bold">Time to make the donuts!</span><span>Construct text that will display with a semibold font-weight
"Time to make the donuts!"
|> Ui.Text.semibold
|> Ui.render
--> <span class="has-text-weight-semibold">Time to make the donuts!</span><span>Construct text that will display with a light font-weight
"Time to make the donuts!"
|> Ui.Text.light
|> Ui.render
--> <span class="has-text-weight-light">Time to make the donuts!</span><span>
Construct plain inline text
<span>