Skip to content

Basic Syntax

Brandon Jordan edited this page Aug 29, 2022 · 13 revisions

Styling

To apply styles to a component, simply add the corresponding method using dot notation.

Component()
    .propertyMethod()

Arguments

Some components accept arguments, like Text(), Hyperlink(), Button(), etc. accept a text argument as a convenient shorthand to the text() method.

Hyperlink("Link Text")
    .URL("https://example.com")

Nesting components

The other type of argument is an array of components which means that that component can nest components inside itself.

Div([
    Text("Text")
])

Resulting HTML:

<div>
    <p>Text</p>
</div>
Clone this wiki locally