ComponentProperty

class ComponentProperty<T>(value: T)

Generic container for modeling a property for a component class. Use it like this:

open class SomeComponent {
val myProp = ComponentProperty("some text")
val myBooleanProp = ComponentProperty(false)

// should rather be some implementation in the default theme of course!
class SizesContext {
small: Style<BasicParams> = { fontSize { small } }
normal: Style<BasicParams> = { fontSize { small } }
large: Style<BasicParams> = { fontSize { small } }
}

val sizes = ComponentProperty<SizesContext.() -> Style<BasicParams>> { normal }
}
// within your UI declaration:
someComponent {
myProp("Some specific content") // pass simple parameter
myBooleanProp(true)
sizes { large } // use expression syntax
}

Constructors

ComponentProperty
Link copied to clipboard
js
fun <T> ComponentProperty(value: T)

Functions

invoke
Link copied to clipboard
js
operator fun invoke(newValue: T)

Properties

value
Link copied to clipboard
js
var value: T