npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xsolla/xui-toggletip

v0.168.0

Published

A click-triggered popover that shows rich content (title, body, footer) anchored to a trigger element. Cross-platform via `@xsolla/xui-primitives`; click-outside and Escape dismissal are web-only.

Downloads

7,137

Readme

Toggletip

A click-triggered popover that shows rich content (title, body, footer) anchored to a trigger element. Cross-platform via @xsolla/xui-primitives; click-outside and Escape dismissal are web-only.

Installation

npm install @xsolla/xui-toggletip

Imports

import {
  Toggletip,
  type ToggletipProps,
  type ToggletipPlacement,
} from "@xsolla/xui-toggletip";

Quick start

import * as React from "react";
import { Toggletip } from "@xsolla/xui-toggletip";
import { IconButton } from "@xsolla/xui-button";
import { HelpCircle } from "@xsolla/xui-icons-base";

export default function Example() {
  return (
    <Toggletip
      title="Help"
      content="Click here to learn more about this feature."
    >
      <IconButton
        icon={<HelpCircle size={20} />}
        variant="secondary"
        tone="mono"
        size="sm"
        aria-label="Help"
      />
    </Toggletip>
  );
}

API Reference

<Toggletip>

| Prop | Type | Default | Description | | --------------- | -------------------- | --------- | ------------------------------------------------------------------------------------------------------------- | | children | ReactNode | — | Trigger element. | | title | ReactNode | — | Optional header content. Renders above the divider. | | content | ReactNode | — | Main content. Strings/numbers render as themed text; other nodes render as-is. | | footer | ReactNode | — | Optional footer (typically buttons). | | direction | ToggletipPlacement | "top" | Placement relative to trigger. | | autoDirection | boolean | true | Auto-adjust placement when near viewport edges. | | offset | number | 12 | Distance from trigger in pixels. | | width | string | "288px" | Popover width (CSS length). | | data-testid | string | — | Test identifier. | | testID | string | — | Test ID for testing frameworks. On web this renders as data-testid; on React Native it renders as testID. |

Inherits ThemeOverrideProps (themeMode, themeProductContext).

ToggletipPlacement is "top" | "top-left" | "top-right" | "bottom" | "bottom-left" | "bottom-right" | "left" | "right".

Examples

With footer actions

import * as React from "react";
import { Toggletip } from "@xsolla/xui-toggletip";
import { Button } from "@xsolla/xui-button";
import { Info } from "@xsolla/xui-icons-base";

export default function WithFooter() {
  return (
    <Toggletip
      title="Confirmation"
      content="Are you sure you want to proceed?"
      footer={
        <>
          <Button size="sm" variant="secondary">
            Cancel
          </Button>
          <Button size="sm">Confirm</Button>
        </>
      }
    >
      <Button size="sm" iconLeft={<Info size={16} />}>
        Details
      </Button>
    </Toggletip>
  );
}

Different directions

import * as React from "react";
import { Toggletip } from "@xsolla/xui-toggletip";
import { Button } from "@xsolla/xui-button";

export default function Directions() {
  return (
    <div style={{ display: "flex", gap: 16, padding: 100 }}>
      <Toggletip direction="top" content="Appears above">
        <Button size="sm">Top</Button>
      </Toggletip>
      <Toggletip direction="bottom" content="Appears below">
        <Button size="sm">Bottom</Button>
      </Toggletip>
      <Toggletip direction="left" content="Appears left">
        <Button size="sm">Left</Button>
      </Toggletip>
      <Toggletip direction="right" content="Appears right">
        <Button size="sm">Right</Button>
      </Toggletip>
    </div>
  );
}

Rich body content

import * as React from "react";
import { Toggletip } from "@xsolla/xui-toggletip";
import { IconButton } from "@xsolla/xui-button";
import { HelpCircle } from "@xsolla/xui-icons-base";

export default function Rich() {
  return (
    <Toggletip
      title="Premium benefits"
      content={
        <ul style={{ margin: 0, paddingLeft: 20 }}>
          <li>Unlimited downloads</li>
          <li>Priority support</li>
          <li>Advanced analytics</li>
          <li>Custom branding</li>
        </ul>
      }
    >
      <IconButton
        icon={<HelpCircle size={16} />}
        aria-label="Premium benefits"
        variant="secondary"
        tone="mono"
        size="sm"
      />
    </Toggletip>
  );
}

Quick actions menu

import * as React from "react";
import { Toggletip } from "@xsolla/xui-toggletip";
import { Button, IconButton } from "@xsolla/xui-button";
import { MoreVertical, Edit, Copy, Trash } from "@xsolla/xui-icons-base";

export default function QuickActions() {
  return (
    <Toggletip
      direction="bottom-right"
      width="160px"
      content={
        <div style={{ display: "flex", flexDirection: "column", gap: 8 }}>
          <Button
            size="sm"
            variant="secondary"
            iconLeft={<Edit size={16} />}
            fullWidth
          >
            Edit
          </Button>
          <Button
            size="sm"
            variant="secondary"
            iconLeft={<Copy size={16} />}
            fullWidth
          >
            Duplicate
          </Button>
          <Button
            size="sm"
            variant="secondary"
            tone="alert"
            iconLeft={<Trash size={16} />}
            fullWidth
          >
            Delete
          </Button>
        </div>
      }
    >
      <IconButton
        icon={<MoreVertical size={20} />}
        variant="secondary"
        tone="mono"
        size="sm"
        aria-label="More actions"
      />
    </Toggletip>
  );
}

Behaviour

  • Opens on trigger click; closes on click outside (web only).
  • Closes on Escape (web only).
  • Auto-adjusts position to stay in viewport when autoDirection is true.
  • Uses theme shadow.popover for elevation.

Toggletip vs Tooltip

| Feature | Toggletip | Tooltip | | ------------- | ----------------------------------- | --------------- | | Trigger | Click | Hover/focus | | Content | Rich (title, body, footer) | Simple text | | Interactivity | Can contain interactive elements | Non-interactive | | Use case | Help text, mini forms, action menus | Quick hints |

Accessibility

  • Click-triggered, so the trigger must be a focusable element.
  • Escape dismisses the popover (web only).
  • Provide an accessible name on the trigger (e.g. aria-label on icon-only triggers).

Related

  • Tooltip — hover/focus-triggered hint variant.