Componentfeedback0.86 KB gzipZero dependencies

CoachMark

Single floating tip bubble anchored to trigger children with arrow, title, body, dismiss; pop-in with springy scale.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add coach-mark

Or install the full npm package:

npm install bigbullui

Usage

tsx7 lines
import { CoachMark } from "@/components/ui/coach-mark" <CoachMark  trigger={<div className="p-4 bg-card rounded-md">Get Started</div>}  title="Welcome"  description="This is a coach mark guiding you through the interface"  onDismiss={() => {}} />

Source code

coach-mark.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxcoach-mark.tsx98 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export type CoachMarkProps = {  trigger: React.ReactNode;  title: string;  description?: string;  open?: boolean;  onDismiss?: () => void;} & Omit<React.HTMLAttributes<HTMLElement>, "title">; export function CoachMark({ trigger, title, description, open: controlledOpen, onDismiss, ...props }: CoachMarkProps) {  const [internalOpen, setInternalOpen] = React.useState(true);  const isOpen = controlledOpen !== undefined ? controlledOpen : internalOpen;   const dismiss = React.useCallback(() => {

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { CoachMark } from "@/components/ui/coach-mark"; <CoachMark />
PropTypeDescription
triggerReact.ReactNodeChildren to anchor the coach mark to.
titlestringTitle text in the coach mark bubble.
descriptionstringOptional description text in the coach mark bubble.
openbooleanControlled open visibility state.
onDismiss() => voidCallback when dismiss is clicked.