ComponentProperty

class ComponentProperty<T>(var 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

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

Functions

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

Properties

Link copied to clipboard
var value: T