{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "scribbled-text",
  "title": "Scribbled Text",
  "description": "Mark inline text with colorful hand-drawn annotations.",
  "dependencies": [
    "motion"
  ],
  "files": [
    {
      "path": "src/registry/components/scribbled-text/scribbled-text.tsx",
      "content": "\"use client\";\n\nimport { type HTMLMotionProps, motion, type Variants } from \"motion/react\";\nimport {\n\ttype ComponentType,\n\tforwardRef,\n\ttype ReactNode,\n\tuseId,\n\tuseSyncExternalStore,\n} from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nconst EASE_OUT = [0.23, 1, 0.32, 1] as const;\nconst REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\n\nconst DRAW_PATH = {\n\thidden: { pathLength: 0 },\n\tvisible: { pathLength: 1 },\n} satisfies Variants;\n\nconst REVEAL_LEFT = {\n\thidden: { clipPath: \"inset(0 100% 0 0)\" },\n\tvisible: { clipPath: \"inset(0 0% 0 0)\" },\n} satisfies Variants;\n\nfunction getTransition(\n\tshouldReduceMotion: boolean,\n\tduration: number,\n\tdelay = 0,\n) {\n\treturn shouldReduceMotion\n\t\t? { duration: 0 }\n\t\t: { duration, delay, ease: EASE_OUT };\n}\n\nfunction subscribeToReducedMotion(onStoreChange: () => void) {\n\tconst mediaQuery = window.matchMedia(REDUCED_MOTION_QUERY);\n\tmediaQuery.addEventListener(\"change\", onStoreChange);\n\n\treturn () => mediaQuery.removeEventListener(\"change\", onStoreChange);\n}\n\nfunction getReducedMotionSnapshot() {\n\treturn window.matchMedia(REDUCED_MOTION_QUERY).matches;\n}\n\nfunction getReducedMotionServerSnapshot() {\n\treturn false;\n}\n\ntype ScribbleDecorationProps = {\n\tclassName?: string;\n\troughFilterId: string;\n\tshouldReduceMotion: boolean;\n\tsoftFilterId: string;\n};\n\nfunction RoughFilters({\n\troughFilterId,\n\tsoftFilterId,\n}: Pick<ScribbleDecorationProps, \"roughFilterId\" | \"softFilterId\">) {\n\treturn (\n\t\t<svg\n\t\t\tclassName=\"pointer-events-none absolute size-0 overflow-hidden\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<defs>\n\t\t\t\t<filter id={roughFilterId} x=\"-30%\" y=\"-30%\" width=\"160%\" height=\"160%\">\n\t\t\t\t\t<feTurbulence\n\t\t\t\t\t\ttype=\"fractalNoise\"\n\t\t\t\t\t\tbaseFrequency={0.045}\n\t\t\t\t\t\tnumOctaves={2}\n\t\t\t\t\t\tseed={4}\n\t\t\t\t\t\tresult=\"noise\"\n\t\t\t\t\t/>\n\t\t\t\t\t<feDisplacementMap\n\t\t\t\t\t\tin=\"SourceGraphic\"\n\t\t\t\t\t\tin2=\"noise\"\n\t\t\t\t\t\tscale={2.6}\n\t\t\t\t\t\txChannelSelector=\"R\"\n\t\t\t\t\t\tyChannelSelector=\"G\"\n\t\t\t\t\t/>\n\t\t\t\t</filter>\n\t\t\t\t<filter id={softFilterId} x=\"-30%\" y=\"-30%\" width=\"160%\" height=\"160%\">\n\t\t\t\t\t<feTurbulence\n\t\t\t\t\t\ttype=\"fractalNoise\"\n\t\t\t\t\t\tbaseFrequency={0.035}\n\t\t\t\t\t\tnumOctaves={2}\n\t\t\t\t\t\tseed={11}\n\t\t\t\t\t\tresult=\"softNoise\"\n\t\t\t\t\t/>\n\t\t\t\t\t<feDisplacementMap\n\t\t\t\t\t\tin=\"SourceGraphic\"\n\t\t\t\t\t\tin2=\"softNoise\"\n\t\t\t\t\t\tscale={1.5}\n\t\t\t\t\t\txChannelSelector=\"R\"\n\t\t\t\t\t\tyChannelSelector=\"G\"\n\t\t\t\t\t/>\n\t\t\t\t</filter>\n\t\t\t</defs>\n\t\t</svg>\n\t);\n}\n\nfunction WavyUnderlineDecoration({\n\tclassName,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 140 14\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M2,6 Q5.5,3 9,6 T17,6 T25,6 T33,6 T41,6 T49,6 T57,6 T65,6 T73,6 T81,6 T89,6 T97,6 T105,6 T113,6 T121,6 T129,6 T137,6\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.2}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.5)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction CircleDecoration({\n\tclassName,\n\troughFilterId,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 220 64\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M40,40 C20,23 53,7 102,5 C153,3 207,11 211,29 C215,47 167,60 109,60 C59,60 15,53 19,35 C21,27 27,22 37,20\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={3}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${roughFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.65)}\n\t\t\t/>\n\t\t\t<motion.path\n\t\t\t\td=\"M43,37 C28,25 58,9 105,7 C151,6 199,14 206,29 C212,45 167,57 110,58\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={1.5}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\topacity={0.55}\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.65, 0.08)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction HighlightDecoration({\n\tclassName,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 170 26\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M4,17 C2,11 5,7 12,6 C45,2 95,2 138,4 C152,5 164,7 166,13 C167,18 163,21 155,22 C112,24 60,24 16,22 C8,21.5 4,20 4,17 Z\"\n\t\t\t\tfill=\"currentColor\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={REVEAL_LEFT}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.45)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction UnderlineDecoration({\n\tclassName,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 140 10\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M3,6 C40,3 100,3 137,5\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.4}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.42)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction StraightUnderlineDecoration({\n\tclassName,\n\tshouldReduceMotion,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<motion.span\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\"block rounded-full bg-current\", className)}\n\t\t\tvariants={REVEAL_LEFT}\n\t\t\ttransition={getTransition(shouldReduceMotion, 0.35)}\n\t\t/>\n\t);\n}\n\nfunction DottedUnderlineDecoration({\n\tclassName,\n\tshouldReduceMotion,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<motion.span\n\t\t\taria-hidden=\"true\"\n\t\t\tclassName={cn(\n\t\t\t\t\"bg-[radial-gradient(circle,currentColor_1.5px,transparent_1.5px)]\",\n\t\t\t\t\"bg-position-[0_100%] bg-size-[0.5em_100%] bg-repeat-x\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tvariants={REVEAL_LEFT}\n\t\t\ttransition={getTransition(shouldReduceMotion, 0.4)}\n\t\t/>\n\t);\n}\n\nfunction DoubleUnderlineDecoration({\n\tclassName,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 140 16\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M3,5 C40,2 100,2 137,4\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.2}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.45)}\n\t\t\t/>\n\t\t\t<motion.path\n\t\t\t\td=\"M5,12 C42,9 98,10 135,11\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={1.8}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\topacity={0.75}\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.4, 0.08)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction StrikethroughDecoration({\n\tclassName,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 140 10\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M3,5 C40,7 100,3 137,5\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.4}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.42)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction CrossOutDecoration({\n\tclassName,\n\troughFilterId,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 140 40\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M4,32 C40,10 96,30 136,8\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.4}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${roughFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.42)}\n\t\t\t/>\n\t\t\t<motion.path\n\t\t\t\td=\"M6,10 C44,30 92,12 134,30\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\topacity={0.7}\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.42, 0.08)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction ArrowUnderlineDecoration({\n\tclassName,\n\tshouldReduceMotion,\n\tsoftFilterId,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 150 18\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M3,7 C45,3 105,4 140,8\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.4}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.48)}\n\t\t\t/>\n\t\t\t<motion.path\n\t\t\t\td=\"M132,3 L142,8 L131,13\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.4}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${softFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.2, 0.34)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction BracketDecoration({\n\tclassName,\n\troughFilterId,\n\tshouldReduceMotion,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 160 60\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M18,6 C9,7 6,12 6,30 C6,48 9,53 18,54\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.6}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${roughFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.45)}\n\t\t\t/>\n\t\t\t<motion.path\n\t\t\t\td=\"M142,6 C151,7 154,12 154,30 C154,48 151,53 142,54\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.6}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${roughFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.45, 0.05)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\nfunction BoxDecoration({\n\tclassName,\n\troughFilterId,\n\tshouldReduceMotion,\n}: ScribbleDecorationProps) {\n\treturn (\n\t\t<svg\n\t\t\tclassName={className}\n\t\t\tviewBox=\"0 0 200 64\"\n\t\t\tfill=\"none\"\n\t\t\tpreserveAspectRatio=\"none\"\n\t\t\taria-hidden=\"true\"\n\t\t>\n\t\t\t<motion.path\n\t\t\t\td=\"M12,10 C60,6 140,6 188,10 C193,26 193,40 188,54 C140,58 60,58 12,54 C7,40 7,26 12,10 Z\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstrokeWidth={2.6}\n\t\t\t\tstrokeLinecap=\"round\"\n\t\t\t\tstrokeLinejoin=\"round\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tfilter={`url(#${roughFilterId})`}\n\t\t\t\tvariants={DRAW_PATH}\n\t\t\t\ttransition={getTransition(shouldReduceMotion, 0.65)}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\ntype ScribbleStyle = {\n\twrapperClassName?: string;\n\tDecoration: ComponentType<ScribbleDecorationProps>;\n\tdecorationClassName: string;\n\tdefaultColorClassName: string;\n};\n\nconst scribbleStyles = {\n\twavyUnderline: {\n\t\tDecoration: WavyUnderlineDecoration,\n\t\tdecorationClassName: \"-bottom-[0.4em] -left-[2%] h-[0.7em] w-[104%]\",\n\t\tdefaultColorClassName: \"text-purple-300\",\n\t},\n\tcircle: {\n\t\twrapperClassName: \"px-1\",\n\t\tDecoration: CircleDecoration,\n\t\tdecorationClassName:\n\t\t\t\"inset-[-0.6em_-0.55em] h-[calc(100%+1.2em)] w-[calc(100%+1.1em)]\",\n\t\tdefaultColorClassName: \"text-cyan-200\",\n\t},\n\thighlight: {\n\t\twrapperClassName: \"isolate\",\n\t\tDecoration: HighlightDecoration,\n\t\tdecorationClassName:\n\t\t\t\"inset-x-[-4%] -bottom-[0.08em] z-0 h-[1.15em] w-[108%]\",\n\t\tdefaultColorClassName: \"text-yellow-300/60\",\n\t},\n\tunderline: {\n\t\tDecoration: UnderlineDecoration,\n\t\tdecorationClassName: \"-bottom-[0.32em] -left-[1%] h-[0.5em] w-[102%]\",\n\t\tdefaultColorClassName: \"text-purple-400\",\n\t},\n\tstraightUnderline: {\n\t\tDecoration: StraightUnderlineDecoration,\n\t\tdecorationClassName: \"-bottom-[0.18em] -left-[1%] h-0.5 w-[102%]\",\n\t\tdefaultColorClassName: \"text-neutral-500\",\n\t},\n\tdottedUnderline: {\n\t\tDecoration: DottedUnderlineDecoration,\n\t\tdecorationClassName: \"-bottom-[0.35em] -left-[1%] h-[0.55em] w-[102%]\",\n\t\tdefaultColorClassName: \"text-neutral-400\",\n\t},\n\tdoubleUnderline: {\n\t\tDecoration: DoubleUnderlineDecoration,\n\t\tdecorationClassName: \"-bottom-[0.5em] -left-[1%] h-[0.7em] w-[102%]\",\n\t\tdefaultColorClassName: \"text-emerald-400\",\n\t},\n\tstrikethrough: {\n\t\tDecoration: StrikethroughDecoration,\n\t\tdecorationClassName:\n\t\t\t\"top-1/2 -left-[1%] h-[0.5em] w-[102%] -translate-y-1/2\",\n\t\tdefaultColorClassName: \"text-red-400\",\n\t},\n\tcrossOut: {\n\t\tDecoration: CrossOutDecoration,\n\t\tdecorationClassName:\n\t\t\t\"top-1/2 -left-[2%] h-[1.4em] w-[104%] -translate-y-1/2\",\n\t\tdefaultColorClassName: \"text-red-400\",\n\t},\n\tarrowUnderline: {\n\t\tDecoration: ArrowUnderlineDecoration,\n\t\tdecorationClassName: \"-bottom-[0.45em] -left-[1%] h-[0.8em] w-[106%]\",\n\t\tdefaultColorClassName: \"text-blue-400\",\n\t},\n\tbracket: {\n\t\twrapperClassName: \"px-[0.35em]\",\n\t\tDecoration: BracketDecoration,\n\t\tdecorationClassName:\n\t\t\t\"inset-y-[-0.25em] -left-[0.15em] h-[calc(100%+0.5em)] w-[calc(100%+0.3em)]\",\n\t\tdefaultColorClassName: \"text-neutral-500\",\n\t},\n\tbox: {\n\t\twrapperClassName: \"px-[0.4em]\",\n\t\tDecoration: BoxDecoration,\n\t\tdecorationClassName:\n\t\t\t\"inset-[-0.4em_-0.4em] h-[calc(100%+0.8em)] w-[calc(100%+0.8em)]\",\n\t\tdefaultColorClassName: \"text-orange-400\",\n\t},\n} as const satisfies Record<string, ScribbleStyle>;\n\nexport type ScribbledTextVariant = keyof typeof scribbleStyles;\n\ntype ScribbledTextControllerProp =\n\t| \"animate\"\n\t| \"initial\"\n\t| \"variants\"\n\t| \"viewport\"\n\t| \"whileInView\";\n\nexport interface ScribbledTextProps\n\textends Omit<\n\t\tHTMLMotionProps<\"span\">,\n\t\tScribbledTextControllerProp | \"children\"\n\t> {\n\t/** Whether the hand-drawn mark animates when it enters the viewport. */\n\tanimated?: boolean;\n\tchildren?: ReactNode;\n\t/** The shape of the hand-drawn mark. */\n\tvariant?: ScribbledTextVariant;\n\t/** Classes applied only to the hand-drawn mark. */\n\tscribbleClassName?: string;\n}\n\nexport const ScribbledText = forwardRef<HTMLSpanElement, ScribbledTextProps>(\n\t(\n\t\t{\n\t\t\tanimated = true,\n\t\t\tchildren,\n\t\t\tclassName,\n\t\t\tscribbleClassName,\n\t\t\tvariant = \"wavyUnderline\",\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst shouldReduceMotion = useSyncExternalStore(\n\t\t\tsubscribeToReducedMotion,\n\t\t\tgetReducedMotionSnapshot,\n\t\t\tgetReducedMotionServerSnapshot,\n\t\t);\n\t\tconst shouldAnimate = animated && !shouldReduceMotion;\n\t\tconst filterIdPrefix = useId().replaceAll(\":\", \"\");\n\t\tconst roughFilterId = `${filterIdPrefix}-scribbled-text-rough`;\n\t\tconst softFilterId = `${filterIdPrefix}-scribbled-text-soft`;\n\t\tconst style: ScribbleStyle = scribbleStyles[variant];\n\t\tconst Decoration = style.Decoration;\n\t\tconst decorationClassName = cn(\n\t\t\t\"pointer-events-none absolute\",\n\t\t\tstyle.decorationClassName,\n\t\t\tstyle.defaultColorClassName,\n\t\t\tscribbleClassName,\n\t\t);\n\n\t\treturn (\n\t\t\t<motion.span\n\t\t\t\tref={ref}\n\t\t\t\tinitial={shouldAnimate ? \"hidden\" : false}\n\t\t\t\tanimate={shouldAnimate ? undefined : \"visible\"}\n\t\t\t\twhileInView={shouldAnimate ? \"visible\" : undefined}\n\t\t\t\tviewport={{ once: true, margin: \"-100px\" }}\n\t\t\t\tdata-slot=\"scribbled-text\"\n\t\t\t\tdata-variant={variant}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"relative inline-block whitespace-nowrap\",\n\t\t\t\t\tstyle.wrapperClassName,\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<RoughFilters\n\t\t\t\t\troughFilterId={roughFilterId}\n\t\t\t\t\tsoftFilterId={softFilterId}\n\t\t\t\t/>\n\t\t\t\t{variant === \"highlight\" ? (\n\t\t\t\t\t<span data-slot=\"scribbled-text-content\" className=\"relative z-10\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\tchildren\n\t\t\t\t)}\n\t\t\t\t<Decoration\n\t\t\t\t\tclassName={decorationClassName}\n\t\t\t\t\troughFilterId={roughFilterId}\n\t\t\t\t\tshouldReduceMotion={!shouldAnimate}\n\t\t\t\t\tsoftFilterId={softFilterId}\n\t\t\t\t/>\n\t\t\t</motion.span>\n\t\t);\n\t},\n);\n\nScribbledText.displayName = \"ScribbledText\";\n\nexport default ScribbledText;\n",
      "type": "registry:component",
      "target": "@components/scribbled-text.tsx"
    }
  ],
  "meta": {
    "createdAt": "2026-07-20",
    "image": "https://cdn.tentui.com/images/components/scribbled-text",
    "video": "https://cdn.tentui.com/videos/components/scribbled-text"
  },
  "docs": "https://tentui.com/components/scribbled-text",
  "categories": [
    "typography"
  ],
  "type": "registry:component"
}