New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@purpurds/tooltip

Package Overview
Dependencies
Maintainers
2
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@purpurds/tooltip

import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";

  • 4.2.0
  • npm
  • Socket score

Version published
Weekly downloads
3K
decreased by-17.7%
Maintainers
2
Weekly downloads
 
Created
Source

import { Meta, Stories, ArgTypes, Primary, Subtitle } from "@storybook/blocks";

import * as TooltipStories from "./src/tooltip.stories"; import packageInfo from "./package.json";

Tooltip

Version {packageInfo.version}

Showcase

Properties

Installation

Via NPM

Add the dependency to your consumer app like "@purpurds/purpur": "^x.y.z"

In MyApp.tsx

import "@purpurds/purpur/styles";

In MyComponent.tsx

Standard usage:

import { Tooltip } from "@purpurds/purpur";

export const MyComponent = () => {
  return <Tooltip triggerAriaLabel="extra information about something">Some content</Tooltip>;
};

Setting negative variant with position and alignment:

import { Tooltip } from "@purpurds/purpur";

export const MyComponent = () => {
  return (
    <Tooltip
      triggerAriaLabel="extra information about something"
      variant="primary-negative"
      position="top"
      align="center"
    >
      Some content
    </Tooltip>
  );
};

Using custom trigger element:

import { Button, IconPetDog, Tooltip } from "@purpurds/purpur";

export const MyComponent = () => {
  const customTooltipTrigger: ReactNode = (
    <Button variant="primary">
      <IconPetDog />
      This is a custom trigger
    </Button>
  );

  return <Tooltip triggerElement={customTooltipTrigger}>Some content</Tooltip>;
};

Using jsx in content:

import { Tooltip } from "@purpurds/purpur";

export const MyComponent = () => {
  return (
    <Tooltip triggerAriaLabel="extra information about something">
      <div>Hello world! This is the content</div>
    </Tooltip>
  );
};

FAQs

Package last updated on 23 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc