An open API service indexing awesome lists of open source software.

https://github.com/react-sandbox/tooltip

💬 Lightweight text tooltip
https://github.com/react-sandbox/tooltip

component react react-tooltip tooltip typescript

Last synced: 4 months ago
JSON representation

💬 Lightweight text tooltip

Awesome Lists containing this project

README

          


@react-sandbox/tooltip


Build status
Dependencies
Build size
Package downloads


Example

💬 Lightweight, customizable tooltip component.

## Usage

### Install

Install the `@react-sandbox/tooltip` package:

```
npm install @react-sandbox/tooltip
```

### Import

Import the `Tooltip` component:

```tsx
import React from 'react'
import Tooltip from '@react-sandbox/tooltip'

function App() {
return (

Save

)
}
```

### Props

| Prop | Type | Default | Description |
| ----------- | ----------------------------------------------------- | ------------ | ------------------------ |
| `title` | `string` | **required** | Text content |
| `position` | `'top' \| 'bottom' \| 'left' \| 'right'` | `'top'` | Position of tooltip |
| `delay` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 750 \| 1000` | `200` | Initial transition delay |
| `disabled` | `boolean` | `false` | Visible or not |
| `className` | `string` | `-` | CSS classes |
| `style` | `React.CSSProperties` | `-` | CSS styles |

## Development

### Local

```
yarn
yarn dev
```

### Storybook

```
yarn storybook
```

### Tests

```
yarn test
```

## License

MIT