0.5.2 • Published 5 years ago

react-portal-hint v0.5.2

Weekly downloads
33
License
MIT
Repository
github
Last release
5 years ago

react-portal-hint

This library is in the alpha phase. Many things are subject to change.

The intuitive, efficient, configurable Tooltip/Popover which exploits React Portals. Parallel fading is enabled.
Demo

CircleCI npm version license

TODO

  • Implement default style
  • Implement port for user-defined style
  • Support place options (top, button, left, right)
  • Make portal root element configurable
  • Follow target or hint content size or position (Use ResizeObserver)
  • Support more events
  • Support more place options (combinations)
  • Implement transform observation (Use setInterval)
  • Resolve margin problem
  • Resolve CSS Flexbox & Grid problem
  • Examples (Flexbox, CSS grid)
  • Enable ts strict options
  • Do TODO in code
  • Accepts forwardRef
  • Accepts multiple children
  • content validation
  • Example with custom stylesheet
  • Accepts Refs as props (exotic)
  • Configure test summary for CI
  • Well-documented documents
  • Improve performance
  • Multi-browser support

How to use

Use this as tooltip with default style

import Hint from "react-portal-hint";
import "react-portal-hint/default.css";

<Hint content="Hello!">
  <button>Something happens...</button>
</Hint>;

Props

PropertyNameTypeDefault
contentJSX.Element ǀ string ǀ ((rect: ClientRect) => JSX.Element ǀ string)N/A
place(see below)"top"
type ActualPlace = "top" | "bottom" | "left" | "right";
type Place = ActualPlace | "column" | "row" | "start" | "end";
declare place: Place | ActualPlace[]; // TODO: explanation

TODO...

License

MIT

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago