2.3.0 • Published 1 year ago

@hig/tooltip v2.3.0

Weekly downloads
9
License
Apache-2.0
Repository
github
Last release
1 year ago

Tooltip

Tooltips generally describe what a tool or feature does, or when or how to use it.

Read more about when and how to use the Tooltip component on the internal wiki.

Getting started

Install the package

yarn add @hig/tooltip @hig/theme-context @hig/theme-data

Import the component

import Tooltip from '@hig/tooltip';

Basic usage

<Tooltip anchorPoint="top-center" content="Testing tooltip">
  <Button title="Open Tooltip" />
</Tooltip>

Styling

Use the className prop to pass in a css class name to the outermost container of the component. The class name will also pass down to most of the other styled elements within the component.

Toolt also has a stylesheet prop that accepts a function wherein you can modify its styles. For instance

import Tooltip from '@hig/tooltip';

function YourComponent() {
  // ...
  const customStylesheet = (styles, props, themeData) => ({
    ...styles,
    content: {
      ...styles.content,
      color: themeData["colorScheme.status.error"]
    },
    panel: {
      ...styles.panel,
      opacity: 1
    },
    panelInner: {
      ...styles.panelInner,
      padding: `4px`
    },
    textContent: {
      ...styles.textContent,
      position: `static`
    }
  });

  return (
    <Tooltip stylesheet={customStylesheet} />
  );
}
2.3.0

1 year ago

2.2.0

2 years ago

2.0.0

2 years ago

1.1.1

2 years ago

1.1.2

2 years ago

2.1.0

2 years ago

1.1.0

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.1.1-alpha

6 years ago

0.1.0-alpha

6 years ago