ElementProperties

interface ElementProperties<T>

An interface for exposing an HTML element. Use this vor components that more or less wrap a single basic HTML tag like `inputField` or `pushButton`.

The offered element property enables the client to access the deeper features of an element even though the component itself does not offer an appropriate functionality. A client should use this with caution, as it might massively change the default behaviour of the component!

Example usage:

// apply interface to a component class
open class SomeComponent : ElementProperties<Div> by ElementMixin() {
^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^
implement the | mix in the default implementation
interface |
Expose the underlying element,
in this case a ``Div``!
}

// use the property offered by the interface
someComponent {
element {
// all properties of the ``Div`` element are accessible here
}
}

Advice: Try to offer all useful properties for a component in a redundant way if the component usage will benefit from a feature the underlying HTML element offers! This will make it much easier for the client user to use a component and much easier to read and maintain at client side code.

RFC: If the component itself offers some redundant property, the values from within the element property context should win and used for the rendering! This is the mandatory behaviour!

Properties

Link copied to clipboard
abstract val element: ComponentProperty<T.() -> Unit>

This property enables the client to access the deeper features of an element even though the component itself does not offer an appropriate functionality. A client should use this with caution, as it might massively change the default behaviour of the component!

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard