function / @typed/ui/Tooltip

Content

Renders role="tooltip" content through the native Popover API.

Learn this UI primitive →

Package version
1.0.0-beta.7
Category
Native content host
Since
1.0.0

Import

import { Content } from "@typed/ui/Tooltip";

Signatures

export declare function Content<const Options extends ContentOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ContentInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;

Why

Native top-layer output avoids reparenting into a private portal while real toggle/mouse/keyboard events synchronize renderer-independent state.

Ownership and lifetime

Running the Fx owns listeners and NativePopover observation in its Scope. A custom host must preserve id, role, manual popover, handlers, and one hydration ref owner.

Examples

import { Effect } from "effect"
import * as Tooltip from "@typed/ui/Tooltip"

const program = Effect.gen(function* () {
  const state = yield* Tooltip.makeState({ id: "save-help" })
  return Tooltip.Content({ state, content: "Stores changes" })
})

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source