Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@gluestack-ui/tooltip

gluestack94.4k0.1.44TypeScript support: included

A universal headless tooltip component for React Native, Next.js & React

react, native, react-native, tooltip, gluestack-ui, universal, headless, typescript, component, android, ios, nextjs

readme

@gluestack-ui/tooltip

Installation

To use @gluestack-ui/tooltip, all you need to do is install the @gluestack-ui/tooltip package:

$ yarn add @gluestack-ui/tooltip

# or

$ npm i @gluestack-ui/tooltip

Usage

Whether you need to provide helpful hints to new users or display extra details for power users, the Tooltip component is a simple and effective way. Here's an example how to use this package to create one:

import { Root, Content } from '../components/core/tooltip/styled-components';
import { createTooltip } from '@gluestack-ui/tooltip';
export const Tooltip = createTooltip({
  Root,
  Content,
});

Customizing the tooltip:

Default styling of all these components can be found in the components/core/tooltip file. For reference, you can view the source code of the styled tooltip components.

// import the styles

import { Root, Content } from '../components/core/tooltip/styled-components';

// import the createTooltip function
import { createTooltip } from '@gluestack-ui/tooltip';

// Understanding the API
export const Tooltip = createTooltip({
  Root,
  Content,
});

// Using the tooltip component
export default () => (
  <Tooltip>
    <TooltipContent />
  </Tooltip>
);

More guides on how to get started are available here.

changelog

Changelog

Latest Release

December 23, 2022: v0.1.0

Previous Releases