glaze/oat/tooltip

Oat documentation: https://oat.ink/components/tooltip/

Tooltip helpers for short helper text on interactive elements. Requires Oat’s JavaScript, which also turns plain title attributes into Oat tooltips.

Recipe

import glaze/oat/tooltip
import lustre/attribute
import lustre/element/html

html.button([
  attribute.type_("button"),
  tooltip.tooltip("Delete this item"),
  tooltip.bottom(),
], [html.text("Delete")])

References

Values

pub fn bottom() -> attribute.Attribute(msg)

Tooltips show above the element by default.

pub fn left() -> attribute.Attribute(msg)
pub fn right() -> attribute.Attribute(msg)
pub fn title(text: String) -> attribute.Attribute(msg)

Add the native HTML title attribute.

Use this when you want browser-default tooltip behavior or a fallback.

pub fn tooltip(text: String) -> attribute.Attribute(msg)

Add Oat tooltip text to an element.

This sets data-tooltip, which Oat styles can read to show tooltip UI.

✨ Search Document