Cards View Icon
unlumen-ui/cards-view-iconFreeComponent
Animated icon where four square dots reorder in a 2×2 grid via Motion layout animation when active, signaling a card view mode.
Live preview
live · rendered by the registry
Rendered by Unlumen Ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://ui.unlumen.com/r/cards-view-icon.jsonSource
1"use client";23import { motion } from "motion/react";45const CARD_DELAY_STEP = 0.067;67// Active permutation: TR BR / TL BL (indices in a 2×2 grid 0-3)8const ACTIVE_ORDER = [1, 3, 0, 2];9const DEFAULT_ORDER = [0, 1, 2, 3];1011export interface CardsViewIconProps {12 /** Whether the icon is in its active (animated) state. */13 isActive: boolean;14 /** Extra classes applied to the root element. */15 className?: string;16}1718export function CardsViewIcon({ isActive, className }: CardsViewIconProps) {19 const order = isActive ? ACTIVE_ORDER : DEFAULT_ORDER;2021 return (22 <motion.span23 className={`inline-grid h-3 w-3 place-content-center grid-cols-2 gap-[2.5px] ${className ?? ""}`}24 aria-hidden="true"25 >26 {order.map((id, i) => (27 <motion.span28 key={id}29 layout30 className="size-[4px] rounded-[1px] bg-current"31 animate={isActive ? { opacity: [0.65, 1, 1] } : { opacity: 1 }}32 transition={{33 duration: 0.42,34 delay: i === 0 ? 0 : i * CARD_DELAY_STEP,35 ease: "easeOut",36 layout: {37 duration: 0.45,38 delay: i === 0 ? 0 : i * CARD_DELAY_STEP,39 ease: "easeInOut",40 },41 }}42 />43 ))}44 </motion.span>45 );46}
What it pulls in
npm packages
Files it writes
More from Unlumen Ui
All 233 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Chatai-chat | Unlumen Ui | Components | Paid | 2 deps | |
| Vercel Animate Countanimate-count | Unlumen Ui | Components | Free | 1 dep | |
| Animate Digitsanimate-digits | Unlumen Ui | Components | Free | 1 dep | |
| Animated Inputanimate-text-input-typing | Unlumen Ui | Components | Paid | 1 dep | |
| Animated Listanimated-list | Unlumen Ui | Components | Free | 1 dep | |
| Apple Switchapple-switch | Unlumen Ui | Components | Free | 1 dep | |
| Aurora Barsaurora-bars | Unlumen Ui | Components | Free | 1 dep | |
| Aurora Bluraurora-blur | Unlumen Ui | Components | Free | 2 deps |
