Skip to main content
userTourKit
@tour-kit/announcementsHeadless

HeadlessSpotlight

HeadlessAnnouncementSpotlight: unstyled highlight primitive with target element positioning and overlay via render props

domidex01Published

Unstyled element spotlight that provides state and behavior through render props.

Additional Render Props

Prop

Type

Example

import { HeadlessSpotlight } from '@tour-kit/announcements/headless';

<HeadlessSpotlight
  id="new-button"
  render={({
    isVisible,
    config,
    hide,
    targetElement,
    targetRect,
    overlayStyle,
    spotlightStyle,
  }) => {
    if (!isVisible || !targetElement || !targetRect) return null;

    return (
      <>
        {/* Overlay with cutout */}
        <div className="overlay" style={overlayStyle} onClick={hide} />

        {/* Spotlight highlight */}
        <div className="spotlight" style={spotlightStyle} />

        {/* Announcement card */}
        <div className="announcement-card">
          <h3>{config.title}</h3>
          <p>{config.description}</p>
          <button onClick={hide}>Got it</button>
        </div>
      </>
    );
  }}
/>
Free & open source

Ship onboarding, not config.

npm i @tour-kit/core is MIT and free. The Pro packages work unlicensed too — a one-time $99 license removes the production watermark when you ship.

MIT-licensed — no signup, no credit card. Pay once, only when you ship.