Skip to content

COMPONENT / hud-tooltip

HUD Tooltip_

Hover and focus tooltip in two looks: a bordered data readout and a target-lock card with bracket corners and a leader line. Built on Base UI. Requires @cybr/tokens.

Install

  1. 1. Map the @cybr namespace, once per project. Add this inside your components.json, or into its existing "registries" object. No components.json yet? Run npx shadcn@latest init first to create one.

    "registries": { "@cybr": "https://cybr-ui.com/r/{name}.json" }
  2. 2. Add components:

    $ npx shadcn@latest add @cybr/hud-tooltip

If shadcn reports Unknown registry "@cybr", step 1 is missing from that project's components.json.

Preview

Hover over or tab to a node to open its tooltip.

Props

Component props
PropTypeDefaultDescription
contentReactNode—Tooltip text. In the lock variant, this is the body under the title.
childrenReactElement—One focusable element, such as a <button>, used as the trigger. Give it its own accessible name.
variant"readout" | "lock""readout"Readout is a small bordered data box. Lock is the target-lock card with bracket corners and a leader line.
eyebrowReactNode—Small label above the title. Lock variant only.
titleReactNode—Display title. Lock variant only.
side"top" | "right" | "bottom" | "left""bottom"Preferred side. It flips when there is no room.
align"start" | "center" | "end""start"Alignment along that side.
open / defaultOpen / onOpenChangeboolean / boolean / function—Control the open state, for example to pin a tooltip open.
...propsTooltip.Popup props—Forwarded to Base UI's Tooltip.Popup; className is merged last with cn().

Usage

Installs @base-ui/react. Needs the stylesheet from @cybr/tokens. After the install, import it in app/globals.css:

@import "tailwindcss";
@import "../styles/cybr-tokens.css";
import { HudTooltip } from "@/components/ui/hud-tooltip";

export function Node() {
  return (
    <HudTooltip variant="lock" eyebrow="TARGET LOCKED" title="NODE 12" content="Relay online.">
      <button type="button">NODE 12</button>
    </HudTooltip>
  );
}

States

Accessibility