Overlays

Tooltip.

A helpful detail, right when it is needed.

Live preview

Live preview
tsx
import { Tooltip, Button } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <Tooltip content="Save your current workspace">
      <Button variant="secondary">Save workspace</Button>
    </Tooltip>
  );
}

Installation

bash
npm install luminescent

Import luminescent/style.css once at your application root. The example above uses the same package implementation as Storybook.

Variants and states

Use the preview controls to explore the supported variants, sizes, disabled/loading states and reduced motion. Controls appear only where the component exposes the corresponding prop. Theme and glow apply to every component.

Controlled and uncontrolled state

State contract: open / defaultOpen / onOpenChange. Omit the controlled prop to let the component own its initial state; supply a value and callback when your application owns it. Native uncontrolled fields and state-backed form controls participate in form reset. Controlled state must be reset by the application.

tsx
import { useState } from "react";
import { Tooltip, Button } from "luminescent";


export function ControlledExample() {
  const [value, setValue] = useState(false);
  return (
    <Tooltip content="Save the project" open={value} onOpenChange={setValue}>
      <Button>Save</Button>
    </Tooltip>
  );
}

API reference

Generated from the source TypeScript interfaces. Native attributes, className, style, aria-* and data-* also pass through to the documented element. Import TooltipProps from the package for the full inherited contract.

PropTypeDetails
childrenrequiredReact.ReactElementOptional unless marked required.
contentrequiredReact.ReactNodeOptional unless marked required.
delayDurationnumberOptional unless marked required.
openbooleanOptional unless marked required.
defaultOpenbooleanOptional unless marked required.
onOpenChange(open: boolean) => voidOptional unless marked required.

Accessibility and keyboard

Opens on hover or keyboard focus; Escape dismisses. Content describes its trigger. Use Popover for interactive content and never put essential instructions only in a tooltip. Disabled native buttons do not receive focus; place explanations in nearby text.

Keep labels meaningful and test application-level contrast, focus order and screen-reader output. See the accessibility guide for composition requirements.

Theme customization

tsx
import { LuminescentProvider, Tooltip, Button } from "luminescent";
import "luminescent/style.css";


export function Example() {
  return (
    <LuminescentProvider theme="light" accent="violet" glow="subtle">
      <Tooltip content="Save your current workspace">
        <Button variant="secondary">Save workspace</Button>
      </Tooltip>
    </LuminescentProvider>
  );
}

Switch between light and dark in the preview, or open the playground for a larger workspace. Custom CSS variables can override spacing, color, typography and effects.

Related components