@polar/lib-tooltip
TypeScript icon, indicating that this package has built-in type declarations

1.1.0-alpha.1 • Public • Published

tooltip

Minimal package that provides a div element factory bound to i18next translations. The element can e.g. be used in ol/Overlay.

import { getTooltip } from '@polar/lib-tooltip'

const tooltip = getTooltip({
  style: '', // optional inline style string
  localeKeys: [
    // tag/content pairs
    ['h2', 'plugins.myPlugin.header'],
    ['p', 'plugins.myPlugin.body']
  ],
})

// tooltip contains 'element' (a div) and 'unregister' (when div is no longer used)
// the element will automatically update on locale change

/@polar/lib-tooltip/

    Package Sidebar

    Install

    npm i @polar/lib-tooltip

    Weekly Downloads

    0

    Version

    1.1.0-alpha.1

    License

    EUPL-1.2

    Unpacked Size

    20.4 kB

    Total Files

    6

    Last publish

    Collaborators

    • dopenguin
    • sende