BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/ncdai/flip-sentences

Flip Sentences

ncdai-chirags/flip-sentences
FreeComponent

ncdai publishes no description for this item.

Install it

npx shadcn@latest add https://www.chirags.dev/r/flip-sentences.json

Source

src/registry/flip-sentences/flip-sentences.tsxwww.chirags.dev/r/flip-sentences.json
1"use client";
2
3import type { Transition, Variants } from "motion/react";
4import { AnimatePresence, motion } from "motion/react";
5import { Children, useEffect, useState } from "react";
6
7import { cn } from "@/lib/utils";
8
9const defaultVariants: Variants = {
10 initial: { y: -8, opacity: 0 },
11 animate: { y: 0, opacity: 1 },
12 exit: { y: 8, opacity: 0 },
13};
14
15type MotionElement = typeof motion.p | typeof motion.span | typeof motion.code;
16
17type Props = {
18 as?: MotionElement;
19 className?: string;
20 children: React.ReactNode[];
21
22 interval?: number;
23 transition?: Transition;
24 variants?: Variants;
25
26 onIndexChange?: (index: number) => void;
27};
28
29export function FlipSentences({
30 as: Component = motion.p,
31 className,
32 children,
33
34 interval = 2,
35 transition = { duration: 0.3 },
36 variants = defaultVariants,
37
38 onIndexChange,
39}: Props) {
40 const [currentIndex, setCurrentIndex] = useState(0);
41
42 const items = Children.toArray(children);
43
44 useEffect(() => {
45 const timer = setInterval(() => {
46 setCurrentIndex((prev) => {
47 const next = (prev + 1) % items.length;
48 onIndexChange?.(next);
49 return next;
50 });
51 }, interval * 1000);
52
53 return () => clearInterval(timer);
54 }, [items.length, interval, onIndexChange]);
55
56 return (
57 <AnimatePresence mode="wait" initial={false}>
58 <Component
59 key={currentIndex}
60 className={cn("inline-block", className)}
61 initial="initial"
62 animate="animate"
63 exit="exit"
64 transition={transition}
65 variants={variants}
66 >
67 {items[currentIndex]}
68 </Component>
69 </AnimatePresence>
70 );
71}

What it pulls in

npm packages

  • motion

Other registry items

  • @ncdai/utils

Files it writes

  • src/registry/flip-sentences/flip-sentences.tsx

Facts

Registry
ncdai
Type
registry:component
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

www.chirags.dev chirraaggggg/chirags.dev on GitHub Raw registry item This item as JSON

More from ncdai

All 28 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Apple Hello Effectapple-hello-effectncdaiComponentsFree1 dep
Consent Managerconsent-managerncdaiComponentsFree1 dep · 2 files
GitHub Starsgithub-starsncdaiComponentsFreeno deps
Scroll Fade Effectscroll-fade-effectncdaiComponentsFreeno deps
Shimmering Textshimmering-textncdaiComponentsFree1 dep
Slide to Unlockslide-to-unlockncdaiComponentsFree1 dep
Testimonials Marqueetestimonials-marqueencdaiComponentsFreeno deps
Theme Switchertheme-switcherncdaiComponentsFree3 deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex