Skip to main content
Partas

Tags as Values

Passing Components as Values

A SolidTypeComponent or SolidComponent1 can be passed as a value by wrapping it in the TagValue object. They can then be rendered into a tag by calling render.

let Comp = TagValue(MyComponent)
Comp.render()

Operator Overloads

You can also use the !@ and % Operator overloads to perform the above actions.

let Comp = !@MyComponent
// a tagvalue can render the property set of an anonymous record
Comp % {| ``class`` = "class" |}
// a tagvalue can render the property set of any element
Comp % div(class' = "class")

Footnotes

  1. As of version 1.2.0

Last updated: 7/13/25, 1:51 PM

PartasBuilt using the Partas.SolidStart SolidBase template
Community
githubdiscord