JSPM

@polar/lib-tooltip

1.1.0-alpha.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q19583F
  • License EUPL-1.2

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

Package Exports

  • @polar/lib-tooltip

Readme

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