PopoverComponent

open class PopoverComponent : Component<Unit> , CloseButtonProperty

This class combines the configuration and rendering a popover that floats around a toggle element. The toggle can be any HTMLElement or a fritz2 component. The popover can be containing a header, a content and a footer. All "areas" are optional and it can contain a simple String, a Flow<String> or a RenderContext as well as a fritz2 component. The placement of the popover is configurable.

The popover has a default close-button, which you can hide or you can use your own custom close-button. The toggle element is marked by an arrow, but you can hide the arrow if you want.

Example usage:

popover {
toggle {
icon { fromTheme { arrowForward } }
}
placement { right }
header(flowOf("Our simple Popover"))
content {
div {
text("My Text in a HTMLTag")
}
}
footer("Footer content")
}

Constructors

PopoverComponent
Link copied to clipboard
js
fun PopoverComponent()

Types

Companion
Link copied to clipboard
js
object Companion

Functions

content
Link copied to clipboard
js
fun content(value: RenderContext.() -> Unit)
fun content(value: String)
fun content(value: Flow<String>)
footer
Link copied to clipboard
js
fun footer(value: RenderContext.() -> Unit)
fun footer(value: String)
fun footer(value: Flow<String>)
header
Link copied to clipboard
js
fun header(value: RenderContext.() -> Unit)
fun header(value: String)
fun header(value: Flow<String>)
placement
Link copied to clipboard
js
fun placement(value: PopoverPlacements.() -> Style<BasicParams>)
render
Link copied to clipboard
js
open override fun render(context: RenderContext, styling: BoxParams.() -> Unit, baseClass: StyleClass, id: String?, prefix: String)
Central method that should do the actual rendering of a component.

Properties

arrowPlacement
Link copied to clipboard
js
val arrowPlacement: ComponentProperty<PopoverArrowPlacements.() -> Style<BasicParams>>
closeButtonIcon
Link copied to clipboard
js
open override val closeButtonIcon: ComponentProperty<Icons.() -> IconDefinition>
closeButtonPrefix
Link copied to clipboard
js
open override val closeButtonPrefix: String
closeButtonRendering
Link copied to clipboard
js
open override val closeButtonRendering: ComponentProperty<RenderContext.() -> DomListener<MouseEvent, HTMLElement>>
closeButtonStyle
Link copied to clipboard
js
open override val closeButtonStyle: ComponentProperty<Style<BasicParams>>
closeOnBlur
Link copied to clipboard
js
val closeOnBlur: ComponentProperty<Boolean>
closeOnEscape
Link copied to clipboard
js
val closeOnEscape: ComponentProperty<Boolean>
hasArrow
Link copied to clipboard
js
val hasArrow: ComponentProperty<Boolean>
hasCloseButton
Link copied to clipboard
js
open override val hasCloseButton: ComponentProperty<Boolean>
size
Link copied to clipboard
js
val size: ComponentProperty<PopoverSizes.() -> Style<BasicParams>>
toggle
Link copied to clipboard
js
val toggle: ComponentProperty<RenderContext.() -> Unit?>