JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 220
  • Score
    100M100P100Q82571F
  • License MIT

ReactJS ARIA tooltip component

Package Exports

  • react-aria-tooltip

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-aria-tooltip) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-aria-tooltip

Simple ReactJS component that adds the appropriate role, identification structure, and aria-hidden attribute for a tooltip.

Installation

npm install react-aria-tooltip

Usage

import ReactARIAToolTip from 'react-aria-tooltip'

return (
    <ReactARIAToolTip message="You custom message">
        <sometagorcomponent></sometagorcomponent>
    </ReactARIAToolTip>
)

You will also need to include the tooltip css path into your application in some form.

CSS @import

Import the package css file relative to your node_modules directory.

Example

@import "../../../node_modules/react-aria-tooltip/dist/react-tooltip.min.css";

Options

  1. message string that will display in the tooltip
  2. eventType this can either be 'click' or 'hover'
  3. direction the placement of the tooltip. Can be one of four options 'top', 'bottom', 'right', 'left'
  4. duration this is only applicable to the click eventType. This value defines the amount of time the tooltip is present after the user clicks the target element

Examples

<ReactARIAToolTip message="Tooltip text" eventType="hover" direction="bottom">
    <span>Some text</span>
</ReactARIAToolTip>
<ReactARIAToolTip message="Something fancy" eventType="click" duration="500">
    <img src="../path/to/some/image" alt="" title="" />
</ReactARIAToolTip>

MIT Licenced