Arrow Text

Playful handwritten callout component with a smooth curving SVG sketch arrow, configurable directions (top/bottom with left/right mirrors), and hover bounce animation.

Give a Star
Look here
Click below
Explore more
1import { ArrowText } from "@/components/arrow-text";
2 
3export default function ArrowTextDemo() {
4 return (
5 <div className="grid grid-cols-2 gap-10 py-10 select-none items-center justify-items-center">
6 {/* Top Right */}
7 <ArrowText
8 text="Give a Star"
9 arrowPosition="top"
10 arrowDirection="up-right"
11 arrowSize={32}
12 />
13 
14 {/* Top Left */}
15 <ArrowText
16 text="Look here"
17 arrowPosition="top"
18 arrowDirection="up-left"
19 arrowSize={32}
20 />
21 
22 {/* Bottom Right */}
23 <ArrowText
24 text="Click below"
25 arrowPosition="bottom"
26 arrowDirection="down-right"
27 arrowSize={32}
28 />
29 
30 {/* Bottom Left */}
31 <ArrowText
32 text="Explore more"
33 arrowPosition="bottom"
34 arrowDirection="down-left"
35 arrowSize={32}
36 />
37 </div>
38 );
39}

Installation

bunx --bun shadcn@latest add https://www.ashutoshtiwari.is-a.dev/r/arrow-text.json

Usage

1import { ArrowText } from "@/components/arrow-text"
1<ArrowText text="Give a Star" arrowPosition="top" arrowDirection="up-right" />

API Reference

PropTypeDefaultDescription
textReact.ReactNode"Give a Star"

Text content displayed in handwritten Caveat font.

arrowDirection"up-right" | "down-right" | "up-left" | "down-left""up-right"

Direction the curved sketch arrow points towards.

arrowPosition"top" | "bottom" | "top-right" | "top-left" | "bottom-right" | "bottom-left""top"

Placement of the arrow on top or bottom of the text.

arrowSizenumber32

Bounding box size in pixels for the SVG arrow.

animatebooleantrue

Whether the arrow performs a subtle spring hover translation towards the arrowhead.

textClassNamestring""

Additional CSS classes applied to the text element.

arrowClassNamestring""

Additional CSS classes applied to the arrow SVG element.

classNamestring""

Additional CSS classes applied to the root container.