Documentation / API Reference / Element type
-
type Element
A record type which represents static HTML tags.
-
static member Create
- Signature:
static member Element.Create : string -> Component list -> Element
Creates an element with the given selector and children.
- Signature:
-
static member Wrap
- Signature:
static member Element.Wrap : Component list -> Element
Wraps the given child components. Useful for grouping
Componentinstances. - Signature:
-
Selectors are strings in tagName.x.y... form where x and y are CSS class names.
Note:
tagNamecan be omitted if there is at least one class name specified.
| Selector | Element |
|---|---|
| button | <button /> |
| button.primary.blue | <button class="primary blue" /> |
| .container | <div class="container" /> |
-
function Text
- Signature:
val Text : string -> Element
Creates a
<span />element, containing the given text. - Signature:
-
function (-<)
- Signature:
val (-<) : Element -> (string * 'T) list -> Element
Assigns un-typed properties to
Elementinstances. - Signature:
Element.create "button" [ Text "Button1" ] -< [
"myProperty", myPropertyValue
]