TooltipProperties

interface TooltipProperties

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
}
}
}
}

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 }}
}

Functions

Link copied to clipboard
open fun tooltip(vararg text: String, build: TooltipComponent.() -> Unit)
open fun tooltip(    styling: BasicParams.() -> Unit = {},     text: String? = null,     baseClass: StyleClass = StyleClass.None,     id: String = "fc2-tooltip-",     prefix: String = "tooltip",     build: TooltipComponent.() -> Unit)

Properties

Link copied to clipboard
abstract val renderTooltip: ComponentProperty<Tag<HTMLElement>.() -> Unit>

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