Skyline_text_v2SourceSkyline Text v2 provides typography primitives for UI copy and headings.
It exposes:
viewmonospaceh1-h6inline_codeCommon use-cases:
monospace)h1-h6)Layout behavior
view/monospace APIs render inline elements (<span>) that size to their contents. Use these inline with other text or controls.h1–h6 APIs render block-level heading elements that fill the width of their container.Example
{%html|
<>
<Skyline_text_v1.h1> This is some content... </>
<Skyline_text_v1.view ~size:%{`Md}>The quick brown fox jumps over the lazy dog</>
<Skyline_text_v1.monospace ~size:%{`Inherit}>let foo = bar</>
</>
|}val view :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?size:Size.t ->
?weight:Weight.t ->
?color:Color.t ->
?layout:Layout.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.tview renders body text. It inherits whatever the current font-family is.
?size typography size on the Size scale (default `Inherit)?weight typography weight on the Weight scale (default `Inherit)?color text color (default `Inherit)?attrs additional attrs to apply to the underlying span (default )?test_selector test hook (default None)Returns a <span> node.
val monospace :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?size:Size.t ->
?weight:Weight.t ->
?color:Color.t ->
?layout:Layout.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.tmonospace renders body text with a monospace font family.
Use monospace when you just want the monospace font. Use inline_code when you want text to visually look like a code snippet (includes background color, padding, and border-radius).
Parameters are the same as view.
val link :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?size:Size.t ->
?weight:Weight.t ->
?color:Color.t ->
?show_external_link_icon:bool ->
Bonsai_web.Vdom.Node.t list ->
on_click:unit Bonsai_web.Effect.t ->
Bonsai_web.Vdom.Node.tlink renders inline text as a link (<a> tag).
It mirrors the view API and additionally supports semantic coloring via ~intent and arbitrary click actions via ~on_click, similar to Skyline_button_v2.view when used with the Link variant.
?attrs additional attrs to apply to the underlying anchor (default )?test_selector test hook (default None)?size typography size on the Size scale (default `Inherit)?weight typography weight on the Weight scale (default `Inherit)?color color for semantic meaning (default `Primary)?show_external_link_icon when true, shows an external-link icon for Effect.Open_url targets that open in a new tab/window (default true)on_click action to perform when clicked. When passed Effect.open_url, the element renders as an HTML <a href=... target=...> linkchildren content nodes to render inside the elementReturns an <a> node.
val h1 :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.th1 renders a level‑1 heading styled according to Skyline typography.
?attrs additional attrs (default )?test_selector test hook (default None)?color text color (default `Default)Returns an <h1> node.
val h2 :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.th2 renders a level‑2 heading. Returns an <h2> node.
val h3 :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.th3 renders a level‑3 heading. Returns an <h3> node.
val h4 :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.th4 renders a level‑4 heading. Returns an <h4> node.
val h5 :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.th5 renders a level‑5 heading. Returns an <h5> node.
val h6 :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.th6 renders a level‑6 heading. Returns an <h6> node.
val inline_code :
?test_selector:Bonsai_web.Test_selector.t ->
?attrs:Bonsai_web.Vdom.Attr.t list ->
?size:Size.t ->
?weight:Weight.t ->
?color:Color.t ->
Bonsai_web.Vdom.Node.t list ->
Bonsai_web.Vdom.Node.tinline_code renders an inline code element with typography styling.
Use inline_code when you want text to visually look like a code snippet — it includes a background color, padding, and border-radius in addition to the monospace font. Use monospace when you just want the monospace font without additional styling.
?test_selector test hook (default None)?attrs additional attrs (default )?size typography size on the Size scale (default `Inherit)?weight typography weight on the Weight scale (default `Inherit)?color text color (default `Inherit)Returns a <code> node.