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

1.0.38 • Public • Published

Hex: Tooltip

npm version Known Vulnerabilities Build Status codecov last commit issues

Tooltips for Dead by Daylight anywhere on the web.

Getting Started

Install hex-tooltip and save to your package.json in one easy step.

With npm:

npm install @stephenpoole/hex-tooltip

With yarn:

yarn add @stephenpoole/hex-tooltip

Usage

In the browser globally

  1. Insert the script tag in your html head:
<script src="https://cdn.jsdelivr.net/npm/@stephenpoole/hex-tooltip/dist/hex.tooltip.js"></script>
  1. Pass an HTMLElement containing a tooltip tag: Try it out
<div id="hex-tooltip"><span class="hex-tooltip-959f26b8824a7"></span></div>
HexTooltip.parse(document.getElementById("hex-tooltip"));

In the browser with webpack

  1. Import hex-tooltip into your application:
import HexTooltip from "@stephenpoole/hex-tooltip";
  1. Pass an HTMLElement containing a tooltip tag:
HexTooltip.parse(document.getElementById("hex-tooltip"));

2a. or mount it in your React application

import HexTooltip, { HexTooltipApp, PerkTooltip, PerkModel, DeadByDaylight } from "@stephenpoole/hex-tooltip";

const model = HexTooltip.toModel("Hex: Ruin");
const { rarity, name, description, flavor, owner } = model as PerkModel;

<HexTooltipApp
    title="<span class="hex-tooltip-d9d3e49cb23dd"></span>"
    tooltip={
        <PerkTooltip
            rarity={rarity}
            name={name}
            description={description}
            flavor={flavor}
            owner={owner}
            tier={tier}
        />
    }
/>

Documentation

You'll find the type documentation here: Documentation

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @stephenpoole/hex-tooltip

Weekly Downloads

0

Version

1.0.38

License

MIT

Unpacked Size

34.8 MB

Total Files

36

Last publish

Collaborators

  • stephenpoole