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
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add coach-markOr install the full npm package:
npm install bigbulluiUsage
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 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| trigger | React.ReactNode | Children to anchor the coach mark to. |
| title | string | Title text in the coach mark bubble. |
| description | string | Optional description text in the coach mark bubble. |
| open | boolean | Controlled open visibility state. |
| onDismiss | () => void | Callback when dismiss is clicked. |