Tooltip Properties
This interface offers convenience functions to call a tooltip from withiin a component. It also provides a property to render the tooltip, that must be manually applied by an implementing component.
Example integration:
open class MyComponent : Component<Unit>, TooltipProperties by TooltipMixin() {
// ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
// implement interface delegate to mixin
override fun render(/* params omitted */) {
context.apply {
div {
this@MyComponent.renderTooltip.value.invoke(this) // render tooltip here
}
}
}
}Content copied to clipboard
Example usage:
myComponent() {
tooltip(text = "my Tooltip") { }
}
myComponent() {
tooltip({
color { danger.mainContrast }
background {
color { danger.main }
}
}) {
text("first line, second line")
placement { bottomEnd }
}
}
myComponent() {
tooltip("my tooltip") {}
}
myComponent() {
tooltip("my tooltip", "second line") { placement { bottom }}
}Content copied to clipboard
Functions
Link copied to clipboard
open fun tooltip(vararg text: String, build: TooltipComponent.() -> Unit)
Content copied to clipboard
Properties
Link copied to clipboard
abstract val renderTooltip: ComponentProperty<Tag<HTMLElement>.() -> Unit>
Content copied to clipboard
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
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard