Sliced Text
kokonut-ui/sliced-textFreeComponent
I haven't found any usage for that component, but i like it.
Live preview
live · rendered by the registry
Rendered by kokonut-ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://kokonutui.com/r/sliced-text.jsonSource
1"use client";23/**4 * @author: @dorianbaffier5 * @description: Sliced Text6 * @version: 1.0.07 * @date: 2025-06-268 * @license: MIT9 * @website: https://kokonutui.com10 * @github: https://github.com/kokonut-labs/kokonutui11 */1213import { motion } from "motion/react";14import { cn } from "@/lib/utils";1516interface SlicedTextProps {17 text: string;18 className?: string;19 containerClassName?: string;20 splitSpacing?: number;21}2223const SlicedText: React.FC<SlicedTextProps> = ({24 text = "Sliced Text",25 className = "",26 containerClassName = "",27 splitSpacing = 2,28}) => (29 <motion.div30 className={cn(31 "relative inline-block w-full text-center",32 containerClassName33 )}34 initial="default"35 whileHover="hover"36 >37 <motion.div38 className={cn("absolute -ml-0.5 w-full text-4xl", className)}39 transition={{ duration: 0.1 }}40 variants={{41 default: {42 clipPath: "inset(0 0 50% 0)",43 y: -splitSpacing / 2,44 opacity: 1,45 },46 hover: {47 clipPath: "inset(0 0 0 0)",48 y: 0,49 opacity: 0,50 },51 }}52 >53 {text}54 </motion.div>55 <motion.div56 className={cn("absolute w-full text-4xl", className)}57 transition={{ duration: 0.1 }}58 variants={{59 default: {60 clipPath: "inset(50% 0 0 0)",61 y: splitSpacing / 2,62 opacity: 1,63 },64 hover: {65 clipPath: "inset(0 0 0 0)",66 y: 0,67 opacity: 1,68 },69 }}70 >71 {text}72 </motion.div>7374 <div className={cn("invisible text-4xl", className)}>{text}</div>75 </motion.div>76);7778export default SlicedText;
What it pulls in
npm packages
Files it writes
More from kokonut-ui
All 40 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Action Search Baraction-search-bar | kokonut-ui | Components | Free | 2 deps · 2 files | |
| AI Input Searchai-input-search | kokonut-ui | Components | Free | 1 dep · 2 files | |
| AI State Loadingai-loading | kokonut-ui | Components | Free | 1 dep | |
| AI Input Selectorai-prompt | kokonut-ui | Components | Free | 2 deps · 4 files | |
| AI Text Loadingai-text-loading | kokonut-ui | Components | Free | 1 dep | |
| AI Voiceai-voice | kokonut-ui | Components | Free | 2 deps | |
| Apple Activity Cardapple-activity-card | kokonut-ui | Components | Free | 1 dep | |
| Magnet Buttonattract-button | kokonut-ui | Components | Free | 2 deps |
