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

tooltip
Link copied to clipboard
js
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-${Id.next()}", prefix: String = "tooltip", build: TooltipComponent.() -> Unit)

Properties

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

Inheritors

PushButtonComponent
Link copied to clipboard
CheckboxGroupComponent
Link copied to clipboard
CheckboxComponent
Link copied to clipboard
TooltipMixin
Link copied to clipboard
InputFieldComponent
Link copied to clipboard
MenuEntry
Link copied to clipboard
MenuLink
Link copied to clipboard
CustomMenuEntry
Link copied to clipboard
RadioGroupComponent
Link copied to clipboard
RadioComponent
Link copied to clipboard
SelectFieldComponent
Link copied to clipboard
SliderComponent
Link copied to clipboard
SwitchComponent
Link copied to clipboard
TextAreaComponent
Link copied to clipboard