Component
Marker interface that every component should implement, so that the central render method appears in a unified way throughout this framework.
The render method has to be implemented in order to do the actual rendering of one component. This reduces the boilerplate code within the corresponding factory function(s):
open class MyComponent: Component {
override fun render(...) {
// some content rendering
}
}
RenderContext.myComponent(
// most params omitted
build: MyComponent.() -> Unit = {}
) {
MyComponent().apply(build).render(this, /* params */)
// ^^^^^^
// just start the rendering by one additional call!
}Often a component needs additional parameters that are passed into the factory functions (remember that those should be located starting after the `styling` parameter in first position and before the `baseClass` parameter) Typical use cases are Stores or list of items, as for RenderContext.checkboxGroup for example. Those additional parameters should be passed via constructor injection into the component class:
open class MyComponent(protected val items: List<String>, protected val store: Store<String>?): Component {
override fun render(...) {
// some content rendering with access to the ``items`` and the ``store``
}
}
RenderContext.myComponent(
styling: BasicParams.() -> Unit,
items: List<String>, // two additional parameters
value: Store<String>? = null, // after ``styling`` and before ``baseClass``!
baseClass: StyleClass,
id: String?,
prefix: String
build: MyComponent.() -> Unit = {}
) {
MyComponent(items, store) // inject additional parameters
.apply(build)
.render(this, styling, baseClass, id, prefix) // pass context + regular parameters
}Functions
Inheritors
DropdownComponent
Link copied to clipboard
NavbarComponent
Link copied to clipboard
PopoverComponent
Link copied to clipboard
AlertComponent
Link copied to clipboard
AppFrameComponent
Link copied to clipboard
PushButtonComponent
Link copied to clipboard
CardComponent
Link copied to clipboard
CheckboxGroupComponent
Link copied to clipboard
CheckboxComponent
Link copied to clipboard
DataTableComponent
Link copied to clipboard
SingleFileSelectionComponent
Link copied to clipboard
MultiFileSelectionComponent
Link copied to clipboard
FormControlComponent
Link copied to clipboard
FormGroupComponent
Link copied to clipboard
IconComponent
Link copied to clipboard
InputFieldComponent
Link copied to clipboard
MenuComponent
Link copied to clipboard
PaperComponent
Link copied to clipboard
RadioGroupComponent
Link copied to clipboard
RadioComponent
Link copied to clipboard
SelectFieldComponent
Link copied to clipboard
SliderComponent
Link copied to clipboard
SpinnerComponent
Link copied to clipboard
StackComponent
Link copied to clipboard
SwitchComponent
Link copied to clipboard
TextAreaComponent
Link copied to clipboard
TypeAheadComponent
Link copied to clipboard