# beUI > Animated components for React, Next.js and React Native. Index: https://beui.dev/llms.txt --- title: "Motion Guides" description: "Practical guidance for purposeful animation, timing, easing, springs, and accessible motion in React interfaces." documentation: "https://beui.dev/docs/motion-patterns" markdown: "https://beui.dev/docs/motion-patterns.md" --- # Motion Guides > Practical guidance for purposeful animation, timing, easing, springs, and accessible motion in React interfaces. ## Decision framework Ask four questions before choosing a duration or spring: 1. **Check frequency.** Repeated actions should feel nearly instant. Save expressive motion for rare moments. 2. **Name the purpose.** Motion should explain space, confirm input, show state, or soften a change. 3. **Choose the physics.** Use ease-out for entrances, ease-in-out for movement, linear motion for progress, and springs for gestures. 4. **Design the fallback.** Reduced motion should keep useful opacity and color feedback while removing travel, scale, parallax, and overshoot. ## Motion tokens - `EASE_OUT`: entrances and exits that respond immediately, then settle quietly. - `EASE_IN_OUT`: objects already on screen moving between positions. - `SPRING_PRESS`: fast, weighted feedback for pressable surfaces. - `SPRING_LAYOUT`: shared surfaces and indicators that preserve spatial continuity. ## Timing | Interaction | Range | Desired feel | | --- | --- | --- | | Press feedback | 100–160ms | Immediate and physical | | Tooltip or popover | 125–200ms | Quick and origin-aware | | Dropdown or select | 150–250ms | Responsive, with no waiting | | Modal or drawer | 200–500ms | Enough time to explain space | | Marketing demo | Flexible | Clarity matters more than speed | Under 300ms is the default for interface motion. Longer motion belongs to explanatory demos, deliberate gestures, and large spatial changes. ## Recipes ### Press feedback Confirm input before the action finishes. Keep the scale change small and the response immediate. ```tsx const reduce = useReducedMotion(); Continue ``` ### Semantic icon motion Let an icon imitate its real action. Gate decorative hover motion behind pointer capability and reduced-motion preferences. ### Content reveal Reveal one meaningful surface with a short lift and restrained blur. Finish before the surface becomes the focus. ### Layout continuity Keep the same surface visible while its footprint changes. Move the shape first, then introduce its label. ### Content swap For small view changes, let old content leave faster than new content arrives. Keep travel to a few pixels. ## Accessibility Reduced motion is a designed state. Preserve opacity, color, and instant state changes. Remove parallax, large transforms, repeated scale, and spring overshoot. ```tsx const reduce = useReducedMotion(); const hidden = { opacity: 0, transform: reduce ? "none" : "translateY(8px)", }; const visible = { opacity: 1, transform: "translateY(0px)", }; ``` --- --- title: "Agent Guide" description: "Install the beUI agent skill, connect the MCP server, or consume the agent-friendly registry endpoints directly." documentation: "https://beui.dev/docs/ai-agents" markdown: "https://beui.dev/docs/ai-agents.md" --- # Agent Guide > Install the beUI agent skill, connect the MCP server, or consume the agent-friendly registry endpoints directly. ## Agent skill Install the skill when you want coding agents to choose existing beUI components before inventing custom motion widgets. ```bash npx skills add starc007/ui-components --skill beui ``` ## MCP server Connect the hosted beUI MCP server at `https://mcp.beui.dev/mcp`. ```bash # Claude Code claude mcp add --transport http beui https://mcp.beui.dev/mcp # Codex codex mcp add beui --url https://mcp.beui.dev/mcp # Amp amp mcp add beui https://mcp.beui.dev/mcp # Gemini CLI gemini mcp add --transport http beui https://mcp.beui.dev/mcp ``` One click: [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=beui&config=eyJ1cmwiOiJodHRwczovL21jcC5iZXVpLmRldi9tY3AifQ%3D%3D) or [Add to VS Code](vscode:mcp/install?%7B%22name%22%3A%22beui%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.beui.dev%2Fmcp%22%7D). Manual configuration: ```json { "mcpServers": { "beui": { "type": "http", "url": "https://mcp.beui.dev/mcp" } } } ``` Windsurf names the field `serverUrl` instead of `url`, in `~/.codeium/windsurf/mcp_config.json`: ```json { "mcpServers": { "beui": { "serverUrl": "https://mcp.beui.dev/mcp" } } } ``` Available tools: `get_setup` (one-time project setup and theme tokens), `list_components`, `search_components`, `get_component_docs` (props, types and usage as Markdown), `get_component` (source files), and `get_install_command` (checks the slug). For React Native apps, `list_native_components` and `get_native_component` return beUI Native components with every file to copy. ## WebMCP Agents working in a browser tab can call beUI's tools instead of reading the page. Where the browser supports [WebMCP](https://webmachinelearning.github.io/webmcp/), a W3C Community Group draft that Chrome and Edge are testing, every page on beui.dev registers 4 read-only tools on `document.modelContext`. Other browsers load nothing extra. | Tool | Returns | | --- | --- | | `search_components` | Components matching a query, with install slugs and doc links | | `get_component_docs` | One component's docs as Markdown, by page or install slug | | `get_install_command` | The shadcn command for npm, pnpm, yarn or bun | | `read_page` | The open page as Markdown | Each returns JSON with `ok` and either `data` or an `error` with a code and a hint. For agents that only fetch: every page links its Markdown version, and the home page's Link header points to `/llms.txt`, the API catalog at `/.well-known/api-catalog` and the agent skill index at `/.well-known/agent-skills/index.json`. ## Endpoints | Endpoint | Purpose | | --- | --- | | `/llms.txt` | Markdown discovery index | | `/r` | JSON catalogue of every component | | `/r/{slug}` | Component detail with files, dependencies, and source | | `/registry.json` | shadcn directory-compatible catalogue | | `/r/{slug}.json` | shadcn install item with inline file content | | `/r/{slug}/raw` | Copy-ready plain-text source | | `/components/{category}/{slug}.md` | Component documentation as Markdown | | `/native/r` | JSON catalogue of beUI Native (React Native) components | | `/native/r/{slug}` | Native component detail with install commands and every file | ## Agent flow 1. Fetch `https://beui.dev/r` to discover components. 2. Select the closest item by its published name and description. 3. Fetch `https://beui.dev/r/{slug}` for source, files, and dependencies. 4. Write every returned file to its declared path. 5. Install the external dependencies from the response. ## shadcn flow ```bash # Official registry namespace npx shadcn@latest add @beui/animated-toast-stack # Direct registry URL npx shadcn@latest add https://beui.dev/r/animated-toast-stack.json ``` ## Entry shape Registry entries include the component slug, name, description, category, documentation URLs, package dependencies, internal helpers, and every source file required by the install. ## Generative UI To let a model compose beUI components into a live interface, follow the [OpenUI integration guide](https://beui.dev/docs/openui.md). --- --- title: "Use beUI with OpenUI" description: "Register beUI components with OpenUI, generate the system prompt, stream OpenUI Lang, and render interactive UI." documentation: "https://beui.dev/docs/openui" markdown: "https://beui.dev/docs/openui.md" --- # Use beUI with OpenUI > Register beUI components with OpenUI, generate the system prompt, stream OpenUI Lang, and render interactive UI. OpenUI lets a model emit an abstract UI tree instead of Markdown. Its React runtime maps every node to a component you register, so generated responses use only the beUI components you allow. ## Install ```bash npm install @openuidev/react-lang @openuidev/lang-core zod npm install openai npx shadcn@latest add @beui/button-base @beui/animated-badge @beui/animated-number ``` ## Register components Use `defineComponent` to map an OpenUI Lang node to a beUI component. The Zod schema validates streamed model output, while the description teaches the model when to use the component. ```tsx import { defineComponent, useTriggerAction } from "@openuidev/react-lang"; import { z } from "zod/v4"; import { Button } from "@/components/motion/button"; const BeButton = defineComponent({ name: "Button", description: "Spring-pressed action button.", props: z.object({ label: z.string(), action: z.string(), }), component: ({ props }) => { const triggerAction = useTriggerAction(); return ( ); }, }); ``` ## Assemble the library `createLibrary` collects the definitions, names the root node, and groups components with prompt guidance. ```tsx import { createLibrary } from "@openuidev/react-lang"; export const beuiLibrary = createLibrary({ root: "Stack", components: [Stack, BeButton, BeBadge, BeStat], }); ``` ## Generate the prompt Generate a serializable library specification whenever the component library changes: ```bash npx @openuidev/cli@latest generate \ --spec ./lib/beui-library.tsx \ --out ./lib/generated/beui-library.spec.json ``` Pass that specification to `generateSystemPrompt` in the server route, then stream the model's OpenUI Lang response to the browser. ## Render the stream ```tsx onSend(event.humanFriendlyMessage)} /> ``` ## Why beUI fits beUI components own their files and ship through a shadcn-compatible registry. Generated interfaces inherit the host application's semantic color tokens and use real React controls. ## Resources - [OpenUI](https://www.openui.com) - [Defining components](https://www.openui.com/docs/openui-lang/defining-components) - [shadcn chat example](https://www.openui.com/docs/openui-lang/examples/shadcn-chat) --- --- title: "Theme setup" description: "Set up the theme tokens beUI components use, once per project: with shadcn, or by pasting the theme CSS." documentation: "https://beui.dev/docs/theme" markdown: "https://beui.dev/docs/theme.md" --- # Theme setup > Set up the theme tokens beUI components use, once per project: with shadcn, or by pasting the theme CSS. beUI components are styled with Tailwind CSS v4 and semantic tokens (`bg-background`, `text-muted-foreground`, `border-border`), the same ones shadcn uses, plus a few of beUI's own. Set them up once per project. ## Option 1: shadcn (recommended) A shadcn project already has the base tokens. beUI adds `border-strong`, `success`, `warning` and `neon` colors, the `glass`, `glass-strong`, `glass-thin`, `press`, `scrollbar-hide` and mask utilities, the ease curves and the marquee and shimmer animations. Every component that uses them lists the theme item as a registry dependency, so `npx shadcn@latest add @beui/` installs them with it. To add them up front, run this once. It adds to your theme and changes no existing color: ```bash npx shadcn@latest add https://beui.dev/r/theme.json ``` ## Option 2: paste the theme CSS Not using shadcn? Paste this into `globals.css` directly below `@import "tailwindcss";`. It defines the base tokens, beUI's tokens, the animations and the utilities. Also available at https://beui.dev/theme.css. ```css @custom-variant dark (&:where(.dark, .dark *)); :root { /* Base palette */ --background: oklch(99% 0 0); --foreground: oklch(15% 0 0); --card: oklch(97% 0 0); --muted-foreground: oklch(50% 0 0); --border: oklch(15% 0 0 / 0.06); /* beUI extensions */ --border-strong: oklch(15% 0 0 / 0.12); --accent-fg: oklch(15% 0 0); --neon: oklch(80% 0.22 145); --danger: oklch(62% 0.22 25); --success: oklch(70% 0.18 155); --warning: oklch(78% 0.18 75); --glass-bg: oklch(99% 0 0 / 0.55); --glass-border: oklch(15% 0 0 / 0.08); --glass-strong-bg: rgb(255 255 255 / 0.7); --glass-thin-bg: rgb(255 255 255 / 0.45); /* shadcn semantic tokens */ --card-foreground: var(--foreground); --popover: var(--card); --popover-foreground: var(--foreground); --primary: #171717; --primary-foreground: #fafafa; --secondary: var(--card); --secondary-foreground: var(--foreground); --muted: var(--card); --accent: oklch(72% 0.18 195); --accent-foreground: var(--accent-fg); --destructive: var(--danger); --input: var(--border); --ring: var(--border-strong); } .dark { --background: #151515; --foreground: oklch(96% 0 0); --card: #1c1c1c; --muted-foreground: oklch(62% 0 0); --border: rgb(255 255 255 / 0.05); --border-strong: rgb(255 255 255 / 0.1); --accent: oklch(80% 0.18 195); --accent-fg: #151515; --primary: #f5f5f5; --primary-foreground: #151515; --glass-bg: rgb(28 28 28 / 0.55); --glass-border: rgb(255 255 255 / 0.08); --glass-strong-bg: rgb(28 28 28 / 0.6); --glass-thin-bg: rgb(21 21 21 / 0.45); } @theme inline { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1); --color-border: var(--border); --color-border-strong: var(--border-strong); --color-neon: var(--neon); --color-success: var(--success); --color-warning: var(--warning); --color-background: var(--background); --color-foreground: var(--foreground); --color-card: var(--card); --color-card-foreground: var(--card-foreground); --color-popover: var(--popover); --color-popover-foreground: var(--popover-foreground); --color-primary: var(--primary); --color-primary-foreground: var(--primary-foreground); --color-secondary: var(--secondary); --color-secondary-foreground: var(--secondary-foreground); --color-muted: var(--muted); --color-muted-foreground: var(--muted-foreground); --color-accent: var(--accent); --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-input: var(--input); --color-ring: var(--ring); } @theme { --animate-marquee: marquee 30s linear infinite; --animate-marquee-vertical: marquee-vertical 30s linear infinite; --animate-shimmer: shimmer 2.5s linear infinite; @keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-100% - var(--gap, 1rem))); } } @keyframes marquee-vertical { from { transform: translateY(0); } to { transform: translateY(calc(-100% - var(--gap, 1rem))); } } @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } } } @layer utilities { .scrollbar-hide::-webkit-scrollbar { display: none; } .scrollbar-hide { scrollbar-width: none; } .mask-radial-fade { mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%); } .mask-b-fade { mask-image: linear-gradient(to bottom, black 60%, transparent); } .glass { background: var(--glass-bg); backdrop-filter: blur(20px) saturate(160%); border: 1px solid var(--glass-border); box-shadow: 0 1px 0 0 rgb(255 255 255 / 0.06) inset, 0 24px 60px -24px rgb(0 0 0 / 0.45); } .glass-strong { background: var(--glass-strong-bg); backdrop-filter: blur(16px); } .glass-thin { background: var(--glass-thin-bg); backdrop-filter: blur(12px); border: 1px solid var(--glass-border); } .press { transition: transform 120ms var(--ease-out); } .press:active { transform: scale(0.97); } } ``` ## Make it yours Change the token values to match your brand, or build a palette on the [themes page](https://beui.dev/themes) and copy its CSS. Components read the tokens, so every component follows. --- --- title: "Set up beUI Native" description: "One-time setup for beUI Native: install Reanimated, Gesture Handler and Uniwind, configure Metro, add the theme tokens, then copy in any component." documentation: "https://beui.dev/docs/native-setup" markdown: "https://beui.dev/docs/native-setup.md" --- # Set up beUI Native > One-time setup for beUI Native: install Reanimated, Gesture Handler and Uniwind, configure Metro, add the theme tokens, then copy in any component. beUI Native components are plain source you copy into your app. Do this setup once per app; after that, adding a component is copying its files. It works in Expo and in bare React Native. ## Requirements | Library | Tested with | | --- | --- | | [Expo SDK, React Native](https://docs.expo.dev) | 57, 0.86 with React 19 | | [Reanimated and Worklets](https://docs.swmansion.com/react-native-reanimated/) | 4.5 and 0.10 | | [Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/) | 2.32 | | [Uniwind with Tailwind CSS](https://docs.uniwind.dev) | 1.12 with 4.3 | ## 1. Install the libraries ```bash npx expo install react-native-reanimated react-native-worklets react-native-gesture-handler npm install uniwind tailwindcss ``` Expo's Babel preset already includes the Worklets plugin that Reanimated 4 needs. In a bare React Native app, add it to `babel.config.js`: ```js module.exports = { presets: ["module:@react-native/babel-preset"], // Reanimated 4 runs animations as worklets. Keep this plugin last. plugins: ["react-native-worklets/plugin"], }; ``` ## 2. Set up Uniwind Create `global.css` in the project root: ```css @import "tailwindcss"; @import "uniwind"; @import "./src/styles/theme.css"; ``` Point Metro at it. `withUniwindConfig` must be the outermost wrapper, and `cssEntryFile` must be a relative path. ```js const { getDefaultConfig } = require("expo/metro-config"); const { withUniwindConfig } = require("uniwind/metro"); const config = getDefaultConfig(__dirname); // Uniwind must be the outermost wrapper. module.exports = withUniwindConfig(config, { cssEntryFile: "./global.css", dtsFile: "./src/uniwind-types.d.ts", }); ``` In a bare React Native app, the default config comes from `@react-native/metro-config`: ```js const { getDefaultConfig } = require("@react-native/metro-config"); const { withUniwindConfig } = require("uniwind/metro"); const config = getDefaultConfig(__dirname); // Uniwind must be the outermost wrapper. module.exports = withUniwindConfig(config, { cssEntryFile: "./global.css", dtsFile: "./src/uniwind-types.d.ts", }); ``` Uniwind writes the class name types to `dtsFile` when Metro starts. If TypeScript can't find the `global.css` import, declare CSS files in `src/env.d.ts`: ```ts declare module "*.css"; ``` ## 3. Add the theme tokens Components use semantic colors defined for light and dark mode. Save this as `src/styles/theme.css` and change the values to match your brand: ```css /* Matches the default beUI palette in ui-components/lib/themes.ts. Native surface maps to card; muted maps to muted-foreground. */ @layer theme { :root { @variant light { --color-background: oklch(99% 0 0); --color-surface: oklch(97% 0 0); --color-foreground: oklch(15% 0 0); --color-muted: oklch(50% 0 0); --color-border: oklch(15% 0 0 / 0.06); --color-border-strong: oklch(15% 0 0 / 0.16); --color-primary: #0285f7; --color-on-primary: #ffffff; --color-destructive: #dc2626; --color-success: #059669; --color-warning: #d97706; } } :root { @variant dark { --color-background: #151515; --color-surface: #1c1c1c; --color-foreground: oklch(96% 0 0); --color-muted: oklch(62% 0 0); --color-border: rgb(255 255 255 / 0.05); --color-border-strong: rgb(255 255 255 / 0.14); --color-primary: #0285f7; --color-on-primary: #ffffff; --color-destructive: #f87171; --color-success: #34d399; --color-warning: #fbbf24; } } /* Tailwind's default monospace stack isn't a font React Native can load. */ :root { @variant ios { --font-mono: Menlo; } } :root { @variant android { --font-mono: monospace; } } } ``` ## 4. Wrap your app Import `global.css` from the root component, not from the file that registers the app. Wrap the app in `GestureHandlerRootView`. With Expo Router: ```tsx import "../global.css"; import { Stack } from "expo-router"; import { GestureHandlerRootView } from "react-native-gesture-handler"; export default function RootLayout() { return ( ); } ``` In a bare app, do the same in `App.tsx`. For forms, also wrap the app in `KeyboardProvider` from [react-native-keyboard-controller](https://docs.expo.dev/versions/v57.0.0/sdk/keyboard-controller/). ## 5. Add a component Run the beUI Native CLI from the app's root. It copies the component and the shared files it needs into `src/` and installs any missing libraries: ```bash npx beui-native add tabs ``` To copy by hand instead, each component lists its libraries, its files and the shared files it needs, on its page at `https://beui.dev/react-native/{slug}` and at `https://beui.dev/native/r/{slug}`. Keep the folder layout, since components import shared files by relative path. Tabs, for example: ```text global.css metro.config.js src/ components/ tabs/ index.ts tabs.tsx hooks/ use-reduced-motion.ts primitives/ render-icon.tsx styles/ motion.ts theme.css ``` ```tsx import { Text } from "react-native"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "../src/components/tabs"; export default function Screen() { return ( Overview Activity High-level summary. Recent events. ); } ``` Tailwind finds class names under the folder that holds `global.css`. If it lives elsewhere, like `app/`, add an `@source` for the components: ```css @import "tailwindcss"; @import "uniwind"; @import "../src/styles/theme.css"; /* This file is in app/, so the components in src/ need an explicit source. */ @source "../src"; ``` ## Try before you copy Every React Native component page (https://beui.dev/react-native) has a recording in light and dark. Agents can fetch components from https://beui.dev/native/r or the beUI MCP server. Every component follows the system Reduce Motion setting and takes a `disableAnimation` prop. Source: https://github.com/starc007/beui-native --- # How to build animated tabs with a sliding indicator in Framer Motion URL: https://beui.dev/guides/framer-motion-animated-tabs Updated: 2026-10-18 A sliding tab indicator is one of the most common Framer Motion patterns, and it takes surprisingly little code once you know about layoutId. This guide builds the technique from scratch, explains the details that make it feel right, and then shows the beUI Tabs component, which packages the same idea with overflow scrolling, icons and three visual styles. ## How does a layoutId tab indicator work? Render the indicator only inside the selected tab and give it the same layoutId everywhere. When the selection changes, the old indicator unmounts and a new one mounts inside a different button. Because both share a layoutId, Framer Motion treats them as one element: it measures where the new box is, starts it at the old box's position and size, and animates the difference with transforms. That means you never calculate offsets or widths yourself. The indicator can be absolutely positioned to fill its button, and tabs of any width work, because the animation is measured from the real layout on every change. ## A sliding tabs component from scratch The snippet below is a complete, working version. The indicator sits behind the label, which gets relative z-10 so the text stays on top. A spring transition gives the slide a natural settle. - Use a unique layoutId per tab bar (useId works). Two bars sharing a string id would pass one indicator between them. - Put borderRadius in style, not only in a class. Framer Motion animates layout with scale, and it can only counter-correct corner radius values it knows about. - Pick a spring that settles without much overshoot. A bouncy indicator in a scrollable list can briefly push past the edge and flash a scrollbar. ```tsx "use client"; import { motion } from "motion/react"; import { useId, useState } from "react"; const tabs = ["Overview", "Activity", "Settings"]; export function SlidingTabs() { const [active, setActive] = useState(tabs[0]); // A unique id per instance, so two tab bars on one page never share an indicator. const indicatorId = useId(); return (
{tabs.map((tab) => ( ))}
); } ``` ## Install the beUI Tabs component If you want the pattern ready-made, beUI ships Tabs as copy-paste source through the shadcn CLI. The command adds the file to components/motion/tabs.tsx along with the small helpers it imports, so you own and can edit the code. ```bash npx shadcn@latest add @beui/tabs ``` ## Using Tabs, TabsList, TabsTrigger and TabsContent The API is composable: Tabs holds the value, TabsList renders the tablist, TabsTrigger renders each tab and TabsContent shows the matching panel. The variant prop switches between pill, segment and underline styles, and icons="selected" springs a trigger's icon open only on the selected tab. For controlled state, pass value and onValueChange instead of defaultValue. When the triggers do not fit, TabsList fades the edges and adds scroll buttons, and it scrolls the selected tab into view. ```tsx import { BarChart3, Bell, Home } from "lucide-react"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/motion/tabs"; export function DashboardTabs() { return ( }>Home }>Stats }>Alerts Your summary. Charts and numbers. Recent notifications. ); } ``` ## Controlled tabs for filters and date ranges Segment tabs work well as a compact switch for a chart range or a list filter. Keep the value in your own state and read it wherever you fetch or filter data. TabsTrigger also accepts indicatorClassName if you want a different indicator color for one bar. ```tsx "use client"; import { useState } from "react"; import { Tabs, TabsList, TabsTrigger } from "@/components/motion/tabs"; export function RangeTabs() { const [range, setRange] = useState("week"); return ( Day Week Month ); } ``` ## Accessibility and reduced motion for animated tabs Each beUI trigger is a native button with role tab and aria-selected, so it is focusable and clickable with the keyboard by default. Inactive TabsContent panels stay in the DOM with the hidden attribute, which keeps their text in server-rendered HTML without exposing it to screen readers. Arrow keys move between enabled tabs and Home and End jump to the ends, and each tab points at its panel with aria-controls while the panel has the tabpanel role labelled by its tab, which covers the WAI-ARIA tabs pattern. When the user has reduced motion enabled, Tabs sets its transitions to zero duration through MotionConfig: the indicator jumps to the new tab instead of sliding, and panels fade in without the small vertical offset. In your own from-scratch version, you can get similar behavior by wrapping the app in MotionConfig with reducedMotion="user", or by reading useReducedMotion and swapping the transition. ## Components - [Tabs](https://beui.dev/components/motion/tabs): Pill, segment or underline tabs with a spring layoutId indicator and optional icons. - [Expandable Tabs](https://beui.dev/components/blocks/expandable-tabs): Icon tab bar where the active tab expands to a labelled pill, with a panel above that morphs height and slides content direction-aware on switch. - [Morphing Tabs](https://beui.dev/components/blocks/morphing-tabs): Reorderable tabs whose selected item grows into a white content surface, with the active shape gliding as tabs move and a shared morph between rooms. - [Shared Layout Background](https://beui.dev/components/motion/shared-layout-bg): A pill that glides between hovered items via motion's shared layout, with blur enter/exit. ## FAQ ### What is layoutId in Framer Motion? layoutId links two motion elements across renders. When one with a given layoutId unmounts and another with the same id mounts, Framer Motion animates from the old element's position and size to the new one, which is exactly what a sliding tab indicator needs. ### Why does my tab indicator stretch or have squashed corners? Layout animations use scale transforms. Set borderRadius in the style prop so Framer Motion can correct it during the animation, and keep text out of the scaled element; put the label in a sibling span above the indicator. ### Why does the indicator jump between two tab bars on the same page? They share the same layoutId string. Give each bar its own id, for example from useId, or wrap each bar in its own LayoutGroup with a distinct id. ### Do I need the motion package or framer-motion? beUI imports from motion/react, the current package name for Framer Motion. The shadcn CLI installs it for you when you add the Tabs component. ### Is the beUI Tabs component free? Yes. beUI is free and open source under the MIT license, and you install the source into your own project, so you can change it however you like. --- # How to build an iPhone Dynamic Island in React URL: https://beui.dev/guides/dynamic-island-react Updated: 2026-10-18 The Dynamic Island feels alive because three things happen together: the black pill springs to the exact size of its new content, the old content gets pulled back into the pill, and the new content unfurls out of it. This guide builds each piece with Framer Motion, then shows the beUI DynamicIsland block that does the same with a small, controlled API. ## Measure the content, then spring the shell to it The pill cannot animate to width auto, so you measure the content and animate to real numbers. Wrap the content in an element sized with w-max so it takes its natural width, read offsetWidth and offsetHeight in a layout effect before the first paint, and keep reading with a ResizeObserver as views change. Animate the shell's width and height rather than scaling it. A scale transform would squash the text and icons inside, while a real resize keeps them crisp. It is a layout animation, so keep it on this one small element. A constant border radius of 32px does the shape change for free: browsers clamp the radius to half the height, so the shell reads as a pill when compact and a rounded rectangle when expanded. ## Cross-fade views with AnimatePresence popLayout Key each view and render it inside AnimatePresence with mode="popLayout". That mode pops the exiting view out of the layout immediately, so the measured size reflects only the incoming view and the shell starts resizing right away. Make the exit short and blur-free so it disappears before the shrinking shell clips it, and anchor the transform origin to the top so content unfurls downward like it does under a notch. ```tsx "use client"; import { AnimatePresence, motion } from "motion/react"; import { useLayoutEffect, useRef, useState, type ReactNode } from "react"; function useMeasure() { const ref = useRef(null); const [size, setSize] = useState<{ width: number; height: number } | null>(null); // Measure before paint, then keep measuring as the content changes. useLayoutEffect(() => { const el = ref.current; if (!el) return; const update = () => setSize({ width: el.offsetWidth, height: el.offsetHeight }); update(); const observer = new ResizeObserver(update); observer.observe(el); return () => observer.disconnect(); }, []); return [ref, size] as const; } export function Island({ viewKey, children }: { viewKey: string; children: ReactNode }) { const [ref, size] = useMeasure(); return ( {/* w-max keeps this wrapper at the natural size of the current view. */}
{children}
); } ``` ## Install the beUI Dynamic Island block beUI ships this pattern as a block you install as source with the shadcn CLI. It lands at components/motion/dynamic-island.tsx, and Framer Motion is added as a dependency if your project does not have it yet. ```bash npx shadcn@latest add @beui/dynamic-island ``` ## Using DynamicIsland and DynamicIslandView DynamicIsland is controlled by a single view prop. Pass null to show the compact pill with whatever you put in compact, or pass a view id to expand into the DynamicIslandView with that id. Views are plain children, so a call, a timer and a now-playing card can all live side by side and only the active one renders. Put the island in a top-aligned container with room below it, so expansion reads as unfurling downward rather than pushing content around. ```tsx "use client"; import { Phone, PhoneOff } from "lucide-react"; import { useState } from "react"; import { DynamicIsland, DynamicIslandView } from "@/components/motion/dynamic-island"; type View = "call" | "music" | null; export function CallIsland() { const [view, setView] = useState(null); return (
9:41} > Incoming call Now playing
); } ``` ## Accessibility and reduced motion for a Dynamic Island The beUI shell renders with role status and aria-live polite, so screen readers announce new content when the view changes without interrupting the user. Keep view content short so announcements stay useful, and give icon-only buttons an aria-label, as the Decline and Accept buttons do above. With reduced motion enabled, the shell resize runs with zero duration and the views cross-fade with opacity only, dropping the scale, slide and blur. If you build your own, read useReducedMotion and swap the transitions the same way, because the CSS prefers-reduced-motion media query cannot stop a JavaScript spring. ## Components - [Dynamic Island](https://beui.dev/components/blocks/dynamic-island): iOS-style island pill that morphs between live activity views with bouncy shell resize and blur crossfades. - [Notification Stack](https://beui.dev/components/blocks/notification-stack): Compact notification cards that spring from a stacked summary into a readable list on hover, focus or tap. - [Animated Toast Stack](https://beui.dev/components/motion/animated-toast-stack): Toasts in one morphing island: a pill that springs into a card, opens into a list on hover, and swipes away. ## FAQ ### Why not animate scale for the Dynamic Island resize? Scaling the shell would also scale everything inside it, so text and icons would stretch mid-animation. Animating real width and height on one small element keeps the content sharp. ### How do I animate to height auto in Framer Motion? Measure the content with a ref and ResizeObserver and animate to the measured pixel values. Wrapping the content in a w-max element lets you read its natural width as well as its height. ### What does AnimatePresence mode popLayout do? It removes the exiting element from the layout flow as soon as it starts leaving, so siblings and measured containers respond to the new content immediately instead of waiting for the exit to finish. ### Can the beUI Dynamic Island hold buttons? Yes. DynamicIslandView children are ordinary React nodes, so you can render buttons, timers or media controls. The preview on beUI uses a NumberTicker for a countdown and buttons for call actions. ### Is there a React Native version? beUI Native publishes React Native components separately at /react-native. Check that list for the components currently available there. --- # How to add an animated shader background to a Next.js hero URL: https://beui.dev/guides/shader-background-nextjs Updated: 2026-10-18 A moving mesh gradient or grain shader can give a landing page hero real depth, but it is easy to end up with unreadable text, a busy GPU or a background that ignores motion preferences. This guide covers the parts that matter in Next.js, using the beUI ShaderBackground component, which wraps the Paper Design shaders behind one typed variant prop. ## Install the beUI Shader Background Add the component with the shadcn CLI. It installs the source to components/motion/shader-background.tsx and adds its dependencies, @paper-design/shaders-react and Framer Motion, to your package.json. ```bash npx shadcn@latest add @beui/shader-background ``` ## Where does the client component boundary go? WebGL needs the browser, so the shader file starts with "use client". You do not need to make your page a client component to use it. A Server Component page can render ShaderBackground directly as long as the props are serializable, and colors as hex strings and numeric settings all are. Keep your headline and copy in the server-rendered part of the page so they are in the initial HTML. ShaderBackground takes a variant such as mesh-gradient, grain-gradient, warp, waves, voronoi or dot-orbit, plus the props that variant accepts. The types are a discriminated union, so your editor only suggests the props that belong to the variant you picked. ## Position the shader behind the hero content Make the section relative and isolate, then place the shader in an absolutely positioned layer with inset-0 and a negative z-index. The isolate class creates a stacking context, so the negative z-index stays inside the section instead of slipping behind the page background. ShaderBackground fills its parent with h-full w-full, so the wrapper decides its size. Mark the wrapper aria-hidden because the shader is decorative and has nothing for assistive technology to read. ```tsx import { ShaderBackground } from "@/components/motion/shader-background"; export default function Page() { return (
{/* Decorative layer: behind the content and hidden from assistive tech. */}
); } ``` ## Keep text readable over a moving gradient A gradient that animates will pass through light and dark areas, so contrast that works on one frame can fail on the next. Check your text against the lightest and darkest colors in the palette, not just the average. The simplest fix is a semi-transparent scrim between the shader and the text, like the bg-black/45 layer above. Choosing a palette that stays within one lightness range, keeping speed low and using larger, heavier type for the headline all help as well. ## Shader background performance tips The cost of a fragment shader scales with the number of pixels it draws every frame. The underlying Paper Design mount accepts maxPixelCount and minPixelRatio, and ShaderBackground passes them through, so you can cap the drawing buffer for a full-bleed hero. Its animation loop also pauses while the browser tab is hidden. A few more habits keep it light: use one shader per page rather than several, prefer lower speed values, and for sections far down the page consider a static variant such as static-mesh-gradient or static-radial-gradient, which renders a gradient without animating it. ```tsx ``` ## Reduced motion for shader backgrounds ShaderBackground reads useReducedMotion from Framer Motion and sets speed to 0 when the user prefers reduced motion, so the gradient freezes on a still frame instead of disappearing. This applies to every animated variant, whether or not you pass speed yourself. Freezing keeps the visual design intact for everyone while removing continuous movement, which can be uncomfortable for people with vestibular disorders. ## Components - [Shader Background](https://beui.dev/components/motion/shader-background): Canvas shader backgrounds (mesh gradient, grain, warp, waves, voronoi, dot orbit and more) with a single typed variant prop. Reduced-motion freezes animated variants. - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. - [Marquee](https://beui.dev/components/motion/marquee): Infinite horizontal or vertical scroll with pause-on-hover. ## FAQ ### Can I use a WebGL shader background in a Next.js Server Component? The shader itself is a client component, but you can render it from a Server Component page and pass serializable props like color strings and numbers. Your text stays server-rendered. ### How do I make a mesh gradient background in React? Install the beUI Shader Background and render it with variant="mesh-gradient", a colors array of hex values, and optional distortion, swirl and speed props. ### Does the shader background respect prefers-reduced-motion? Yes. The component sets speed to 0 on every animated variant for users who prefer reduced motion, which freezes the shader on a still frame. ### Why is my shader background on top of my text? The shader layer needs a lower stacking order than the content. Put it in an absolute inset-0 wrapper with -z-10 and add isolate to the section so the negative z-index stays contained. ### Will an animated shader slow down my page? It uses the GPU on every frame, so cost grows with screen size. Cap the drawing buffer with maxPixelCount, keep one shader per page and use a static variant where motion adds little. --- # How to build a collapsible animated sidebar in Next.js URL: https://beui.dev/guides/animated-sidebar-nextjs Updated: 2026-10-18 An application sidebar has more moving parts than it looks: desktop and mobile states, a collapsed icon rail, a toggle that works from anywhere, and focus handling when it becomes a sheet on small screens. This guide walks through each part using the beUI Animated Sidebar, which follows the same provider and composition model as the shadcn sidebar and adds Framer Motion transitions. ## Install the beUI Animated Sidebar Add the component with the shadcn CLI. It installs components/motion/animated-sidebar.tsx and the files it imports, including the shared layout highlight used for the active row. ```bash npx shadcn@latest add @beui/animated-sidebar ``` ## How is the sidebar composed? AnimatedSidebarProvider owns the state: whether the desktop sidebar is open, whether the mobile sheet is open, and whether the viewport is mobile. AnimatedSidebar renders the panel, and AnimatedSidebarInset is the main content area next to it. Inside the panel you compose AnimatedSidebarHeader, AnimatedSidebarContent, AnimatedSidebarGroup with its label and content, AnimatedSidebarMenu, AnimatedSidebarMenuItem and AnimatedSidebarMenuButton, then an optional AnimatedSidebarFooter. Any component below the provider can call useAnimatedSidebar to read state, open, isMobile or call toggleSidebar, which is how AnimatedSidebarTrigger works. ```tsx "use client"; import { Home, Inbox, PanelLeft, Settings } from "lucide-react"; import { usePathname } from "next/navigation"; import type { ReactNode } from "react"; import { AnimatedSidebar, AnimatedSidebarContent, AnimatedSidebarGroup, AnimatedSidebarGroupContent, AnimatedSidebarGroupLabel, AnimatedSidebarHeader, AnimatedSidebarInset, AnimatedSidebarMenu, AnimatedSidebarMenuButton, AnimatedSidebarMenuItem, AnimatedSidebarProvider, AnimatedSidebarRail, AnimatedSidebarTrigger, } from "@/components/motion/animated-sidebar"; const links = [ { href: "/", label: "Home", icon: Home }, { href: "/inbox", label: "Inbox", icon: Inbox }, { href: "/settings", label: "Settings", icon: Settings }, ]; export function AppShell({ children }: { children: ReactNode }) { const pathname = usePathname(); return ( Acme Workspace {links.map(({ href, label, icon: Icon }) => ( } > {label} ))}
{children}
); } ``` ## Add the sidebar to a Next.js App Router layout The shell above is a client component because it reads usePathname to mark the active link and passes icons and handlers to the menu. Your layout can stay a Server Component and simply wrap its children in the shell, so the pages inside still render on the server. AnimatedSidebarMenuButton renders a plain anchor when you pass href. For client-side navigation without a full page load, omit href and call router.push from onSelect instead, keeping in mind that a button does not support opening in a new tab. ```tsx import type { ReactNode } from "react"; import { AppShell } from "@/components/app-shell"; export default function AppLayout({ children }: { children: ReactNode }) { return {children}; } ``` ## Icon rail vs offcanvas: choosing a collapse mode The collapsible prop on AnimatedSidebar decides what closing does on desktop. With icon, the default, the panel springs down to a narrow rail: labels fade out, icons stay, and each button gets the label as its accessible name and title. With offcanvas, the panel slides fully out of view and the inset content takes the whole width. With none, the sidebar stays open. Widths come from CSS variables on the provider: --sidebar-width (16rem), --sidebar-width-icon (4.25rem) and --sidebar-width-mobile (18rem). Override them through the provider's style prop. AnimatedSidebar also takes side (left or right) and variant (sidebar, floating or inset). - Pass open, defaultOpen and onOpenChange to the provider to control or persist the desktop state, for example in a cookie. - Use AnimatedSidebarMenuSub with AnimatedSidebarMenuSubItem and AnimatedSidebarMenuSubButton for nested items. Selecting a group from the icon rail expands the panel so its children are reachable. - AnimatedSidebarRail adds a thin edge you can click to toggle the panel. ```tsx } ariaExpanded={open} onSelect={() => setOpen((value) => !value)} > Opportunities Pipeline ``` ## Mobile sheet and keyboard shortcut Below 768px the same AnimatedSidebar renders as a sheet in a portal on document.body: a dialog with aria-modal that slides in over a dimmed backdrop. Opening it locks page scroll and moves focus to the first focusable item; Tab and Shift+Tab stay inside the sheet, Escape or the backdrop closes it, and focus returns to the trigger. Selecting a regular menu item closes the sheet, while items with ariaExpanded keep it open so the submenu can unfold. Cmd+B on macOS or Ctrl+B elsewhere calls toggleSidebar, which toggles the desktop panel or the mobile sheet depending on the viewport. Use AnimatedSidebarClose inside the panel for an explicit close button on mobile. ## Accessibility and reduced motion for an animated sidebar The desktop panel is an aside with an accessible name from ariaLabel, and AnimatedSidebarTrigger is a button with aria-expanded that reflects the current state. Active items get aria-current="page", and expandable items expose aria-expanded. The rail is skipped in the tab order because the trigger and the shortcut already cover keyboard users. With reduced motion enabled, the panel width changes without the spring, labels switch to a short fade, the mobile sheet fades in place instead of sliding, the active highlight stops gliding between rows and press feedback is removed. ## Components - [Animated Sidebar](https://beui.dev/components/motion/animated-sidebar): A composable application sidebar with morphing nested navigation that folds into an animated icon rail on desktop and becomes a focus-managed sheet on mobile. - [Bounce Sidebar](https://beui.dev/components/motion/bounce-sidebar): A vertical sidebar whose active dot jumps between destinations on a curved, spring-loaded path. - [AI Sidebar](https://beui.dev/components/agents/ai-sidebar): A collapsible AI workspace sidebar for folders, projects, files, and bookmarks with keyboard navigation, optimistic moves, inline rename, and overflow-aware labels. - [Dock](https://beui.dev/components/motion/dock): macOS-style dock with grouped actions and a gliding active pill. ## FAQ ### How do I make a collapsible sidebar in Next.js? Wrap your app layout in a client component that renders AnimatedSidebarProvider, AnimatedSidebar and AnimatedSidebarInset, add an AnimatedSidebarTrigger in your header, and pick collapsible="icon" or "offcanvas". ### Is the beUI Animated Sidebar compatible with shadcn/ui? It installs through the shadcn CLI and follows the same composition model as the shadcn sidebar, with a provider, a panel, an inset and menu parts. It is its own component, so the part names start with AnimatedSidebar. ### What keyboard shortcut toggles the sidebar? Cmd+B on macOS and Ctrl+B on other platforms. It toggles the desktop panel, or the mobile sheet on small screens. ### How do I remember whether the sidebar was collapsed? Control the provider with open and onOpenChange, save the value in a cookie or local storage, and read it back as the initial value. Reading a cookie on the server avoids a flash of the wrong state. ### Can the sidebar sit on the right side? Yes. Pass side="right" to AnimatedSidebar. The mobile sheet then slides in from the right as well. --- # How to build an iOS-style wheel picker in React URL: https://beui.dev/guides/ios-wheel-picker-react Updated: 2026-10-18 The iOS picker wheel is a drum of rows that you flick, coast and snap to a value. On the web it is a small 3D trick plus some physics: rows sit on a cylinder made with rotateX and translateZ, a scroll position in rows drives the rotation, and a release velocity decides where it comes to rest. This guide walks through the technique, then shows how to compose the beUI WheelPicker into a working time picker you can install with the shadcn CLI. ## How does a 3D wheel picker work? Every row is placed on the surface of a cylinder. Row i is rotated by minus i times a fixed angle around the X axis and pushed out by the cylinder radius with translateZ. The whole list is then pulled back by the radius and rotated by the angle times the current scroll position. When scroll is 3, row 3 faces you and the rows above and below curve away, which is what produces the drum look. The angle comes from how many rows you want visible. With five rows, two sit on each side of the center, so each row spans 90 divided by 3, or 30 degrees. The radius follows from the row height: itemHeight divided by tan(angle). That keeps neighbouring rows touching on the curve instead of overlapping or leaving gaps. Keep a single number for the scroll position, measured in rows rather than pixels. A drag converts pixel movement into rows, a flick adds a projected distance, and snapping is just rounding to the nearest integer. Rows more than a quarter turn from the center are behind the horizon, so hide them to avoid the back of the drum bleeding through. ```tsx "use client"; import { animate, motion, useMotionValue, useTransform } from "motion/react"; const ITEM_HEIGHT = 36; const ROWS_EACH_SIDE = 2; // 5 visible rows const ANGLE = 90 / (ROWS_EACH_SIDE + 1); // degrees each row spans on the drum const RADIUS = ITEM_HEIGHT / Math.tan((ANGLE * Math.PI) / 180); const HEIGHT = Math.round( 2 * RADIUS * Math.sin((ROWS_EACH_SIDE * ANGLE * Math.PI) / 180) + ITEM_HEIGHT, ); export function Drum({ options, onChange, }: { options: string[]; onChange: (value: string) => void; }) { // Scroll position measured in rows, so 2.4 means "between row 2 and 3". const scroll = useMotionValue(0); const transform = useTransform( scroll, (s) => `translateZ(${-RADIUS}px) rotateX(${ANGLE * s}deg)`, ); const settle = (velocityRows: number) => { // Project where the flick would coast, then snap to the nearest row. const projected = scroll.get() + velocityRows * 0.25; const target = Math.max(0, Math.min(options.length - 1, Math.round(projected))); animate(scroll, target, { type: "spring", stiffness: 300, damping: 30 }); onChange(options[target]); }; return ( scroll.set(scroll.get() - info.delta.y / ITEM_HEIGHT)} onPanEnd={(_, info) => settle(-info.velocity.y / ITEM_HEIGHT)} > {options.map((label, i) => (
  • {label}
  • ))}
    ); } ``` ## Adding momentum, snapping and keyboard support A flick should feel like it coasts. On release, average the pointer velocity over the last few dozen milliseconds of movement instead of the final two samples, because a single noisy frame makes an even flick feel like it caught. Convert that velocity to rows, project how far it would travel under a constant deceleration, round to a row, and glide there. A small overshoot on the settle reads as the spring bounce users expect from iOS. Mouse wheels need a different model. Firing a fresh animation for every wheel notch stacks interrupted animations and feels laggy. Instead, move the scroll position continuously with the wheel delta and snap once the wheel has been idle for a short moment. Bind the wheel and touchmove listeners natively with passive set to false so you can call preventDefault and stop the page from scrolling behind the drum; React's synthetic wheel and touch handlers are passive. For keyboard users, make the drum focusable and map ArrowUp and ArrowDown to one row, Home to the first row and End to the last. The from-scratch example above leaves those out to stay short; the beUI WheelPicker includes all of them, plus rubber-banding past the ends and a frame-coalesced drag so touch movement paints once per animation frame. ## Install the beUI Wheel Picker beUI is a free, MIT-licensed motion component library for React, built with Tailwind CSS 4 and Framer Motion. Components are copied into your project as source, so you own the code. The wheel picker installs from the @beui namespace in the shadcn registry and lands at components/motion/wheel-picker.tsx, together with the small helpers it imports. ```bash npx shadcn@latest add @beui/wheel-picker ``` ## Compose wheels into a time picker WheelPicker is one column. A time picker is three of them side by side: hours, minutes and AM or PM. Each wheel takes an options array, a value with onValueChange (or defaultValue for uncontrolled use), visibleCount for how many rows show through the window (odd numbers, default 5) and itemHeight in pixels (default 36). Strip the border and background from each wheel and put a single frame around the group so the columns read as one control. Show the selected time as text above the wheels. It confirms the choice at a glance and gives you a natural place to format the value. The same pattern builds a date picker: the beUI preview composes month, day and year wheels and clamps the day when a shorter month is chosen. ```tsx "use client"; import { useState } from "react"; import { WheelPicker } from "@/components/motion/wheel-picker"; const HOURS = Array.from({ length: 12 }, (_, i) => String(i + 1)); const MINUTES = Array.from({ length: 60 }, (_, i) => String(i).padStart(2, "0")); const PERIODS = ["AM", "PM"]; export function TimePicker() { const [hour, setHour] = useState("7"); const [minute, setMinute] = useState("30"); const [period, setPeriod] = useState("AM"); return (

    Alarm at{" "} {hour}:{minute} {period}

    ); } ``` ## Labels, values and the optional tick sound Options can be plain strings or objects with a label and a value, which is useful when the text you show differs from what you store. onValueChange always receives the value string. Set sound to play a short synthesized tick as rows cross the center; it is off by default. disabled dims the wheel and removes it from the tab order. ```tsx import { WheelPicker } from "@/components/motion/wheel-picker"; const DURATIONS = [ { label: "15 min", value: "15" }, { label: "30 min", value: "30" }, { label: "1 hour", value: "60" }, { label: "2 hours", value: "120" }, ]; export function DurationPicker() { return ( console.log(Number(minutes))} sound aria-label="Meeting length" className="w-32" /> ); } ``` ## Accessibility and reduced motion for wheel pickers The beUI drum is a focusable element with your aria-label and full keyboard control (ArrowUp, ArrowDown, Home, End), and it shows a focus ring on keyboard focus. The 3D rows are decorative copies marked aria-hidden, so give every wheel a clear aria-label such as Hour or Minute, and render the chosen value as visible text near the wheels so everyone can confirm it. When the operating system asks for reduced motion, useReducedMotion returns true and WheelPicker renders a different control: a flat list of native buttons in a CSS scroll-snap container, with no 3D rotation, no momentum and no drag physics. Selecting a row is a plain click. That is a stronger answer than shortening the animation, because a spinning cylinder is exactly the kind of large movement reduced-motion users are asking to avoid. - Give each wheel its own aria-label. - Show the combined value as text, for example 7:30 AM. - Keep a native time input or a text field as a fallback for very long ranges such as years. - Test with a keyboard: Tab to each wheel and use the arrow keys. ## Components - [Wheel Picker](https://beui.dev/components/motion/wheel-picker): iOS-style picker wheel: a 3D drum on native momentum scroll that snaps to the nearest notch, with wheel, drag and keyboard control. Composes side by side for date and time pickers, reduced-motion safe. - [Arc Picker](https://beui.dev/components/motion/arc-picker): Radial text picker with top, bottom, left or right curves, smooth wheel movement and live selection on each scroll step. One persistent bracket frame grows and squeezes around each label. Supports drag momentum, keyboard input, disabled choices, controlled or uncontrolled values, forms and reduced motion. - [Date Range Picker](https://beui.dev/components/motion/date-range-picker): Composable date range picker with opt-in single-date selection, root, trigger, popover content, calendar, header, grid, summary, footer, clear and preset parts, plus a shared state hook. Compact inline and dropdown compositions, direct month and year selection, and full keyboard navigation. ## FAQ ### How do I make an iOS style picker wheel in React? Place each row on a cylinder with rotateX and translateZ, rotate the whole list by a scroll position measured in rows, and snap that position to the nearest integer on release. The beUI WheelPicker packages this with momentum, wheel and keyboard input, and installs with npx shadcn@latest add @beui/wheel-picker. ### How do I build a scroll time picker with hours and minutes? Render three WheelPicker components side by side, one each for hours, minutes and AM or PM, each with its own options array, value and onValueChange. Combine the three values into a time string in state and show it as text above the wheels. ### Does the wheel picker work on touch devices? Yes. beUI WheelPicker binds native touch listeners that are not passive, so a finger drag drives the drum instead of scrolling the page, and a release velocity carries into a momentum coast that snaps to a row. ### Can I use CSS scroll snap instead of 3D transforms? You can, and it is the simplest accessible version: a scroll container with scroll-snap-type and one snap point per row. You lose the curved drum and the tuned momentum. beUI uses exactly that flat scroll-snap list as its reduced-motion rendering. ### Is the beUI wheel picker controlled or uncontrolled? Both. Pass value and onValueChange to control it, or defaultValue to let it manage its own state. It also follows external value changes by gliding to the new row unless a drag is in progress. --- # How to respect prefers-reduced-motion in Framer Motion URL: https://beui.dev/guides/reduced-motion-framer-motion Updated: 2026-10-18 Some people get dizzy, nauseous or distracted from large on-screen movement, and they turn on Reduce Motion in their operating system. Browsers expose that choice as the prefers-reduced-motion media query. Framer Motion gives you two tools to honor it, useReducedMotion and MotionConfig, and this guide covers when each one works, why a global CSS rule is not enough, and how the components in beUI handle it in practice. ## Why the CSS media query cannot stop Framer Motion springs A common first step is a global rule inside @media (prefers-reduced-motion: reduce) that sets animation-duration and transition-duration to almost zero on every element. beUI ships that rule too, and it is worth having: it calms CSS transitions and keyframe animations across the site. It does not reach Framer Motion. A spring is calculated in JavaScript frame by frame and the result is written to the element's style, so there is no CSS transition for the media query to shorten. The same is true for anything you drive with requestAnimationFrame, useSpring or the imperative animate function. To stop that movement you have to read the preference in JavaScript and change what you animate. ## Using useReducedMotion to drop transforms and keep opacity useReducedMotion is a hook from motion/react that returns true when the user has asked for reduced motion. Its type is boolean or null, because the value is not known during server rendering, so beUI components read it as useReducedMotion() ?? false. The right response is usually fewer and gentler animations, not none. Movement is what causes discomfort: translation, scaling, rotation, parallax and large layout morphs. A short opacity fade or a color change still helps people notice that something changed. So branch the animation: with reduced motion on, keep the fade and drop the transform, and swap the spring for a short tween. ```tsx "use client"; import { motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; export function Toast({ children }: { children: ReactNode }) { // true when the OS setting is on, false when off, null before it is known. const reduce = useReducedMotion() ?? false; return ( {children} ); } ``` ## MotionConfig reducedMotion versus per-component checks MotionConfig sets defaults for every motion component below it. Its reducedMotion prop accepts "user", "always" or "never". With "user", Framer Motion follows the device setting and disables transform and layout animations for people who ask for reduced motion, while other values such as opacity and color still animate. Wrapping your app once is a cheap safety net. It has limits. It does not change code you run yourself, such as an imperative animate call in an effect, a useSpring you read every frame, or a hand-written requestAnimationFrame loop. It also cannot redesign an interaction: a drum that spins, a drag with momentum or a scroll-linked parallax needs a different behavior, not just a disabled transform. Use MotionConfig as the baseline and useReducedMotion where the component needs a real alternative. ```tsx "use client"; import { MotionConfig } from "motion/react"; import type { ReactNode } from "react"; // "user" follows the OS setting: transform and layout animations are // disabled for people who ask for reduced motion, opacity and color still run. export function Providers({ children }: { children: ReactNode }) { return {children}; } ``` ## Gating imperative animations and springs Anything you start by hand needs its own check. Read the hook, and return early from the effect when it is true. An error shake is a good example: under reduced motion the red text and the message already explain the error, so the shake can simply be skipped. For a control with several animated children, a MotionConfig with a transition override is a tidy pattern. The beUI Switch wraps its button in MotionConfig with transition set to duration 0 when reduced motion is on and to its thumb spring otherwise, and it also skips the press squish and the disabled shake. ```tsx "use client"; import { animate, useReducedMotion } from "motion/react"; import { useEffect, useRef } from "react"; export function Shake({ error }: { error: boolean }) { const ref = useRef(null); const reduce = useReducedMotion(); useEffect(() => { // Imperative animations are not covered by MotionConfig. Gate them here. if (!error || !ref.current || reduce) return; const controls = animate( ref.current, { x: [0, -6, 6, -3, 0] }, { duration: 0.4 }, ); return () => controls.stop(); }, [error, reduce]); return
    Check the code
    ; } ``` ## How beUI components handle reduced motion Every beUI component that moves reads useReducedMotion from motion/react, because the global CSS rule cannot stop its springs. The answer differs by component, which is the point: each one keeps what helps comprehension and removes what moves. - Wheel Picker swaps the whole 3D drum for a flat list of native buttons in a CSS scroll-snap container. No rotation, no momentum, no drag physics. - Message drops the trailing-edge pop-up that translates and scales a new row, so the row simply appears in place, and a removed row fades out over 120 ms instead of shifting. - Adaptive Stepper sets the rolling distance to zero, removes the blur and makes the value change instant, while its live region still announces the new value. - Switch uses MotionConfig with a zero-duration transition so the thumb jumps instead of springing, and skips the press squish and the disabled shake. ```tsx import { motion, MotionConfig, useReducedMotion } from "motion/react"; const THUMB_SPRING = { type: "spring", stiffness: 800, damping: 80, mass: 4 } as const; export function Thumb({ checked }: { checked: boolean }) { const reduce = useReducedMotion(); return ( // One switch for every motion child: springs normally, instant when reduced. ); } ``` ## Testing reduced motion and other accessibility checks Turn the setting on and use the interface. On macOS it is in System Settings under Accessibility, Display, Reduce motion; on iOS under Accessibility, Motion; on Windows under Accessibility, Visual effects, Animation effects. Chrome DevTools can also emulate prefers-reduced-motion from the Rendering panel, which is the fastest loop while you work. Check the things automated tools miss. Make sure nothing still slides, scales, spins or scrolls smoothly on its own, that state changes are still visible through color or opacity, and that focus still lands in the right place when an overlay opens without its animation. If you smooth-scroll in JavaScript, switch to instant scrolling under reduced motion; beUI's Message Scroller does that. beUI components install with the shadcn CLI and keep this handling in their source, so you can read and adjust it. ```bash npx shadcn@latest add @beui/wheel-picker @beui/message @beui/adaptive-stepper @beui/switch ``` ## Components - [Wheel Picker](https://beui.dev/components/motion/wheel-picker): iOS-style picker wheel: a 3D drum on native momentum scroll that snaps to the nearest notch, with wheel, drag and keyboard control. Composes side by side for date and time pickers, reduced-motion safe. - [Message](https://beui.dev/components/agents/message): Composable conversation primitives for message rows, grouped bubbles, avatars, metadata, live markers, and a mount-only trailing-edge pop-up for newly sent rows. - [Adaptive Stepper](https://beui.dev/components/motion/adaptive-stepper): Composable numeric stepper whose fixed footprint adapts at its minimum and maximum while the value rolls between steps. - [Switch](https://beui.dev/components/motion/switch): Toggle with a spring-driven thumb and press feedback. ## FAQ ### How do I detect prefers-reduced-motion in React? With Framer Motion, call useReducedMotion from motion/react. Without it, use window.matchMedia("(prefers-reduced-motion: reduce)") and listen for its change event so the UI updates when the setting changes. ### Does Framer Motion respect reduced motion automatically? Not by default. Wrap your app in MotionConfig with reducedMotion set to "user" to disable transform and layout animations for people who ask for reduced motion, or read useReducedMotion in each component for finer control. ### Why does my animation still play with Reduce Motion turned on? Framer Motion springs and imperative animations run in JavaScript, so a CSS rule that shortens transition-duration has no effect on them. Gate them with useReducedMotion, and check any animate calls or requestAnimationFrame loops you start yourself. ### Should reduced motion remove all animation? Usually not. The guidance is to remove movement such as translation, scaling, rotation and parallax, and keep short opacity or color transitions that help people notice a change. Removing all feedback can make an interface harder to follow. ### What does useReducedMotion return on the server? It returns null before the preference is known, so treat it as a boolean with a fallback, for example useReducedMotion() ?? false, and make sure the first render looks correct either way. --- # How to animate numbers in React URL: https://beui.dev/guides/animated-number-counter-react Updated: 2026-10-18 An animated number draws the eye to a stat, a price or a live counter. There are two common styles: a count-up that runs the value from zero to its target, and a ticker where each digit rolls like a slot machine. This guide builds both with Framer Motion, covers the details that keep them from jittering, and shows how to make sure screen reader users hear the real number instead of every frame in between. ## Count up a number on scroll with useSpring and useInView A count-up needs three pieces. useInView tells you when the element enters the viewport, so the animation plays when someone can see it rather than on page load. useSpring holds the animated value and eases toward a target you set. useTransform turns that raw value into display text, here rounded and formatted with toLocaleString. Render the motion value directly as a child of motion.span. Framer Motion updates the text node on each frame without re-rendering your component, which keeps a large dashboard of counters cheap. Use once: true on useInView so scrolling back up does not replay it. Under reduced motion, call jump instead of set. jump moves the spring to the value immediately, so people who asked for less motion see the final number with no counting. ```tsx "use client"; import { motion, useInView, useReducedMotion, useSpring, useTransform } from "motion/react"; import { useEffect, useRef } from "react"; export function CountUp({ value }: { value: number }) { const ref = useRef(null); const inView = useInView(ref, { once: true, amount: 0.6 }); const reduce = useReducedMotion(); const spring = useSpring(0, { stiffness: 90, damping: 24 }); const text = useTransform(spring, (v) => Math.round(v).toLocaleString()); useEffect(() => { if (!inView) return; if (reduce) spring.jump(value); // no count, just the answer else spring.set(value); }, [inView, reduce, value, spring]); return ( {value.toLocaleString()} ); } ``` ## Build a rolling digit ticker A ticker gives each digit its own slot. The slot holds a vertical column of the digits 0 to 9 and translates it so the current digit shows through. Changing a digit from 3 to 7 slides the column four rows, which reads as a roll. Clip the slot with clip-path: inset(0) rather than overflow: hidden, and keep an invisible copy of the digit in normal flow so the slot sits on the same text baseline as the words around it. Key each slot by its place value counted from the right, not by its index from the left. Then when 999 becomes 1,000 the ones, tens and hundreds keep their identity and roll to their new digits, and the new thousands slot is the only one that mounts. Keying from the left would remount every slot and replay them all from zero. ```tsx "use client"; import { motion, useReducedMotion } from "motion/react"; const DIGITS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; // One slot: a column of 0 to 9 that slides so the right digit shows. export function Digit({ digit }: { digit: number }) { const reduce = useReducedMotion(); return ( {digit} {DIGITS.map((n) => ( {n} ))} ); } ``` ## Why tabular numbers stop the jitter In most fonts, digits are proportional: a 1 is narrower than an 8. While a number counts up, every frame changes the width of the string, so the text shifts left and right and the layout around it twitches. The fix is font-variant-numeric: tabular-nums, which Tailwind exposes as the tabular-nums class. Every digit then takes the same width. Tabular figures fix the digits but not the length. Going from 999 to 1,000 still adds characters. For counters that cross a magnitude, reserve space with a min-width in ch units, or pad the value; beUI NumberTicker has a pad prop that left-pads with zeros to a fixed digit count. - Add tabular-nums to every animated number. - Format with toLocaleString or Intl.NumberFormat so group separators match the reader's locale. - Round inside the formatter, not in state, so the spring can keep its fractional value. - Give single-digit slots a width of 1ch so a roll never changes the slot size. ## Install beUI Number Animation components beUI's Number Animation page has three variants, and each one installs on its own from the @beui namespace in the shadcn registry. AnimatedNumber is the spring count-up triggered in view. NumberTicker is the slot-machine roll with a staggered entrance. DigitSwap rolls fixed-slot glyphs and also works for masked values such as card numbers. ```bash npx shadcn@latest add @beui/animated-number npx shadcn@latest add @beui/number-ticker npx shadcn@latest add @beui/digit-swap ``` ## Using AnimatedNumber, NumberTicker and DigitSwap AnimatedNumber takes value, an optional format function, duration in seconds (default 1.2) and startOnView (default true). It starts from 0 and eases to value when 60 percent of it is visible, then animates from the previous value on later changes. NumberTicker takes value plus prefix, suffix, decimals, pad, locale for group separators, or a custom format function. duration and stagger tune the roll; the stagger only plays on the first reveal, so live updates roll every digit at once instead of lagging. Set blur for a light motion blur during the roll. DigitSwap takes a string or number value, a direction of up or down, and suffixLength with suffixClassName to highlight the last few characters, such as the final four digits of a card. Change animationKey to replay every glyph even when the characters are the same. ```tsx import { AnimatedNumber } from "@/components/motion/animated-number"; import { DigitSwap } from "@/components/motion/digit-swap"; import { NumberTicker } from "@/components/motion/number-ticker"; export function Stats({ revenue, users, code }: { revenue: number; users: number; code: string }) { return (
    {/* Counts up from 0 once the number scrolls into view. */} `$${Math.round(n).toLocaleString()}`} /> {/* Slot-machine digits that roll when the value changes. */} {/* Fixed-slot glyph swap, good for codes and masked values. */}
    ); } ``` ## Accessibility of changing numbers A screen reader that lands on a counting number can read whatever frame is on screen, such as 48,113 on the way to 129,480. Rolling digits are worse: a column of ten digits per slot is meaningless when read aloud. The pattern that fixes both is to render the final value in a visually hidden span and mark the animated copy aria-hidden. NumberTicker and DigitSwap both do this, so assistive technology reads the real number once. Be careful with live regions. Putting aria-live on a counter that updates every couple of seconds makes a screen reader interrupt the user over and over. Reserve announcements for values the user changed themselves. The beUI Adaptive Stepper is an example: its value is an output element with aria-live polite, because each change is the result of a button press. Count-ups that start in view begin at 0, so render meaningful surrounding text, such as a label and a comparison line, rather than relying on the number alone. All three beUI number components honor reduced motion: AnimatedNumber shows the final value immediately, NumberTicker digits jump without rolling, and DigitSwap keeps a short fade without the vertical slide. ## Components - [Number Animation](https://beui.dev/components/motion/number): Animated number primitives for count-up values, rolling tickers, and fixed-slot digit swaps. - [Adaptive Stepper](https://beui.dev/components/motion/adaptive-stepper): Composable numeric stepper whose fixed footprint adapts at its minimum and maximum while the value rolls between steps. - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. ## FAQ ### How do I make a number count up in React? Hold the value in a Framer Motion useSpring, set its target when useInView reports the element is visible, and render a useTransform of the spring that rounds and formats it. Or install beUI AnimatedNumber with npx shadcn@latest add @beui/animated-number. ### How do I animate a number only when it scrolls into view? Use useInView from motion/react with once set to true, and only start the animation inside an effect once inView is true. beUI AnimatedNumber and NumberTicker do this by default through their startOnView prop. ### Why does my animated counter jitter or shift sideways? Proportional digits have different widths, so the string width changes every frame. Add font-variant-numeric: tabular-nums (the Tailwind tabular-nums class), and reserve width or pad the value when it can gain digits. ### What is the difference between a count-up and a number ticker? A count-up animates the value itself from a start to a target and shows every number in between. A ticker animates each digit independently, rolling a column of 0 to 9 into place, which suits live values that change often. ### Are animated numbers accessible to screen readers? They can be. Put the final value in a visually hidden element, hide the animated copy with aria-hidden, and avoid aria-live on values that update on their own. Respect reduced motion by showing the final value without counting. --- # How to build an AI chat interface in React URL: https://beui.dev/guides/ai-chat-ui-react Updated: 2026-10-18 A chat interface for an AI model looks simple and hides a lot of state: a list that grows while a reply streams in, a scroll position that should follow the output but never fight the reader, a composer that knows when to send and when to stop, and a loading state for the gap before the first token. This guide breaks the interface into those parts and builds it with beUI's AI agent components, which install as source through the shadcn CLI. ## The parts of an AI chat UI Most AI chat screens share the same anatomy. Keep each part separate so you can change one without touching the others, and so the streaming logic never leaks into presentational components. - Message list: rows for the user and the assistant, with avatars, names and timestamps. - Scroll viewport: follows new output at the bottom and lets go when the reader scrolls up. - Streaming response: the assistant text as it arrives, with copy, retry and feedback once it completes. - Prompt input: an auto-growing textarea that sends on Enter and turns into a stop button while a reply runs. - Loading and thinking states: something calm to show between sending and the first token. - Tool calls: visible records of what the agent ran and what came back. ## Install the beUI AI agent components Each component installs from the @beui namespace in the shadcn registry into components/agents. Installing message also brings message-bubble, which it imports. Agent loading states install per variant, so pick thinking-shimmer, reasoning-text or agent-progress. If you want the whole workspace with a sidebar, chat-app installs the shell plus the components its example composes. ```bash npx shadcn@latest add @beui/message @beui/message-scroller @beui/prompt-input @beui/streaming-response @beui/thinking-shimmer ``` ## Message list and auto-scroll that releases when the reader scrolls up The classic bug in chat UIs is a scroll container that jumps to the bottom on every token, so anyone who scrolls up to reread an earlier answer gets dragged back down. The fix is to follow only while the reader is at the live edge. MessageScroller watches its content with a ResizeObserver and scrolls to the end when content grows, but only while the reader is within followThreshold pixels of the bottom (56 by default). Scrolling up with the wheel, touch, ArrowUp, PageUp or Home releases it; scrolling back down to the end resumes following. Wrap the rows in MessageGroup and render each one with Message, which takes from set to user or assistant and lays the row out on the correct side. MessageAvatar, MessageHeader, MessageContent and MessageFooter fill in the row, and MessageBubble with MessageBubbleContent draws the bubble in a variant such as solid, soft or ghost. Set animateIn on newly sent rows for a short pop-up from the live edge; leave it off for history so a long conversation does not animate on load. MessageScroller also takes onFollowChange, which reports when the reader leaves or returns to the live edge, so you can show a jump to latest button. Set navigation to rail for a compact rail that previews and scrolls to individual messages; give each Message an id when you use it. ```tsx "use client"; import { useState } from "react"; import { ThinkingShimmer } from "@/components/agents/loading-states/thinking-shimmer"; import { Message, MessageAvatar, MessageContent, MessageGroup, } from "@/components/agents/message"; import { MessageBubble, MessageBubbleContent } from "@/components/agents/message-bubble"; import { MessageScroller } from "@/components/agents/message-scroller"; import { PromptInput } from "@/components/agents/prompt-input"; import { StreamingResponse } from "@/components/agents/streaming-response"; import { streamReply } from "./stream-reply"; type ChatMessage = { id: string; from: "user" | "assistant"; content: string; streaming?: boolean; }; export function Chat() { const [messages, setMessages] = useState([]); const [input, setInput] = useState(""); const [waiting, setWaiting] = useState(false); const busy = waiting || messages.some((m) => m.streaming); async function send(prompt: string) { const id = crypto.randomUUID(); setMessages((m) => [...m, { id: `u-${id}`, from: "user", content: prompt }]); setInput(""); setWaiting(true); await streamReply(prompt, `a-${id}`, setMessages, () => setWaiting(false)); } return (
    {messages.map((message) => ( {message.from === "user" ? "You" : "AI"} {message.from === "assistant" ? ( {message.content} ) : ( message.content )} ))} {waiting ? ( AI Thinking… ) : null}
    ); } ``` ## Streaming the response token by token Read the response body as a stream and append each decoded chunk to the assistant message in state. Keep a streaming flag on the message and clear it when the stream ends. Wrap the assistant text in StreamingResponse with status set to streaming or complete: its copy, retry and feedback actions only appear once the response is no longer streaming, so they never jump around under a growing paragraph. StreamingResponse renders whatever children you give it, so pass plain text or the output of your Markdown renderer. Pass copyText with the raw text for the copy action, onRetry to show a retry button, and sources to add an expandable source summary after streaming. The example below uses fetch with a plain text stream; the same shape works with any SDK that yields chunks. ```ts import type { Dispatch, SetStateAction } from "react"; export type ChatMessage = { id: string; from: "user" | "assistant"; content: string; streaming?: boolean; }; export async function streamReply( prompt: string, id: string, setMessages: Dispatch>, onFirstToken: () => void, ) { const res = await fetch("/api/chat", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ prompt }), }); if (!res.body) throw new Error("No response body"); const reader = res.body.getReader(); const decoder = new TextDecoder(); let started = false; while (true) { const { done, value } = await reader.read(); if (done) break; const chunk = decoder.decode(value, { stream: true }); if (!started) { started = true; onFirstToken(); // swap the thinking row for the real message setMessages((m) => [...m, { id, from: "assistant", content: chunk, streaming: true }]); continue; } setMessages((m) => m.map((msg) => (msg.id === id ? { ...msg, content: msg.content + chunk } : msg)), ); } setMessages((m) => m.map((msg) => (msg.id === id ? { ...msg, streaming: false } : msg))); } ``` ## Prompt input, loading states and tool calls PromptInput grows with its content between minRows and maxRows, sends on Enter, inserts a newline on Shift+Enter, and ignores Enter while an input method editor is composing text. Pass onSubmit to receive the prompt and the selected model, loading while a reply runs, and onStop to turn the send button into a stop button. models with model or defaultModel add a model picker, and actions with onAction add a menu for attachments or context. Between send and first token, show a thinking row. ThinkingShimmer is a quiet shimmer over a status label. ReasoningText cycles through phrases with an ASCII loader. AgentProgress shows an activity glyph, a verb and a live timer for longer runs. For tool calls, beUI ToolResult shows terminal output or a request payload with running, success, error and cancelled states, and collapses when the run completes. ```tsx import { ToolResult, ToolResultOutput } from "@/components/agents/tool-result"; export function TestRun({ running, output }: { running: boolean; output: string }) { return ( {output} ); } ``` ## Accessibility for AI chat interfaces The transcript needs to be announced without flooding the screen reader. MessageScroller labels its viewport (Conversation by default, change it with label) and renders the content as a log region with aria-live polite and aria-relevant set to additions and text, and it sets aria-busy from the busy prop while a reply is in progress. StreamingResponse has its own polite live region; inside MessageScroller, pass announce={false} so the same text is not announced twice. Each Message is an article labelled user message or assistant message unless you pass your own aria-label. PromptInput is labelled Prompt by default. ReasoningText and AgentProgress use role status. Under reduced motion, Message drops its pop-up so new rows appear in place, MessageScroller scrolls instantly instead of smoothly, and MessageTyping, ReasoningText and AgentProgress read useReducedMotion to remove their movement. - Give the transcript a meaningful label if the page has more than one conversation. - Pass busy to MessageScroller while a reply streams. - Set announce={false} on StreamingResponse inside a MessageScroller. - Keep the composer reachable and focused after sending so keyboard users can continue. ## Components - [Chat App](https://beui.dev/components/agents/chat-app): A complete agent conversation workspace composing navigation, messages, streaming, planning, approvals, tools, code, diffs, generated media, sources, and prompt input. - [Message](https://beui.dev/components/agents/message): Composable conversation primitives for message rows, grouped bubbles, avatars, metadata, live markers, and a mount-only trailing-edge pop-up for newly sent rows. - [Message Scroller](https://beui.dev/components/agents/message-scroller): A reader-aware conversation viewport that follows streamed output at the live edge and releases control when the reader moves away. - [Prompt Input](https://beui.dev/components/agents/prompt-input): An auto-growing agent composer with prompt actions, model selection, keyboard submission, and animated send and stop states. - [Streaming Response](https://beui.dev/components/agents/streaming-response): A stable response surface with completion actions, rendered content, and an expandable source summary. - [Agent Loading States](https://beui.dev/components/agents/loading-states): Three thoughtful loading states for AI interfaces: shimmering status text, live agent progress, and cycling reasoning phrases. ## FAQ ### How do I build a ChatGPT-style chat UI in React? Split it into a message list, a scroll viewport that follows new output, a streaming response surface and a prompt input. beUI provides Message, MessageScroller, StreamingResponse and PromptInput for those parts, installed with npx shadcn@latest add @beui/. ### How do I auto-scroll a chat to the bottom without fighting the user? Only follow while the reader is near the bottom. Measure the distance from the end on scroll, stop following when they scroll up, and resume when they return to the end. beUI MessageScroller does this with a configurable followThreshold. ### How do I stream an AI response in React? Read the response body with a stream reader, decode each chunk and append it to the assistant message in state. Mark the message as streaming until the stream ends, then show completion actions such as copy and retry. ### What should a chat UI show while the AI is thinking? Show a calm status row in the assistant's position, such as a shimmering Thinking label, then replace it with the real message when the first token arrives. For long agent runs, a label with an elapsed timer sets expectations better than a spinner. ### Do beUI chat components depend on a specific AI SDK? No. They take plain props such as message content, status and callbacks, so you can drive them from fetch, the Vercel AI SDK, or any client that streams text. ### How do I make a chat transcript accessible to screen readers? Render the transcript as a log region with aria-live polite, set aria-busy while a reply streams, and avoid nesting a second live region that repeats the same text. beUI MessageScroller handles the log region for you. --- # The best React animation libraries for 2027 URL: https://beui.dev/guides/best-react-animation-libraries-2027 Updated: 2026-11-13 For most React apps in 2027, use Motion (formerly Framer Motion) as the animation engine, then add a component library on top when you want ready-made pieces. beUI, Magic UI, Aceternity UI, Motion Primitives, React Bits and Animata all copy source into your project. GSAP, React Spring and AutoAnimate are engines you build with yourself. beUI is our library, so we list it next to the others and say plainly where each one fits better. ## Quick answer: which one to pick Pick by what you are building, not by how many components a library has. Each of these is a good choice for one kind of work. - Product UI, charts or AI agent interfaces: beUI - Landing page effects and text animations: Magic UI or Aceternity UI - Small, clean motion building blocks: Motion Primitives - Creative backgrounds and text effects in JavaScript or TypeScript: React Bits - Effects to add to a design you already have: Animata - Complex timelines and scroll-driven sequences: GSAP - Spring physics without Motion: React Spring - One-line list and layout transitions: AutoAnimate ## Component libraries compared These libraries give you finished components. Most install through the shadcn CLI and copy the source into your project, so you own and can edit every file. Prices and plans are as of November 2026. | Library | License | Price | Install | Best for | | --- | --- | --- | --- | --- | | beUI | MIT | Free; beUI Pro sells blocks and templates | shadcn CLI as @beui, or copy | Product UI, charts, AI agent UI, React Native ports | | Magic UI | MIT | Free; Magic UI Pro sells blocks and templates | shadcn CLI as @magicui | Landing page effects, text animations, mockups | | Aceternity UI | Free components; paid items under the Aceternity License | Free plan plus paid one-time plans | shadcn CLI as @aceternity, or copy | Standout landing pages, backgrounds, templates | | Motion Primitives | MIT | Free; a Pro tier sells premium sections | Own CLI or shadcn as @motion-primitives | Text effects, docks, dialogs, toolbars | | React Bits | MIT + Commons Clause | Free | shadcn CLI as @react-bits, or copy | Backgrounds, text effects, micro interactions | | Animata | MIT | Free | shadcn CLI with a URL, or copy | Hand-made effects for an existing design | ## Animation engines compared Engines do not ship finished components. You use them to animate your own markup, and most component libraries above are built on one of them, usually Motion. | Engine | License | How you use it | Best for | | --- | --- | --- | --- | | Motion (Framer Motion) | MIT | Declarative motion components, layout and exit animations, gestures | Most React interfaces | | GSAP | Free to use under its own license (not MIT) | Imperative timelines, ScrollTrigger and plugins | Long sequences and scroll storytelling | | React Spring | MIT | Spring physics through hooks | Physical, interruptible motion without Motion | | AutoAnimate | MIT | One hook or directive on a parent element | Adding motion to lists with no setup | ## How we compared them We looked at the license, the price, how you install it, whether you own the source, React Native support and how each one handles reduced motion. Facts come from each project's own site and docs. If something has changed since this page was updated, the project's site wins. ## Where beUI fits, and where it does not beUI is a free, MIT-licensed set of over 100 animated React components built on Motion and Tailwind CSS. It focuses on the parts of an app people use every day: tabs, buttons, inputs, pickers, charts and AI agent interfaces such as streaming replies, tool approvals and a voice orb. Many components also have React Native versions in beUI Native. It is not the best pick for every job. If you want a large collection of hero effects and landing page backgrounds, Magic UI and Aceternity UI have more of them. If you need long scroll-driven sequences, GSAP is the stronger tool. beUI does not cover 3D scenes. ## Can you use more than one? Yes. The component libraries copy source into your project, and most share Motion and Tailwind CSS, so you can take a landing page effect from one and app components from another. Keep to one animation engine where you can, so you ship one runtime and your motion feels the same across the app. ## Components - [Tabs](https://beui.dev/components/motion/tabs): Pill, segment or underline tabs with a spring layoutId indicator and optional icons. - [Timeline](https://beui.dev/components/motion/timeline): A draggable timeline of dated events around a focused card. - [Streaming Response](https://beui.dev/components/agents/streaming-response): A stable response surface with completion actions, rendered content, and an expandable source summary. - [Voice Orb](https://beui.dev/components/agents/voice-orb): Breathing liquid voice visualization with flowing highlights, custom pigments and a soft, voice-reactive silhouette. Accepts a normalized level, MotionValue or caller-owned audio analyser, pauses offscreen and supports reduced motion. ## FAQ ### What is the best React animation library in 2027? For most apps, Motion (formerly Framer Motion) is the best engine. For ready-made components, pick by use case: beUI for product UI, charts and AI agent interfaces, Magic UI or Aceternity UI for landing pages. ### Is Framer Motion the same as Motion? Yes. Framer Motion became Motion in late 2024. The React API ships in the motion package, and you import it from motion/react. ### Is GSAP free? Yes. Since 2025, GSAP and its former paid plugins are free to use, under GSAP's own license rather than MIT. Check its license page for the exact terms. ### Are these libraries free for commercial use? Most are MIT, which allows commercial use. React Bits uses MIT with the Commons Clause, so you can use it in apps but not resell the components. Aceternity UI's paid items use its own license. ### Which React animation libraries work with React Native? beUI has React Native versions of many components in beUI Native, built with Reanimated and Gesture Handler. The other component libraries here do not list React Native support as of November 2026. --- # How to animate an AI chat interface in React URL: https://beui.dev/guides/ai-chat-animations-react Updated: 2026-11-13 Good AI chat animation does three jobs: it shows the model is working, it reveals the reply without making the page jump, and it confirms what the user just did. Use short opacity and transform transitions for new messages, a shimmer or progress line while the model thinks, a stable surface for streamed text, and turn movement off for people who ask for reduced motion. This guide covers each part with the beUI agent components. ## What to animate, and what to keep still A chat changes all the time, so motion has to earn its place. Animate the moments that need feedback and keep everything else still. - Animate: new messages entering, the thinking state, the send button, tool calls opening and closing, and a voice orb reacting to sound. - Keep still: each streamed token, the scroll position while the user reads, and anything that would bounce or shift text the user is reading. ## Thinking and loading states Between sending a prompt and the first token, the user needs to see that something is happening. A shimmer across a short status line, such as Thinking or Searching, works better than a spinner because it says what the model is doing. For longer agent runs, show progress as steps. The beUI Loading States page has three variants: Thinking Shimmer for a single status line, Reasoning Text for cycling messages, and Agent Progress for live steps. ```bash npx shadcn@latest add @beui/thinking-shimmer @beui/agent-progress ``` ## Streaming the reply without layout jumps Do not animate each token. Render streamed text into a surface that only grows downward, so lines above never move. beUI Streaming Response keeps its size stable while content arrives and shows actions only when the reply is done. Scrolling matters as much as the text. Message Scroller follows the live edge while the reply streams, and stops following the moment the reader scrolls up, so the page never pulls them away from what they are reading. ## Message entry and grouping New messages should fade in and rise a few pixels with an ease-out curve in about 200ms. Exits should be faster than entries. Group consecutive messages from the same sender so only the new bubble moves, not the whole list. beUI Message and Message Bubble handle grouping, alignment and long replies that collapse. ## Agent steps: plans, tool calls and approvals Agents do work between messages. Show a plan as a list whose items change state in place, so nothing jumps. Tool calls and their output read best as a short summary that expands on click. When the agent needs permission, use a clear card with allow and deny actions instead of a modal. beUI Todo List, Agent Activity, Tool Result and Tool Approval cover these, each with motion that stays in place. ## Voice agents In a voice chat there is no text to watch, so the visual has to show who is talking. beUI Voice Orb is a shader sphere that reacts to microphone or audio levels, so it moves when the user or the agent speaks and rests when nobody does. ## Reduced motion and accessibility Read the user's setting with useReducedMotion from motion/react. When it is on, keep opacity and color changes and drop movement, including the shimmer sweep and message rise. Announce replies to screen readers with a polite live region, and announce the finished reply rather than each token. Keep focus in the prompt input after sending so keyboard users can type the next message right away. ## Components - [Agent Loading States](https://beui.dev/components/agents/loading-states): Three thoughtful loading states for AI interfaces: shimmering status text, live agent progress, and cycling reasoning phrases. - [Streaming Response](https://beui.dev/components/agents/streaming-response): A stable response surface with completion actions, rendered content, and an expandable source summary. - [Message Scroller](https://beui.dev/components/agents/message-scroller): A reader-aware conversation viewport that follows streamed output at the live edge and releases control when the reader moves away. - [Message](https://beui.dev/components/agents/message): Composable conversation primitives for message rows, grouped bubbles, avatars, metadata, live markers, and a mount-only trailing-edge pop-up for newly sent rows. - [Todo List](https://beui.dev/components/agents/todo-list): A collapsible agent task plan with morphing status marks, a completion count, compact metadata, and smooth list updates. - [Tool Approval](https://beui.dev/components/agents/tool-approval): A human-in-the-loop permission card for reviewing tool details, allowing once, remembering access, or denying execution. - [Voice Orb](https://beui.dev/components/agents/voice-orb): Breathing liquid voice visualization with flowing highlights, custom pigments and a soft, voice-reactive silhouette. Accepts a normalized level, MotionValue or caller-owned audio analyser, pauses offscreen and supports reduced motion. ## FAQ ### Should I animate each token as it streams in? No. Animating every token makes the text flicker and costs performance. Let text appear as it arrives in a surface that only grows downward. ### How long should chat animations be? Keep most under 300ms. About 200ms for a message entering, faster for exits, and 100 to 160ms for button press feedback. ### What should a thinking state show? Say what the model is doing, such as Thinking or Searching, with a subtle shimmer. For long agent runs, show the steps as they happen. ### How do I respect reduced motion in an AI chat? Use useReducedMotion from motion/react. Keep fades and color changes, and remove movement such as slides, shimmers and orb motion. --- # An Aceternity UI alternative for animated React components URL: https://beui.dev/alternatives/aceternity-ui Updated: 2026-10-18 Aceternity UI is a popular collection of animated React components, blocks and templates built with Tailwind CSS and Framer Motion, aimed at standout landing pages. beUI covers similar ground with a different emphasis: free, MIT-licensed interface primitives, charts and AI agent components that install through the same shadcn CLI. This page compares the two fairly so you can pick the right one, or use both. ## beUI vs Aceternity UI | | beUI | Aceternity UI | | --- | --- | --- | | License | MIT, free and open source | Free components; paid items covered by the Aceternity License (see its licence page) | | Price | Free, no paid tier needed for any beUI component | Free plan plus paid All-Access, Lifetime and Team plans, one-time payment (as of October 2026) | | Install | shadcn CLI (npx shadcn@latest add @beui/) or copy the source from the page | shadcn CLI with the @aceternity namespace, or manual copy-paste | | Animation library | Framer Motion (the motion package), shared tokens in lib/ease.ts | Framer Motion (Motion for React) | | Styling | Tailwind CSS 4, TypeScript, React 19 | Tailwind CSS (Pro templates on Next.js 15 and Tailwind CSS v4) | | Focus | App interface primitives, charts, AI agent UI and composed blocks | Landing page effects, backgrounds, sections, blocks and full templates | | React Native | Yes, beUI Native ports with Reanimated and Gesture Handler (npx beui-native add ) | Not listed on its site as of October 2026 | | AI agent components | Yes, a dedicated AI Agents category (messages, prompt input, tool approval, streaming, citations) | Has an AI chat interface block and supports installs by AI agents via MCP | | Reduced motion | Movement gated behind useReducedMotion; opacity and color transitions stay | Check each component's source | | Source ownership | Source copied into your repo; you own and edit it | Source copied into your project | Aceternity UI official site: https://ui.aceternity.com ## What is Aceternity UI good at? Aceternity UI describes itself as a React component library for beautiful landing pages. Its catalog leans into visual effects: aurora and beam backgrounds, sparkles, 3D card effects, parallax and scroll showcases, animated text and hero sections. On top of the free components it sells All-Access plans with blocks and complete marketing, SaaS and portfolio templates. If you are building a marketing site and want a dramatic hero or section ready to paste, that breadth of landing page material is its main strength. Components install with the shadcn CLI from the @aceternity registry, so adding one is a single command. ## Where does beUI differ from Aceternity UI? beUI focuses on the interface inside the product rather than the marketing page around it. Its 107 web components are split across Components (tabs, select, combobox, tooltip, popover, switch, sliders), Charts, AI Agents and Blocks such as a command palette, dynamic island and swap widget. Every beUI component is free under the MIT license, with no paid tier required. Motion values come from one set of shared tokens, and transform-based movement is gated behind useReducedMotion so people who ask for less motion still get opacity and color feedback. Decorative hover effects such as the tilt card only run on devices that can hover. - Controlled and uncontrolled APIs on larger components (value, defaultValue, onChange) - Keyboard and focus handling on overlays, menus and lists - React Native versions of many components through beUI Native - An MCP server, llms.txt and agent skill so coding assistants can find and install components ## How do I install a beUI component? beUI is listed in the official shadcn registry directory as @beui, so the install works exactly like an Aceternity UI install. The command below adds the 3D tilt card with its cursor-tracked glare. The source lands in your components folder, ready to edit. ```bash # once per project, if components.json does not exist yet npx shadcn@latest init npx shadcn@latest add @beui/tilt-card ``` ## Can I use Aceternity UI and beUI together? Yes. Both copy plain source files into your project, both use Tailwind CSS and Framer Motion, and both install through the shadcn CLI, so they sit side by side without conflict. A common split is Aceternity UI for marketing sections and backgrounds, and beUI for the app: forms, menus, charts and agent chat. If you are moving from one to the other, there is no runtime package to uninstall. Replace components one at a time, check that each import path points at the file you installed, and remove the old file once nothing imports it. ## When is Aceternity UI the better pick? Choose Aceternity UI when your main job is a visually striking landing page and you want ready-made sections or a full template to start from. Its library of backgrounds, hero sections and paid templates is built for exactly that, and a one-time purchase can save days on a marketing site. Choose beUI when you need free, accessible primitives for the product itself, charts, AI agent interfaces or React Native parity. ## Components - [Tilt Card](https://beui.dev/components/motion/tilt-card): 3D perspective tilt on hover with cursor-tracked glare. - [Marquee](https://beui.dev/components/motion/marquee): Infinite horizontal or vertical scroll with pause-on-hover. - [Dock](https://beui.dev/components/motion/dock): macOS-style dock with grouped actions and a gliding active pill. - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. - [Shader Background](https://beui.dev/components/motion/shader-background): Canvas shader backgrounds (mesh gradient, grain, warp, waves, voronoi, dot orbit and more) with a single typed variant prop. Reduced-motion freezes animated variants. - [Button](https://beui.dev/components/motion/button): Spring-pressed Button plus StatefulButton, MagneticButton, and MetallicButton variants. ## FAQ ### Is there a free alternative to Aceternity UI? beUI is a free, MIT-licensed library of animated React components that installs through the shadcn CLI. Aceternity UI also offers free components alongside its paid All-Access plans. ### Does beUI use Framer Motion like Aceternity UI? Yes. beUI components are built with Framer Motion (the motion package), Tailwind CSS 4 and TypeScript, so the stack matches Aceternity UI closely. ### Can I install beUI with the shadcn CLI? Yes. beUI is in the official shadcn registry directory as @beui. Run npx shadcn@latest add @beui/ followed by the component slug, for example @beui/tilt-card. ### Will beUI conflict with Aceternity UI components in the same project? No. Both copy source files into your project rather than installing a shared runtime, so they can be used side by side. ### Does beUI have landing page templates? beUI focuses on components and composed blocks rather than full page templates. For complete marketing templates, Aceternity UI's paid plans are a strong option. --- # A Magic UI alternative for animated React components URL: https://beui.dev/alternatives/magic-ui Updated: 2026-10-18 Magic UI is a free, open-source library of animated components and effects built with React, TypeScript, Tailwind CSS and Framer Motion, positioned as a companion to shadcn/ui. beUI shares that stack and install path but spends its effort on application primitives, charts and AI agent interfaces. Here is how the two compare and when each one fits. ## beUI vs Magic UI | | beUI | Magic UI | | --- | --- | --- | | License | MIT, free and open source | MIT, free and open source | | Price | Free | Free components; Magic UI Pro sells blocks and templates (as of October 2026) | | Install | shadcn CLI (npx shadcn@latest add @beui/) or copy the source from the page | shadcn CLI with the @magicui namespace (same process as shadcn/ui) | | Animation library | Framer Motion (the motion package), shared tokens in lib/ease.ts | Framer Motion (Motion) | | Styling | Tailwind CSS 4, TypeScript, React 19 | Tailwind CSS, TypeScript, React | | Focus | App primitives, charts, AI agent UI and composed blocks | Landing page effects, text animations, backgrounds and device mockups | | React Native | Yes, beUI Native ports with Reanimated and Gesture Handler (npx beui-native add ) | Not listed on its site as of October 2026 | | Charts | Yes, a Charts category (treemap, candlestick, donut, funnel, heat calendar and more) | Not a category in its docs as of October 2026 | | AI tooling | MCP server, llms.txt and an agent skill | MCP documented in its docs | | Source ownership | Source copied into your repo; you own and edit it | Source copied into your project | Magic UI official site: https://magicui.design ## What is Magic UI good at? Magic UI calls itself a UI library for design engineers. Its free catalog is full of polished landing page pieces: marquee, bento grid, globe, dock, animated beams and borders, number ticker, shimmer and rainbow buttons, a wide range of text animations, background patterns and device mockups such as Safari and iPhone frames. It installs with the same process as shadcn/ui and is MIT licensed, which makes it an easy, low-risk addition to any shadcn project. Magic UI Pro adds paid blocks and templates for teams that want complete pages. ## Where does beUI differ from Magic UI? The libraries overlap on effects like marquee, dock, number tickers and text reveals, and both are free and MIT licensed. The difference is scope. beUI's 107 web components go deeper into the parts of a product people interact with every day: select, combobox, tooltip, popover, context menu, tabs, sliders, wheel picker, bottom sheet and toasts, with keyboard and focus behavior built in. beUI also ships two categories Magic UI does not list as of October 2026: Charts, such as treemap, candlestick and donut charts, and AI Agents, with message, prompt input, tool approval, streaming response and citation components. Many of these have React Native versions through beUI Native. - Shared motion tokens so springs and easing feel consistent across components - Movement gated behind useReducedMotion, with opacity and color feedback kept - Controlled and uncontrolled state on larger components ## How do I install a beUI component? If you already install Magic UI components with the shadcn CLI, beUI needs no extra setup. beUI is listed in shadcn's official registry directory as @beui. This command adds the rolling slot-machine number ticker. ```bash # once per project, if components.json does not exist yet npx shadcn@latest init npx shadcn@latest add @beui/number-ticker ``` ## Can I use Magic UI and beUI in the same project? Yes, and many projects should. Both are copy-paste source with the same Tailwind CSS and Framer Motion stack, so they coexist cleanly. Use Magic UI for landing page flourishes and mockups, and beUI for the app's controls, charts and agent chat surfaces. Both libraries can install a file with a similar name, such as a marquee or dock. If the shadcn CLI asks before overwriting a file, choose a different path for one of them or keep the version you prefer. ## When is Magic UI the better pick? Magic UI is the better pick when you are building a marketing or portfolio site and want a wide menu of eye-catching effects, background patterns and device frames, or when you want its paid templates to start a full page. Pick beUI when the work is inside the product: forms, menus, data visualization, AI chat, or a matching React Native app. ## Components - [Marquee](https://beui.dev/components/motion/marquee): Infinite horizontal or vertical scroll with pause-on-hover. - [Number Animation](https://beui.dev/components/motion/number): Animated number primitives for count-up values, rolling tickers, and fixed-slot digit swaps. - [Dock](https://beui.dev/components/motion/dock): macOS-style dock with grouped actions and a gliding active pill. - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. - [Theme Toggle](https://beui.dev/components/motion/theme-toggle): Theme toggle button that repaints the whole page through the View Transition API: a rectangle or circle clip-path reveal, or slats that open across the screen like a shutter. - [Button](https://beui.dev/components/motion/button): Spring-pressed Button plus StatefulButton, MagneticButton, and MetallicButton variants. ## FAQ ### Is Magic UI free? Magic UI's components are free and open source under the MIT license. It also sells Magic UI Pro blocks and templates. beUI is free and MIT licensed too. ### What is the difference between Magic UI and beUI? Both use React, Tailwind CSS and Framer Motion and install through the shadcn CLI. Magic UI leans toward landing page effects; beUI adds app primitives, charts, AI agent components and React Native versions. ### Can I install beUI the same way as Magic UI? Yes. Run npx shadcn@latest add @beui/ followed by a slug, for example @beui/number-ticker. beUI is in shadcn's official registry directory. ### Does beUI have a marquee and dock like Magic UI? Yes. beUI has an infinite horizontal or vertical marquee with pause on hover, and a macOS-style dock with grouped actions and a gliding active pill. ### Does beUI support React Native? Yes. beUI Native offers React Native versions of many components, built with Reanimated and Gesture Handler, installed with npx beui-native add. --- # A Motion Primitives alternative for React motion components URL: https://beui.dev/alternatives/motion-primitives Updated: 2026-10-18 Motion Primitives is an open-source UI kit of animated components built with Framer Motion and Tailwind CSS, with a focus on clean, reusable building blocks. beUI is built on the same foundation and shares that primitive-first approach, while covering more application controls, charts and AI agent interfaces. This page compares them side by side. ## beUI vs Motion Primitives | | beUI | Motion Primitives | | --- | --- | --- | | License | MIT, free and open source | MIT, open source | | Price | Free | Free; Motion-Primitives Pro sells premium components, sections and templates (as of October 2026) | | Install | shadcn CLI (npx shadcn@latest add @beui/) or copy the source from the page | Its own CLI (npx motion-primitives@latest add), shadcn registry as @motion-primitives, or manual | | Animation library | Framer Motion (the motion package), shared tokens in lib/ease.ts | Framer Motion (Motion) | | Styling | Tailwind CSS 4, TypeScript, React 19 | Tailwind CSS | | Focus | App primitives, charts, AI agent UI and composed blocks | Motion building blocks: text effects, number effects, dialogs, docks, toolbars | | React Native | Yes, beUI Native ports with Reanimated and Gesture Handler (npx beui-native add ) | Not listed on its site as of October 2026 | | AI agent components | Yes, a dedicated AI Agents category (messages, prompt input, tool approval, streaming, citations) | Not a category in its docs as of October 2026 | | Charts | Yes, a Charts category (treemap, candlestick, donut, funnel, heat calendar and more) | Not a category in its docs as of October 2026 | | Source ownership | Source copied into your repo; you own and edit it | Source copied into your project | Motion Primitives official site: https://motion-primitives.com ## What is Motion Primitives good at? Motion Primitives describes itself as a UI kit to make beautiful, animated interfaces faster: easy copy-paste, customizable and open source. Its docs group components into core components (accordion, animated background, carousel, dialog, disclosure, infinite slider), text effects (text effect, loop, morph, roll, scramble, shimmer), number effects, interactive elements such as dock, tilt and spotlight, toolbars, and advanced effects like morphing dialog, morphing popover and progressive blur. Each component has examples and documentation, and installs through its own CLI, the shadcn registry, or by hand. A Pro offering adds premium sections and templates. ## Where does beUI differ from Motion Primitives? The philosophy is close: small, composable motion pieces built on Framer Motion and Tailwind CSS that you copy and own. beUI pushes that approach into a larger surface of product UI. Its 107 web components include form and selection controls (select, combobox, multi select, checkbox, radio, sliders, wheel picker, OTP input), overlays (tooltip, popover, context menu, drawer, bottom sheet), Charts and an AI Agents category. Larger beUI components support controlled and uncontrolled state, overlays manage focus and keyboard input, and transform-based motion is gated behind useReducedMotion. Shared tokens in lib/ease.ts keep springs and easing consistent from one component to the next. ## How do I install a beUI component? beUI uses the shadcn CLI directly and is listed in its official registry directory as @beui. This example adds the text shimmer, a gradient sweep for loading or emphasis. You can add several components in one go. ```bash # once per project, if components.json does not exist yet npx shadcn@latest init npx shadcn@latest add @beui/text-shimmer npx shadcn@latest add @beui/dock ``` ## Can I use Motion Primitives and beUI together? Yes. Both depend on Framer Motion and Tailwind CSS and both write source into your project, so there is no runtime conflict and only one copy of Framer Motion is needed. You might keep a Motion Primitives morphing dialog or text effect you already like and add beUI for charts, agent chat or menus. To migrate a single piece, install the beUI equivalent, update the import and props at each call site, then delete the old file once nothing imports it. ## When is Motion Primitives the better pick? Motion Primitives is a strong pick when you want a focused, compact set of motion building blocks, such as its text effects, morphing dialog or progressive blur, and prefer its CLI and documentation style. Pick beUI when you need a broader catalog of product controls, data visualization, AI agent interfaces or React Native versions. ## Components - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. - [Dock](https://beui.dev/components/motion/dock): macOS-style dock with grouped actions and a gliding active pill. - [Tilt Card](https://beui.dev/components/motion/tilt-card): 3D perspective tilt on hover with cursor-tracked glare. - [Morphing Modal](https://beui.dev/components/motion/morphing-modal): Family-app-style modal. A single panel that morphs its height as you navigate between inner views, with blur cross-fade on content. - [Popover](https://beui.dev/components/motion/popover): Gooey popover whose panel oozes out of the trigger through an SVG goo filter with a liquid neck that stretches and pinches, then crisp content fades in on top. The Morph variant reveals its full-size panel from the corner nearest the trigger on one synchronized spring clip. Click or hover trigger, controlled or uncontrolled. - [Number Animation](https://beui.dev/components/motion/number): Animated number primitives for count-up values, rolling tickers, and fixed-slot digit swaps. ## FAQ ### Is Motion Primitives open source? Yes. Motion Primitives is open source under the MIT license, with a separate paid Pro offering. beUI is also MIT licensed and free. ### Do Motion Primitives and beUI both use Framer Motion? Yes. Both are built with Framer Motion (the motion package) and Tailwind CSS, so they share dependencies when used together. ### How do I install beUI components? Run npx shadcn@latest add @beui/ followed by a slug, such as @beui/text-shimmer, or copy the source from its beUI component page. ### Does beUI have text effects like Motion Primitives? Yes. beUI's text animations include spring word and character reveals, a chromatic sweep, shimmer, a letter cascade and a character scramble. ### Does beUI support reduced motion? Yes. beUI gates transform-based movement behind useReducedMotion and keeps opacity and color transitions so feedback still reads. --- # A React Bits alternative for animated React components URL: https://beui.dev/alternatives/react-bits Updated: 2026-10-18 React Bits is a free, open-source library of animated React components and backgrounds for creative developers, offered in JavaScript or TypeScript with plain CSS or Tailwind. beUI is a Framer Motion and Tailwind CSS library centered on product interfaces, charts and AI agent UI. Both install as source through the shadcn CLI. Here is how they compare. ## beUI vs React Bits | | beUI | React Bits | | --- | --- | --- | | License | MIT, free and open source | MIT + Commons Clause: free for personal and commercial apps, but the components themselves may not be sold or redistributed | | Price | Free | Free components and tools; a Pro section is linked from its site (as of October 2026) | | Install | shadcn CLI (npx shadcn@latest add @beui/) or copy the source from the page | shadcn CLI with the @react-bits namespace, or copy files by hand | | Language and styling | Tailwind CSS 4, TypeScript, React 19 | Four variants per component: JS or TS, with plain CSS or Tailwind | | Animation library | Framer Motion (the motion package), shared tokens in lib/ease.ts | Depends on the component; dependencies are listed on each page | | Focus | App primitives, charts, AI agent UI and composed blocks | Text animations, animations, backgrounds and micro interactions | | React Native | Yes, beUI Native ports with Reanimated and Gesture Handler (npx beui-native add ) | Not listed on its site as of October 2026 | | AI agent components | Yes, a dedicated AI Agents category (messages, prompt input, tool approval, streaming, citations) | Not a category on its site as of October 2026 | | AI tooling | MCP server, llms.txt and an agent skill | Copy for AI, Copy as Markdown, MCP via the shadcn MCP server, llms.txt | React Bits official site: https://reactbits.dev ## What is React Bits good at? React Bits is built for creative work. Its library is organized into text animations, animations, backgrounds and micro interactions, and every component comes in four flavors: JavaScript or TypeScript, styled with plain CSS or Tailwind. That flexibility is useful if your project does not use TypeScript or Tailwind. It also ships free creative tools on its site, including a background studio for tuning and exporting animated backgrounds, and it supports AI workflows with Copy for AI buttons, Markdown copies of docs pages, the shadcn MCP server and an llms.txt map. ## Where does beUI differ from React Bits? beUI is TypeScript and Tailwind CSS 4 only, and its components are built on one animation library, Framer Motion, with shared motion tokens. In exchange for that narrower stack you get a catalog aimed at the product itself: 107 web components across primitives such as select, combobox, tooltip and sliders, Charts, AI Agents, and composed Blocks. Licensing also differs. beUI uses the plain MIT license. React Bits uses MIT with the Commons Clause, which allows use in any app or product but does not allow selling or redistributing the components themselves. Read each license for your own case. - Transform-based motion gated behind useReducedMotion - Keyboard and focus handling on overlays and lists - React Native versions of many components through beUI Native ## How do I install a beUI component? React Bits and beUI both install through the shadcn CLI, so the workflow is the same. beUI is listed in shadcn's official registry directory as @beui. This command adds the shader background, a set of canvas shader variants whose animation freezes under reduced motion. ```bash # once per project, if components.json does not exist yet npx shadcn@latest init npx shadcn@latest add @beui/shader-background ``` ## Can I use React Bits and beUI together? Yes. Both copy source into your project, so a React Bits background or text animation can sit on the same page as beUI menus, charts and chat components. If you pick React Bits' Tailwind variants, both libraries share the same styling approach. Check the dependencies each React Bits component lists so you know which animation libraries end up in your bundle alongside Framer Motion. ## When is React Bits the better pick? React Bits is the better pick for creative and portfolio work that leans on striking backgrounds and text effects, for projects in plain JavaScript or plain CSS, and when its free design tools fit your workflow. Pick beUI when you need consistent product controls, charts, AI agent interfaces or React Native parity under a plain MIT license. ## Components - [Shader Background](https://beui.dev/components/motion/shader-background): Canvas shader backgrounds (mesh gradient, grain, warp, waves, voronoi, dot orbit and more) with a single typed variant prop. Reduced-motion freezes animated variants. - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. - [Cylinder Carousel](https://beui.dev/components/motion/cylinder-carousel): A carousel whose items line the inside of a cylinder, receding into the center and growing toward the edges. Drag, scroll or arrow-key to roll it, with a springy glide and snap. Reduced-motion drops the glide. - [Loader](https://beui.dev/components/motion/loader): Loading indicator with seventeen variants: spinner, dots, bars, dot-matrix, dither, morph, comet, scramble, metaballs, newton, helix, percent, and five terminal-style ascii spinners. Scales from one size prop, uses currentColor, and reduced-motion swaps every transform for a calm opacity pulse. - [Tilt Card](https://beui.dev/components/motion/tilt-card): 3D perspective tilt on hover with cursor-tracked glare. - [Marquee](https://beui.dev/components/motion/marquee): Infinite horizontal or vertical scroll with pause-on-hover. ## FAQ ### Is React Bits free for commercial use? Its site says it is free for personal and commercial work under MIT + Commons Clause, with the restriction that the components themselves may not be sold or redistributed. beUI is plain MIT. ### Does beUI offer JavaScript or plain CSS versions? No. beUI components are written in TypeScript and styled with Tailwind CSS 4. React Bits offers JS and TS with CSS or Tailwind variants. ### Can I install beUI with the shadcn CLI like React Bits? Yes. Run npx shadcn@latest add @beui/ followed by a slug, for example @beui/shader-background. ### Does beUI have animated backgrounds? Yes. beUI's shader background offers canvas variants such as mesh gradient, grain, warp, waves and voronoi through a single typed variant prop. ### Can React Bits and beUI be used in one project? Yes. Both install as source files you own, so they can be mixed freely on the same page. --- # An Animata alternative for animated React components URL: https://beui.dev/alternatives/animata Updated: 2026-10-18 Animata is a free, open-source collection of hand-crafted animations, effects and interactions for React and Tailwind CSS that you copy into your project. beUI is also free and open source, on Tailwind CSS and Framer Motion, with more emphasis on full interface components, charts and AI agent UI. This page lays out the differences. ## beUI vs Animata | | beUI | Animata | | --- | --- | --- | | License | MIT, free and open source | MIT, free and open source | | Price | Free | Free | | Install | shadcn CLI (npx shadcn@latest add @beui/) or copy the source from the page | shadcn CLI with a component URL, or manual copy-paste | | Animation library | Framer Motion (the motion package), shared tokens in lib/ease.ts | Framer Motion (the motion package) and Tailwind CSS animation utilities | | Styling | Tailwind CSS 4, TypeScript, React 19 | Tailwind CSS for layout; colors and fonts left to you | | Focus | App primitives, charts, AI agent UI and composed blocks | Animations, effects and interactions to enhance an existing design | | Charts | Yes, a Charts category (treemap, candlestick, donut, funnel, heat calendar and more) | Has a graphs and charts section (bar, donut, gauge, ring) | | React Native | Yes, beUI Native ports with Reanimated and Gesture Handler (npx beui-native add ) | Not listed on its site as of October 2026 | | AI agent components | Yes, a dedicated AI Agents category (messages, prompt input, tool approval, streaming, citations) | Not a category on its site as of October 2026 | Animata official site: https://animata.design ## What is Animata good at? Animata is clear about its scope: it is not a full UI library like Material UI or Chakra UI, but a collection of animations and effects you add to an existing design. It uses Tailwind CSS for layout and deliberately leaves colors and fonts to you, so its pieces blend into your own look. Its catalog is especially deep in text animations, with dozens of styles such as blur out, mask reveal, per-character rise and glitch text, plus buttons, backgrounds, bento grids, a marquee and simple charts. Components install with the shadcn CLI using a component URL, or by copying the code. ## Where does beUI differ from Animata? beUI is closer to a full interface kit. Alongside motion effects it ships complete controls with state and keyboard handling: select, combobox, tooltip, popover, context menu, tabs, sliders, date range picker, OTP input and more. Larger components support controlled and uncontrolled state. Its Charts category goes further into data views such as treemap, candlestick, funnel and heat calendar, and its AI Agents category covers chat messages, prompt input, tool approval and streaming responses. beUI is in shadcn's official registry directory as @beui, so installs use a short namespaced name instead of a URL. - Shared motion tokens for consistent springs and easing - Movement gated behind useReducedMotion - React Native versions of many components through beUI Native ## How do I install a beUI component? Run the shadcn CLI with the @beui namespace. This example adds the donut chart, a composable share ring with legend rows and a center readout. ```bash # once per project, if components.json does not exist yet npx shadcn@latest init npx shadcn@latest add @beui/donut-chart ``` ## Can I use Animata and beUI together? Yes. Both are Tailwind CSS and Framer Motion source you copy into your project, so they combine without a shared runtime. Animata's text and button effects pair well with beUI's controls, charts and agent components on the same screen. When swapping one component for the other, install the beUI version, update the imports and props where it is used, then remove the old file. ## When is Animata the better pick? Animata is the better pick when you already have a design system and only want effects layered on top, especially a wide choice of text animations that inherit your own colors and fonts. Pick beUI when you need complete, stateful controls, richer charts, AI agent interfaces or React Native versions. ## Components - [Text Animation](https://beui.dev/components/motion/text-animation): Animated text primitives for spring reveals, chromatic sweeps, shimmer loading states, letter-cascade swaps and character scrambles. - [Donut Chart](https://beui.dev/charts/donut-chart): Rounded share segments with a linked center readout and legend. - [Composition Chart](https://beui.dev/charts/composition-chart): Stacked bar and area shares with period tooltips and a compact interactive legend. - [Marquee](https://beui.dev/components/motion/marquee): Infinite horizontal or vertical scroll with pause-on-hover. - [Button](https://beui.dev/components/motion/button): Spring-pressed Button plus StatefulButton, MagneticButton, and MetallicButton variants. - [Loader](https://beui.dev/components/motion/loader): Loading indicator with seventeen variants: spinner, dots, bars, dot-matrix, dither, morph, comet, scramble, metaballs, newton, helix, percent, and five terminal-style ascii spinners. Scales from one size prop, uses currentColor, and reduced-motion swaps every transform for a calm opacity pulse. ## FAQ ### Is Animata free and open source? Yes. Animata describes itself as a free and open-source collection, and its repository uses the MIT license. beUI is free and MIT licensed as well. ### Can I install Animata and beUI with the shadcn CLI? Yes. Animata pages give a shadcn command with a component URL. beUI uses its registry namespace: npx shadcn@latest add @beui/donut-chart, for example. ### Is beUI a full UI library? beUI covers interface primitives such as select, combobox, tooltip and tabs, plus charts, AI agent components and blocks, so it can serve as more than an effects collection. ### Does beUI have text animations like Animata? Yes. beUI includes spring word and character reveals, chromatic sweep, shimmer, letter cascade and scramble text components. ### Does beUI work with React Native? Yes. beUI Native provides React Native versions of many components, installed with npx beui-native add. --- # Animated shadcn/ui components that install with the same CLI URL: https://beui.dev/alternatives/shadcn-ui-animated Updated: 2026-10-18 shadcn/ui is an open-code set of accessible components and a code distribution system that many React apps are built on. beUI is not a replacement for it. It is a free, MIT-licensed registry of animated components listed in shadcn's official registry directory as @beui, so you can add Framer Motion polish with the CLI you already use. ## beUI vs shadcn/ui | | beUI | shadcn/ui | | --- | --- | --- | | What it is | A registry of animated components, charts, AI agent UI and blocks | Open-code components plus a schema and CLI for distributing code; how you build your component library | | License | MIT, free and open source | MIT, open source | | Install | npx shadcn@latest add @beui/ | npx shadcn@latest add ; third-party registries via @namespace | | Animation | Framer Motion springs and gestures, shared tokens in lib/ease.ts | CSS transitions and animation utilities (tw-animate-css with Tailwind CSS v4) | | Styling | Tailwind CSS 4, TypeScript, React 19 | Tailwind CSS with theme CSS variables | | Primitives | Built in beUI's own source on Framer Motion | Component versions for Radix UI and Base UI | | React Native | Yes, beUI Native ports with Reanimated and Gesture Handler (npx beui-native add ) | Not listed in its docs as of October 2026 | | Reduced motion | Movement gated behind useReducedMotion; opacity and color transitions stay | Mostly CSS animation; follow its docs per component | | AI tooling | MCP server, llms.txt and an agent skill | MCP server, skills and llms.txt | shadcn/ui official site: https://ui.shadcn.com ## What is shadcn/ui good at? shadcn/ui describes itself as a set of beautifully designed, accessible components and a code distribution platform, and says plainly that it is not a component library but how you build your own. You get the source for every component, consistent composable APIs, strong defaults and a CLI that copies code into your project. It also defines the registry format that lets anyone publish components the CLI can install. Its registry directory lists community registries under namespaces such as @beui, which is why the rest of this page works with no extra setup. For most apps, shadcn/ui is the right foundation, and it is where to start. ## What does beUI add on top of shadcn/ui? beUI focuses on motion. Its components use Framer Motion springs and gestures where shadcn/ui components generally use CSS transitions: tabs with a spring indicator that glides between triggers, a select panel that unfolds from its trigger, a switch with a spring-driven thumb, tooltips with scale-and-fade entry, and a combobox whose active row glides as you move through results. It also covers areas outside a base component set: Charts such as treemap and candlestick, an AI Agents category with messages, prompt input and tool approval, and Blocks like a command palette and dynamic island. Transform-based motion is gated behind useReducedMotion, and React Native versions of many components are available through beUI Native. ## How do I add animated components to a shadcn/ui project? If your project already has a components.json from shadcn init, skip the first command. Each beUI component installs its own files, and any internal helpers it imports, into your project. ```bash # once per project, if components.json does not exist yet npx shadcn@latest init npx shadcn@latest add @beui/tabs npx shadcn@latest add @beui/select npx shadcn@latest add @beui/tooltip ``` ## Can beUI and shadcn/ui components live in the same app? Yes, that is the intended setup. Both copy source into your repo and both use Tailwind CSS, so you can keep shadcn/ui as your base and use beUI only where motion helps, for example animated tabs on a settings page or a spring select in a signup flow. beUI motion components install under components/motion, while shadcn/ui components usually live under components/ui, so files with similar names do not collide. Import each from its own path, and swap one component at a time if you want to compare the feel. ## When should I stick with plain shadcn/ui? Stick with shadcn/ui when you want the widest set of base components, the fewest dependencies, or CSS-only transitions. It covers far more form, layout and data components than an animation library aims to, and its Radix UI and Base UI versions give you a choice of primitive. Reach for beUI when a specific interaction should feel physical, or when you want animated charts and agent UI that install the same way. ## Components - [Tabs](https://beui.dev/components/motion/tabs): Pill, segment or underline tabs with a spring layoutId indicator and optional icons. - [Select](https://beui.dev/components/motion/select): Composable select primitives whose panel unfolds out of the trigger on one spring and pulls away into its own pill, plus a Morph variant where the trigger grows into the panel via shared layout. - [Switch](https://beui.dev/components/motion/switch): Toggle with a spring-driven thumb and press feedback. - [Tooltip](https://beui.dev/components/motion/tooltip): Composable hover, focus and tap tooltip with a subtle scale and fade, collision-aware side and alignment, an optional arrow, a pointer corridor onto hoverable content, one label at a time, keyboard-only focus reveal and optional cursor tracking. - [Combobox](https://beui.dev/components/motion/combobox): Searchable combobox with a morphing portal, grouped filtering, keyboard navigation, and controlled or uncontrolled state. - [Popover](https://beui.dev/components/motion/popover): Gooey popover whose panel oozes out of the trigger through an SVG goo filter with a liquid neck that stretches and pinches, then crisp content fades in on top. The Morph variant reveals its full-size panel from the corner nearest the trigger on one synchronized spring clip. Click or hover trigger, controlled or uncontrolled. ## FAQ ### Does shadcn/ui have animated components? shadcn/ui components use CSS transitions and Tailwind animation utilities. For spring-based Framer Motion versions, registries such as beUI install through the same shadcn CLI. ### How do I install beUI with the shadcn CLI? Run npx shadcn@latest add @beui/ followed by a component slug, for example @beui/tabs. beUI is listed in shadcn's official registry directory. ### Is beUI a replacement for shadcn/ui? No. beUI is designed to sit alongside shadcn/ui and adds animated components, charts and AI agent UI where you want motion. ### Do beUI components work with Tailwind CSS v4? Yes. beUI is built with Tailwind CSS 4, React 19, TypeScript and Framer Motion. ### Is beUI free? Yes. beUI is free and open source under the MIT license, like shadcn/ui. ### Do animated beUI components respect reduced motion? Yes. Movement is gated behind useReducedMotion, while opacity and color transitions remain so feedback is still visible. --- # How to Build a Command Palette in React (Cmd+K) URL: https://beui.dev/blog/react-command-palette Published: 2026-11-30 Your app has dozens of actions spread across menus. Power users want one shortcut that gets them anywhere. A react command palette fixes that. Press Cmd+K, type two letters, press Enter. It looks like an input and a list. The hard part is everything around it: keyboard handling, focus, screen readers and an animation that never feels slow. This guide builds one from scratch in under 200 lines, then shows the finished version in [beUI](https://beui.dev) you can install with one command. ## What does a React command palette need? Before writing code, list the behavior. A palette people trust does all of this: - Opens with Cmd+K on macOS and Ctrl+K elsewhere, from anywhere on the page. - Renders as a modal dialog with the search field focused. - Filters the commands as you type. - Moves an active row with the arrow keys, while focus stays in the input. - Runs the active command on Enter and closes on Escape or a backdrop click. - Returns focus to whatever was focused before it opened. - Tells screen readers what is going on, using a combobox that controls a listbox. - Animates in and out fast, and drops the movement for people who ask for reduced motion. ## How do you build a command palette in React? Here is the whole component. It uses React 19, Tailwind CSS 4 and Framer Motion (imported from `motion/react`). ```tsx title="command-palette.tsx" "use client"; import { AnimatePresence, motion, useReducedMotion } from "motion/react"; import { useEffect, useId, useRef, useState } from "react"; export type Command = { id: string; label: string; run: () => void; }; const EASE_OUT = [0.16, 1, 0.3, 1] as const; export function CommandPalette({ commands }: { commands: Command[] }) { const [open, setOpen] = useState(false); const [query, setQuery] = useState(""); const [activeId, setActiveId] = useState(null); const returnFocus = useRef(null); const listId = useId(); const reduce = useReducedMotion(); const openPalette = () => { returnFocus.current = document.activeElement as HTMLElement | null; setQuery(""); setActiveId(null); setOpen(true); }; const closePalette = () => { setOpen(false); returnFocus.current?.focus(); }; // Cmd+K on macOS, Ctrl+K everywhere else. Toggles from anywhere. useEffect(() => { const onKey = (e: KeyboardEvent) => { if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") { e.preventDefault(); if (open) closePalette(); else openPalette(); } }; window.addEventListener("keydown", onKey); return () => window.removeEventListener("keydown", onKey); }, [open]); const q = query.trim().toLowerCase(); const results = q ? commands.filter((c) => c.label.toLowerCase().includes(q)) : commands; // Resolve the active row during render: the stored id if it is still // in the results, otherwise the first row. const found = results.findIndex((c) => c.id === activeId); const active = results[found === -1 ? 0 : found]; const move = (delta: number) => { setActiveId((prev) => { if (results.length === 0) return null; const i = results.findIndex((c) => c.id === prev); const from = i === -1 ? 0 : i; return results[(from + delta + results.length) % results.length].id; }); }; const runCommand = (command: Command) => { closePalette(); command.run(); }; useEffect(() => { if (!active) return; document .getElementById(`${listId}-${active.id}`) ?.scrollIntoView({ block: "nearest" }); }, [active, listId]); const onKeyDown = (e: React.KeyboardEvent) => { if (e.key === "ArrowDown") { e.preventDefault(); move(1); } else if (e.key === "ArrowUp") { e.preventDefault(); move(-1); } else if (e.key === "Enter") { if (e.nativeEvent.isComposing) return; e.preventDefault(); if (active) runCommand(active); } else if (e.key === "Escape") { e.preventDefault(); closePalette(); } else if (e.key === "Tab") { // The input is the only focusable element, so keep focus inside. e.preventDefault(); } }; return ( {open && ( )} {open && ( { setQuery(e.target.value); setActiveId(null); }} onKeyDown={onKeyDown} placeholder="Type a command…" role="combobox" aria-expanded="true" aria-controls={listId} aria-autocomplete="list" aria-activedescendant={active ? `${listId}-${active.id}` : undefined} className="h-12 w-full border-b bg-transparent px-4 text-sm outline-none" />
      {results.map((command) => (
    • setActiveId(command.id)} onMouseDown={(e) => e.preventDefault()} onClick={() => runCommand(command)} className="cursor-pointer rounded-lg px-3 py-2 text-sm aria-selected:bg-neutral-100 dark:aria-selected:bg-neutral-800" > {command.label}
    • ))}
    {results.length === 0 && (

    No results

    )}
    )}
    ); } ``` And using it: ```tsx title="app.tsx" import { CommandPalette, type Command } from "./command-palette"; const commands: Command[] = [ { id: "home", label: "Go to home", run: () => window.location.assign("/") }, { id: "settings", label: "Open settings", run: () => window.location.assign("/settings") }, { id: "theme", label: "Toggle dark mode", run: () => document.documentElement.classList.toggle("dark"), }, ]; export function App() { return ; } ``` ## Why resolve the active row during render? The tempting version stores an index and resets it in a `useEffect` when the query changes. That leaves a gap: for one commit the index points at a row that moved or no longer exists. Press Enter in that window and you run the wrong command. This palette stores the active command's **id**, not its position, and works out the row in render. If the id is gone from the results, the first row is active. Typing clears the id, so the first match is always the default. The arrow keys use a functional update, so two quick presses move two rows. ## How do you make a command palette accessible? Focus never leaves the input. The arrow keys change `aria-activedescendant`, which tells screen readers which `role="option"` is active without moving focus. The input is a `role="combobox"` that points at the `role="listbox"` through `aria-controls`, and the whole panel is a `role="dialog"` with `aria-modal`. Three details are easy to miss: - **Focus return.** `openPalette` saves `document.activeElement`, and `closePalette` focuses it again. Without this, keyboard users land at the top of the page after every command. - **Mouse without stealing focus.** `onMouseDown` calls `preventDefault`, so clicking a row never blurs the input. - **IME input.** The `isComposing` check stops Enter from running a command while someone is confirming a Japanese or Chinese character. ## How do you animate a command palette with Framer Motion? `AnimatePresence` keeps the backdrop and panel mounted until their `exit` animations finish. The panel fades, drops 8px and scales from 0.96 in 180ms, and leaves faster in 120ms. A palette you open many times a day has to feel instant, so keep it short. `useReducedMotion()` returns true when the user turned on reduced motion. The panel then skips the `y` and `scale` change and only fades. The CSS media query can't stop JS-driven animations, so the hook is what does the work. The [reduced motion guide](https://beui.dev/guides/reduced-motion-framer-motion) covers the pattern in more depth. What this version leaves out: page scroll lock while open, grouped results, ranked fuzzy search and a portal so a transformed parent can't trap the fixed layer. Those are the next things you will want. ## Using the beUI command palette The [beUI command palette](https://beui.dev/components/blocks/command-palette) is a finished version of the same idea. It adds grouped results, ranked search over labels, groups and keywords, icons, shortcut hints, a spring-animated active row, scroll lock and a portal to ``. It uses the same combobox and listbox roles and respects reduced motion. Install it with the shadcn CLI: ```bash npx shadcn@latest add @beui/command-palette ``` Then pass it a list of items. Each item takes an `id`, a `label`, an `onSelect` callback and optional `group`, `icon`, `hint` and `keywords`: ```tsx title="app-command-palette.tsx" "use client"; import { FileText, Home, Plus, Settings, User } from "lucide-react"; import { useState } from "react"; import { CommandPalette } from "@/components/motion/command-palette"; export function AppCommandPalette() { const [open, setOpen] = useState(false); return ( <> {} }, { id: "profile", label: "Open profile", group: "Navigation", icon: User, hint: "G P", onSelect: () => {} }, { id: "settings", label: "Settings", group: "Navigation", icon: Settings, onSelect: () => {} }, { id: "new-doc", label: "Create document", group: "Actions", icon: FileText, hint: "⌘ N", onSelect: () => {} }, { id: "new-project", label: "New project", group: "Actions", icon: Plus, hint: "⌘ ⇧ N", onSelect: () => {} }, ]} /> ); } ``` Cmd+K or Ctrl+K opens it by default. Pass `shortcut="j"` to use a different key. Leave out `open` and `onOpenChange` and it manages its own state. Every visible string, including the placeholder and the screen reader labels, can be replaced through the `labels` prop for translations. If you want search that grows out of a field instead of a centered dialog, look at [morphing search](https://beui.dev/components/blocks/morphing-search). ## FAQ ### What is the best way to add a Cmd+K menu in React? Listen for `keydown` on `window`, check `metaKey || ctrlKey` with the `k` key, and call `preventDefault` so the browser shortcut does not fire. Render the palette as a modal dialog with the input focused. ### Which ARIA roles should a command palette use? A `dialog` with `aria-modal` around a `combobox` input that controls a `listbox` of `option` elements. Point `aria-activedescendant` at the active option so focus can stay in the input. ### Should a command palette use fuzzy search? For a short list, a simple `includes` match is fine. Once you have many commands, ranked matching over labels and keywords helps, which is what the beUI palette does. ## Takeaway A command palette is small, but every detail is visible to keyboard users: the active row, where focus goes and how fast it opens. Get those right first, then add the motion. Grab the finished one from [beUI](https://beui.dev): ```bash npx shadcn@latest add @beui/command-palette ``` --- # 7 Framer Motion Examples You Can Copy Into Your React App URL: https://beui.dev/blog/framer-motion-examples-react Published: 2026-11-28 Most Framer Motion examples online are a box that fades in. You will rarely ship that. The motion people notice in real apps is smaller. A tab pill slides. A button gives a little under your finger. A toast leaves and the list closes the gap without jumping. Here are seven Framer Motion examples for real React UI. Each one has a short snippet you can paste, and a link to the full component in [beUI](https://beui.dev) if you want the finished version with keyboard support and reduced motion handled. All snippets import from `motion/react`, the current package name for Framer Motion. ## 1. Sliding tab indicator with layoutId Render the indicator only inside the active tab and give it the same `layoutId` every time. When the active tab changes, Framer Motion sees one element that moved and animates it from the old box to the new one. ```tsx title="tabs.tsx" "use client"; import { motion } from "motion/react"; import { useState } from "react"; const tabs = ["Overview", "Activity", "Settings"]; export function Tabs() { const [active, setActive] = useState(tabs[0]); return (
    {tabs.map((tab) => ( ))}
    ); } ``` One catch: a fixed `layoutId` string is shared across the whole page. Two tab bars on one page will fight over the same pill. Build the id with `useId()` per instance. The [beUI Tabs](https://beui.dev/components/motion/tabs) component does this, and adds pill, segment and underline styles, icons and arrow key navigation. The [animated tabs guide](https://beui.dev/guides/framer-motion-animated-tabs) goes deeper on the technique. ## 2. Press feedback with whileTap A button that scales down a little on press feels physical. The trick is keeping it small and fast. Scale to 0.97 or 0.98, not 0.9, and use a stiff spring so it settles in about 100ms. ```tsx title="press-button.tsx" "use client"; import { motion, useReducedMotion } from "motion/react"; export function PressButton({ children }: { children: React.ReactNode }) { const reduce = useReducedMotion(); return ( {children} ); } ``` That spring is the same press spring beUI uses across its buttons. See the variants on the [Button page](https://beui.dev/components/motion/button). ## 3. Exit animations in a list with AnimatePresence Removing an item from a list is where most UIs snap. `AnimatePresence` keeps the removed item mounted while it plays `exit`. Add `layout` to each item and `mode="popLayout"` to the presence, and the items below slide up into the gap instead of jumping. ```tsx title="toast-list.tsx" "use client"; import { AnimatePresence, motion } from "motion/react"; type Toast = { id: string; text: string }; export function ToastList({ toasts }: { toasts: Toast[] }) { return (
      {toasts.map((toast) => ( {toast.text} ))}
    ); } ``` The exit (150ms) is faster than the entrance (220ms). A toast the user dismissed should not hang around. The [Animated Toast Stack](https://beui.dev/components/motion/animated-toast-stack) builds on this with stacking, status changes, actions and swipe to dismiss. ## 4. Hold to confirm button For destructive actions, a hold is a nice middle ground between a plain click and a confirm dialog. A fill grows while the pointer is down, and the action runs only when the fill completes. Let go early and it drains back. Writing this by hand means pointer events, keyboard holds, cancel on pointer leave and a linear fill timed to the hold. beUI ships it as a component: ```bash npx shadcn@latest add @beui/hold-action-button ``` ```tsx title="delete-project.tsx" import { HoldActionButton } from "@/components/motion/hold-action-button"; export function DeleteProject({ onDelete }: { onDelete: () => void }) { return ( Hold to delete ); } ``` It also has a `type` prop for a vertical or horizontal fill, and with reduced motion the fill fades instead of moving. ## 5. Rolling number digits Prices, counters and stats read better when each digit rolls instead of the whole number swapping. Split the number into characters and give each one its own `AnimatePresence`, keyed by the digit. ```tsx title="digit.tsx" "use client"; import { AnimatePresence, motion } from "motion/react"; export function Digit({ value }: { value: string }) { return ( {value} ); } ``` Use `tabular-nums` so the width stays the same as digits change, or the text around it will shift. The [Number Animation page](https://beui.dev/components/motion/number) has three versions: Digit Swap, a slot machine style Number Ticker, and a count up that starts when it scrolls into view. ## 6. A gliding highlight in a menu The tab trick works for hover too. Track which row is highlighted and render one `layoutId` highlight inside it. As the pointer or arrow keys move, the highlight glides between rows instead of blinking. Two details matter here. Drive the highlight from the same state as keyboard focus, so mouse and keyboard never show two different rows. And scope the `layoutId` per menu level, so a submenu does not steal its parent's highlight. The [Dropdown Menu](https://beui.dev/components/motion/dropdown-menu) does both, with submenus, checkbox and radio items and shortcuts. ## 7. A panel that morphs between views Multi-step modals often jump in size when the content changes. Put `layout` on the panel and Framer Motion animates the size change with transforms. Cross-fade the inner content with `AnimatePresence` and a small blur so the old and new views blend. ```tsx title="panel.tsx" {views[step]} ``` Keep blur at 10px or less. Large blurs get expensive, especially on phones. The [Morphing Modal](https://beui.dev/components/motion/morphing-modal) is the full version of this pattern. ## Framer Motion and reduced motion Every example above should respect the "reduce motion" setting. A CSS media query will not stop a JS spring, so check `useReducedMotion()` and drop the movement: keep opacity and color changes, remove slides and scales. The [reduced motion guide](https://beui.dev/guides/reduced-motion-framer-motion) covers the pattern in more detail. ## FAQ ### Is Framer Motion the same as Motion? Yes. Framer Motion was renamed to Motion, and the React API now imports from `motion/react`. The components and props in these examples are the same ones Framer Motion has had. ### How do I animate height in Framer Motion? Use the `layout` prop rather than animating `height` directly. Framer Motion measures the new size and animates it with transforms, which is cheaper than animating a layout property every frame. ### Why does my exit animation not play? The element must be a direct child of `AnimatePresence` and have a unique `key`. If you conditionally render `AnimatePresence` itself, it unmounts with the child and the exit never runs. ### Can I use these with shadcn/ui? Yes. beUI is listed in the shadcn registry as `@beui`, so its components install with the same CLI into your project as plain source. ## Takeaway You do not need big animations. Most of the feel comes from a shared `layoutId`, a stiff press spring, exits that are quicker than entrances, and a reduced motion fallback. Copy the snippets to start, or install the finished components and edit the source to fit your app. Browse all of them at [beui.dev](https://beui.dev). To start with the tabs: ```bash npx shadcn@latest add @beui/tabs ``` --- # Best React Native Animation Libraries in 2027 URL: https://beui.dev/blog/best-react-native-animation-libraries-2027 Published: 2026-11-26 Your app works. It also feels stiff. Buttons don't react to a press, sheets snap open, lists jump when a row goes away. So you go looking for React Native animation libraries. You find a dozen of them, half built on top of the other half. This post sorts them out: what each one is, its license, what it's best at, and which one to reach for. Eight entries. Most real apps use two or three of them together. ## What makes a good React Native animation library? Before the list, the things that matter on a phone: - **Runs off the JS thread.** If an animation waits on JavaScript, a busy render drops frames. The good libraries run animation code on the UI thread. - **Works with gestures.** Touch UI is drag, swipe and release. The animation has to follow a finger and pick up its speed on release. - **Respects reduced motion.** iOS and Android both have a system setting for it. Your library should make it easy to read. - **Fits the New Architecture.** Current versions of the big libraries require it. Check before you upgrade. ## 1. Reanimated [Reanimated](https://docs.swmansion.com/react-native-reanimated/) from Software Mansion is the default answer for custom animation in React Native. MIT licensed. You write animation logic as worklets that run on the UI thread, drive styles from shared values, and get springs, timing curves, layout animations (`entering`, `exiting`, `layout`) and a reduced motion hook out of the box. Reanimated 4 adds a CSS-style animations and transitions API on top of the worklet API. Things to know: Reanimated 4 runs only on the New Architecture and needs `react-native-worklets` installed next to it. Apps still on the old architecture stay on Reanimated 3. **Best for:** anything custom. Press feedback, sheets, drag and drop, shared values driven by gestures or scroll. ## 2. Gesture Handler [React Native Gesture Handler](https://docs.swmansion.com/react-native-gesture-handler/), also from Software Mansion and MIT licensed, is not an animation library. It's the gesture partner to Reanimated: pans, taps, long presses, pinches, recognized natively, with callbacks that can run on the UI thread. Gesture Handler 3 moved to a hook-based API (`usePanGesture`, `useTapGesture` and so on) in place of the `Gesture.Pan()` builder, and renamed some callbacks (`onStart` became `onActivate`). If you follow an older tutorial, check the upgrade guide. **Best for:** swipe to delete, draggable sheets, carousels, anything that tracks a finger. ## 3. The built-in Animated API `Animated` ships with React Native. Nothing to install. It has `Animated.timing`, `Animated.spring`, `Animated.sequence`, interpolation, and `useNativeDriver: true`, which hands transform and opacity animations to the native side. The limits: the native driver doesn't cover layout properties, and anything that has to react to a gesture or to JS state mid-flight gets awkward fast. **Best for:** a fade or slide in a small app where you don't want another dependency. ## 4. Moti [Moti](https://moti.fyi/) is a declarative layer on Reanimated. MIT licensed. You write `` and it handles the rest, including mount and unmount animations and skeleton loaders. Things to know: Moti describes itself as powered by Reanimated 3, and its latest npm release is from January 2025. If you're on Reanimated 4, test it in your project and check its GitHub issues before you commit to it. **Best for:** teams who like a props-only, Framer Motion style API and are on a stack it supports. ## 5. React Native Skia [React Native Skia](https://shopify.github.io/react-native-skia/) from Shopify brings the Skia 2D graphics engine to React Native. MIT licensed. You draw with paths, gradients, shaders, blur and text on a canvas, and animate it with Reanimated shared values. It's a different tool from the rest of this list. You're not animating views, you're drawing pixels. **Best for:** charts, custom loaders, shader effects, generative visuals, anything a `View` can't draw. ## 6. Lottie for React Native [lottie-react-native](https://github.com/lottie-react-native/lottie-react-native) plays animations designers build in After Effects and export as Lottie files. Apache-2.0 licensed. You get pixel-exact playback of a designer's animation with play, pause, progress and loop control. You don't get much interactivity beyond that. **Best for:** onboarding illustrations, empty states, success animations made by a designer. ## 7. Rive [Rive](https://rive.app/docs/runtimes/react-native) is a design tool plus open runtimes for playing what you make in it. The React Native runtime is MIT licensed; the editor is Rive's own product with its own plans. Rive animations are interactive. State machines and data binding let the animation react to input and app state. Rive now recommends its new `@rive-app/react-native` package, built on Nitro Modules, over the older `rive-react-native` package, so start new projects on the new one. **Best for:** interactive illustrations, animated mascots, icons with several states. ## 8. beUI Native [beUI Native](https://beui.dev/react-native) is a set of ready-made animated components for React Native and Expo, built on Reanimated, Gesture Handler and Uniwind. Free and open source. It's not an animation engine. It's the layer above one: a [spring-pressed button](https://beui.dev/react-native/button), a [swipeable list](https://beui.dev/react-native/swipeable-list) with row actions, [toasts](https://beui.dev/react-native/toast) that stack and swipe away, and more. Each one handles reduced motion and screen readers. You install the source into your app: ```bash npx beui-native add button ``` The CLI writes the component files into your project and installs the libraries it needs. You own the code and can change any of it. **Best for:** shipping common interactive components without building the motion and accessibility yourself. ## React Native animation libraries compared | Library | License | Runs on | Best for | | --- | --- | --- | --- | | Reanimated | MIT | UI thread (worklets) | Custom animation of any kind | | Gesture Handler | MIT | Native gesture system | Gestures that drive animation | | Animated | Ships with React Native | Native driver for transform and opacity | Simple fades and slides | | Moti | MIT | Reanimated | Declarative mount and state animations | | React Native Skia | MIT | Skia canvas | Drawn graphics, shaders, charts | | Lottie | Apache-2.0 | Native Lottie players | Designer-made playback | | Rive | MIT runtime | Rive renderer | Interactive, stateful illustrations | | beUI Native | Free, open source | Reanimated + Gesture Handler | Ready-made animated components | ## Which React Native animation library should you use? Short version: - **Building custom motion?** Reanimated. Add Gesture Handler as soon as a finger is involved. - **One fade in a small app?** The built-in `Animated` API is fine. - **Drawing, not moving views?** Skia. - **A designer handed you an animation file?** Lottie for After Effects exports, Rive for interactive work made in Rive. - **You need a button, a list, a toast, an OTP field?** Start from beUI Native and edit the source. These aren't rivals. A typical app uses Reanimated plus Gesture Handler for its own interactions, Lottie or Rive for a few illustrations, and ready-made components for the common parts. ## A Reanimated press scale example Here is the smallest useful Reanimated animation: a button that scales down on press with a spring, and dims instead when the user has reduced motion turned on. ```tsx title="press-scale-button.tsx" import { Pressable, StyleSheet, Text } from "react-native"; import Animated, { useAnimatedStyle, useReducedMotion, useSharedValue, withSpring, withTiming, } from "react-native-reanimated"; const AnimatedPressable = Animated.createAnimatedComponent(Pressable); const PRESS_SPRING = { damping: 20, stiffness: 400 }; export function PressScaleButton({ label, onPress, }: { label: string; onPress: () => void; }) { const reduceMotion = useReducedMotion(); const scale = useSharedValue(1); const opacity = useSharedValue(1); const animatedStyle = useAnimatedStyle(() => ({ opacity: opacity.value, transform: [{ scale: scale.value }], })); function pressIn() { if (reduceMotion) opacity.value = withTiming(0.7, { duration: 100 }); else scale.value = withSpring(0.96, PRESS_SPRING); } function pressOut() { opacity.value = withTiming(1, { duration: 150 }); scale.value = withSpring(1, PRESS_SPRING); } return ( {label} ); } const styles = StyleSheet.create({ button: { alignItems: "center", backgroundColor: "#2563eb", borderRadius: 12, paddingHorizontal: 20, paddingVertical: 12, }, label: { color: "#fff", fontSize: 16, fontWeight: "600" }, }); ``` What's going on: - `useSharedValue` holds the scale on the UI thread, so the press never waits on a React render. - `useAnimatedStyle` maps the shared values to a style, again on the UI thread. - `withSpring` gives the press a physical feel and handles interruption. Press and release fast and it just reverses from wherever it is. - `useReducedMotion` reads the system setting once. With it on, the button dims rather than moves. ## FAQ ### Is Reanimated better than the Animated API? For anything beyond a simple fade or slide, yes. Reanimated runs animation logic on the UI thread, works with gestures, and has layout animations. `Animated` is built in and fine for small, non-interactive animations. ### Does Reanimated 4 work with Expo? Yes, on the New Architecture. Install it with `npx expo install react-native-reanimated react-native-worklets`. Apps on the old architecture need Reanimated 3. ### Should I use Lottie or Rive in React Native? Use Lottie if your designers work in After Effects and you need playback. Use Rive if the animation has to react to input or app state, since its state machines handle that in the file itself. ### Are there ready-made animated components for React Native? Yes. [beUI Native](https://beui.dev/react-native) has free animated components built on Reanimated and Gesture Handler that you install as source, so you can edit them. ## Takeaway Pick Reanimated and Gesture Handler as your base. Add Skia, Lottie or Rive when the job is drawing or playing designed animation. Don't hand-build the same button, list and toast every project. Browse the components at [beui.dev/react-native](https://beui.dev/react-native), follow the [setup guide](https://beui.dev/docs/native-setup), then add your first one: ```bash npx beui-native add swipeable-list ``` --- # Best React Component Libraries in 2027 (Free and Paid) URL: https://beui.dev/blog/best-react-component-libraries-2027 Published: 2026-11-23 Picking from the best React component libraries is a decision you live with for years. Pick the wrong one and you spend months fighting its styles, its bundle or its license. Most lists mix very different tools in one ranking. A headless primitive and a full design system don't solve the same problem. This list groups 12 libraries by what they are for: headless primitives, full design systems and animated components. Each entry has the license and price as listed on the official site or npm in November 2026. ## How do you choose a React component library? Answer four questions before you look at screenshots: - **Do you have a design already?** If a designer hands you a custom look, use headless primitives and style them yourself. If not, a full design system gives you a finished look on day one. - **How do you style?** Tailwind projects fit shadcn/ui, HeroUI and the animated libraries. Mantine, MUI and Chakra UI ship their own styling systems. - **Do you want the source in your repo?** Copy-paste libraries (shadcn/ui and the libraries built on its CLI) put the code in your project. npm packages get updates for free but are harder to change deeply. - **What does the paid tier cover?** Several libraries are free at the core and charge for advanced components, blocks or templates. Check what you actually need before you budget. ## Headless React component libraries Headless libraries give you behavior, keyboard support and ARIA without styles. You bring the CSS. ### 1. Radix UI Radix Primitives are unstyled, accessible components: dialog, popover, dropdown menu, tabs and more. They are MIT licensed and free. Many styled libraries build on Radix, including shadcn/ui. Best for teams who want proven primitives and full control of styling. ### 2. Base UI Base UI is an unstyled React library from the team behind Radix, Floating UI and Material UI. It reached a stable 1.x release and is MIT licensed. shadcn/ui supports both Radix and Base UI. Best for new design systems that want an actively developed headless base. ### 3. React Aria React Aria, from Adobe, offers over 50 components with behavior, adaptive interactions and internationalization built in, ready for your own styles. `react-aria-components` is Apache-2.0 and free. Best when accessibility and i18n are hard requirements, such as enterprise or government apps. ### 4. Ark UI Ark UI is a headless library with 45+ accessible components powered by state machines (Zag.js). The same API works in React, Solid, Vue and Svelte. MIT licensed. Best for teams that ship to more than one framework. ## Full design system libraries for React These give you styled components, theming and a consistent look out of the box. ### 5. shadcn/ui shadcn/ui is not a package. Its CLI copies accessible, Tailwind-styled components into your repo, so you own and edit the source. It is MIT licensed and free. The CLI also installs from third-party registries, which is how many of the libraries below are distributed. Best for Tailwind projects that want a solid default they can fully change. ### 6. MUI (Material UI) Material UI implements Google's Material Design and is one of the oldest React libraries still in heavy use. The core is MIT and free. MUI X adds advanced components like the data grid, date pickers and charts, with paid Pro ($299 per year per developer) and Premium ($599 per year per developer) plans at the time of writing. Best for data-heavy admin apps that need a mature data grid. ### 7. Mantine Mantine is a full-featured React library with more than 120 components and 70 hooks, plus forms, dates and notifications packages. MIT licensed and free. Best when you want one library to cover most of an app, without Tailwind. ### 8. Chakra UI Chakra UI is an accessible component system with a style-props API and strong theming. Version 3 is built on Ark UI. The library is MIT and free; premium components are sold separately. Best for product teams that like styling through props and design tokens. ### 9. HeroUI HeroUI (formerly NextUI) offers free, accessible components for React and React Native, styled with Tailwind. The open source package is Apache-2.0. HeroUI Pro adds paid templates and extra tooling. Best for Tailwind apps that want a polished default look across web and mobile. ## Animated React component libraries These sit on top of a base library. Use them for landing pages, marketing sites and the parts of an app that should feel alive. ### 10. Magic UI Magic UI has 150+ free, open source animated components built with React, TypeScript, Tailwind CSS and Framer Motion. It is MIT licensed and installs through the shadcn CLI. Magic UI Pro sells templates and landing page sections. Best for landing page effects like marquees, number tickers and animated backgrounds. ### 11. Aceternity UI Aceternity UI offers 100+ free components built with React, Tailwind CSS and Framer Motion, aimed at landing pages. A paid All-Access license adds premium blocks, templates and full pages, sold as a one-time payment. Best for bold hero sections and visual effects on marketing sites. ### 12. beUI [beUI](https://beui.dev) is a free, MIT-licensed library of animated components for React and Next.js, built with Framer Motion and Tailwind CSS. Components install through the shadcn CLI as `@beui`, since beUI is in shadcn's official registry directory. They handle keyboard focus and reduced motion, and the [component catalog](https://beui.dev/components/motion) covers inputs, overlays, charts, AI agent UI and blocks like a [command palette](https://beui.dev/components/blocks/command-palette). beUI also has [React Native components](https://beui.dev/react-native) built with Reanimated and Gesture Handler, and [beUI Pro](https://pro.beui.dev), a paid library of animated blocks, pages and templates for web and React Native. Best for product UI that needs motion with accessibility handled, on web and mobile. ## Best React component libraries compared | Library | Style | License / price | Best for | | --- | --- | --- | --- | | Radix UI | Headless | MIT, free | Proven primitives you style | | Base UI | Headless | MIT, free | New headless design systems | | React Aria | Headless | Apache-2.0, free | Strict accessibility and i18n | | Ark UI | Headless | MIT, free | Multi-framework teams | | shadcn/ui | Tailwind, copy-paste | MIT, free | Owning your component source | | MUI | Material Design | MIT core, paid MUI X Pro and Premium | Data-heavy admin apps | | Mantine | Own styling system | MIT, free | One library for a whole app | | Chakra UI | Style props | MIT, paid premium components | Token-driven product UI | | HeroUI | Tailwind | Apache-2.0, paid Pro | Polished web and mobile defaults | | Magic UI | Tailwind + Framer Motion | MIT, paid Pro templates | Landing page effects | | Aceternity UI | Tailwind + Framer Motion | Free components, paid All-Access | Bold marketing sections | | beUI | Tailwind + Framer Motion | MIT, free, paid beUI Pro | Accessible animated product UI | ## Can you combine React component libraries? Yes, and most teams do. A common stack is a headless base or shadcn/ui for forms, dialogs and menus, plus an animated library for the parts users notice. Because shadcn/ui, Magic UI and beUI all install through the same CLI and share Tailwind tokens, mixing them in one project stays consistent. If you are comparing the animated options, the [beUI vs Magic UI](https://beui.dev/alternatives/magic-ui) page goes into the differences in more detail. ## FAQ ### What is the best free React component library? It depends on the job. shadcn/ui is the most flexible free starting point for Tailwind projects, Mantine covers the most ground as one package, and Radix UI or Base UI are the safest headless bases. ### Is shadcn/ui a component library? Not in the npm package sense. It is a set of components and a CLI that copies their source into your project, so you own the code and update it yourself. ### Which React component libraries have paid tiers? MUI (MUI X Pro and Premium), Chakra UI (premium components), HeroUI (Pro), Magic UI (Pro templates), Aceternity UI (All-Access) and beUI (beUI Pro) all keep a free core and sell extra components, blocks or templates. ### What is the best animated React component library? Magic UI and Aceternity UI are strong for landing page effects. beUI focuses on animated product UI with keyboard support and reduced motion built in, and also ships React Native versions. ## Takeaway Pick by the job, not the ranking. Headless if you have a design, a full system if you need one, and an animated library on top for the moments that matter. Most of these are free at the core, so try two in a branch before you commit. Browse the free animated components at [beui.dev](https://beui.dev) and install your first one: ```bash npx shadcn@latest add @beui/command-palette ``` --- # Your closing modal is still eating clicks URL: https://beui.dev/blog/exiting-overlays-still-catch-clicks Published: 2026-11-16 You close a modal. The exit animation plays for 200ms. During those 200ms the user clicks the button behind it. Nothing happens. The modal is fading out, so it looks gone. But it is still in the DOM, still on top, still catching the click. This is one of the most common bugs in animated overlays, and almost every Framer Motion modal tutorial has it. ## Why it happens `AnimatePresence` keeps a child mounted after you remove it, so it can play the `exit` animation. That is the whole point. But "mounted" means the full overlay: the backdrop, the panel, the focus trap, everything. So for the length of the exit: - the backdrop still covers the page and swallows pointer events - the dialog is still in the tab order, so focus can land in it - screen readers still see a dialog that is already closing Most code gates interaction on `open`: ```tsx title="modal.tsx" {open && ( )} ``` That check never works. When `open` is false, this element is not rendered with new props anymore. `AnimatePresence` keeps the last render, the one where `open` was true, and animates it out. The `pointerEvents: "auto"` is frozen in. ## The boolean that knows Framer Motion already tracks this. `useIsPresent()` returns `false` from the moment a child starts its exit. The catch: it only works inside the `AnimatePresence` subtree, one component below it. So read it in a small child component, and pass it down: ```tsx title="presence-gate.tsx" import { useIsPresent } from "motion/react"; import type { ReactNode } from "react"; export function PresenceGate({ children, }: { children: (gate: { inert: boolean; style: { pointerEvents: "auto" | "none" } }) => ReactNode; }) { const isPresent = useIsPresent(); return children({ inert: !isPresent, style: { pointerEvents: isPresent ? "auto" : "none" }, }); } ``` Then spread the gate onto every layer that takes pointer events: ```tsx title="modal.tsx" {open && ( {(gate) => ( <> ... )} )} ``` ## Why inert, not just pointer-events `pointer-events: none` fixes the mouse. It does nothing for the keyboard or screen readers. `inert` does all three in one attribute: no pointer events, out of the tab order, hidden from the accessibility tree. An exiting dialog is not a dialog anyone should still be able to type into. Both flip in the same commit that starts the exit. The visual exit keeps playing. The page behind is usable instantly. ## The rule Gate interaction on presence, not on `open`. `open` tells you what the user wants. Presence tells you what is actually on screen and still in charge. During an exit those two disagree, and the page should follow the user. Every overlay in [beUI](https://beui.dev) works this way: the [command palette](https://beui.dev/components/blocks/command-palette), [bottom sheet](https://beui.dev/components/motion/bottom-sheet) and [image viewer](https://beui.dev/components/motion/image-viewer) all release the page the moment they start closing. Install any of them with the shadcn CLI and the gate comes with it: ```bash npx shadcn@latest add @beui/bottom-sheet ``` --- --- title: "Bookshelf" description: "A shelf of book spines. Click one and it slides out and turns in 3D to show its cover while the others make room. Arrow keys browse, Escape puts it back, and reduced motion swaps the turn for a fade." category: "Components" publishedAt: "2026-11-19" updatedAt: "2026-11-25" documentation: "https://beui.dev/components/motion/bookshelf" markdown: "https://beui.dev/components/motion/bookshelf.md" license: "MIT" --- # Bookshelf > A shelf of book spines. Click one and it slides out and turns in 3D to show its cover while the others make room. Arrow keys browse, Escape puts it back, and reduced motion swaps the turn for a fade. ## Install ```bash npx shadcn@latest add @beui/bookshelf ``` ## Dependencies - `clsx` - `motion` - `react` - `tailwind-merge` ## Usage ```tsx "use client"; import { useState } from "react"; import { Bookshelf, type BookshelfBook } from "@/components/motion/bookshelf"; import { Switch } from "@/components/motion/switch"; const BOOKS: BookshelfBook[] = [ { id: "walden", title: "Walden", author: "Henry David Thoreau", color: "#5b6248", thickness: 38 }, { id: "meditations", title: "Meditations", author: "Marcus Aurelius", color: "#2f3a4a", thickness: 34 }, { id: "art-of-war", title: "The Art of War", author: "Sun Tzu", color: "#b5452f", thickness: 28 }, { id: "middlemarch", title: "Middlemarch", author: "George Eliot", color: "#e3d7b8", thickness: 52 }, { id: "moby-dick", title: "Moby-Dick", author: "Herman Melville", color: "#1f4e79", thickness: 48 }, { id: "frankenstein", title: "Frankenstein", author: "Mary Shelley", color: "#3b3b3b", thickness: 36 }, { id: "the-prince", title: "The Prince", author: "Niccolò Machiavelli", color: "#d9a93f", thickness: 30 }, { id: "leaves-of-grass", title: "Leaves of Grass", author: "Walt Whitman", color: "#3f6b4f", thickness: 42 }, { id: "on-liberty", title: "On Liberty", author: "John Stuart Mill", color: "#8a8174", thickness: 32 }, { id: "the-odyssey", title: "The Odyssey", author: "Homer", color: "#7a3b2e", thickness: 46 }, ]; export function BookshelfPreview() { const [sound, setSound] = useState(true); return (

    Click a book to pull it out. Arrow keys browse the shelf.

    ); } ``` ## API Reference ### Bookshelf | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `books` | `BookshelfBook[]` | | Yes | Books on the shelf, in order. | | `value` | `string \| null` | | No | Id of the open book, or null. Pass to control the shelf. | | `defaultValue` | `string \| null` | `null` | No | Id of the book open at first when uncontrolled. Default: null | | `onValueChange` | `((id: string \| null) => void)` | | No | Called with the book id, or `null` when it closes, when the open book changes. | | `height` | `number` | `300` | No | Book height in px. | | `coverRatio` | `number` | `0.68` | No | Cover width as a fraction of the height. | | `gap` | `number` | `3` | No | Space between closed books in px. | | `openGap` | `number` | `16` | No | Extra space on each side of the open book in px. | | `tilt` | `boolean` | `true` | No | Tilt the open cover toward the mouse. Mouse only, off with reduced motion. | | `sound` | `boolean` | `false` | No | Play a slide as a book comes out or goes back, and a soft tap as the mouse runs along the spines. Default false. | | `labels` | `Partial<{ label: string; book: string; bookWithAuthor: string; }>` | | No | Override any built-in string. | | `className` | `string` | | No | Classes merged onto the root element. | ## Types ### BookshelfBook | Field | Type | Required | Description | | --- | --- | --- | --- | | `id` | `string` | Yes | Unique key for the book, used in `value` and `onValueChange`. | | `title` | `string` | Yes | Title printed on the spine and typeset cover, and the book's accessible name. | | `author` | `string` | No | Author printed on the spine and cover and added to the accessible name. | | `color` | `string` | Yes | Cloth color of the spine and cover. Any CSS color. | | `textColor` | `string` | No | Text color on the spine and cover. Defaults to black or white, picked from `color` when it is a hex value, else white. | | `coverImage` | `string` | No | Front cover image. Without one, the cover is typeset from the title and author. | | `thickness` | `number` | No | Spine width in px. | ## About Bookshelf Bookshelf is a React component that shows a row of book spines, each with its title and author set vertically on a colored cloth. Click a spine and the book comes off the shelf, then turns in 3D to show its front cover, with light and a shadow that follow the turn, while the books beside it move apart to make room. On a mouse, a hovered spine tips out a little and the open cover tilts toward the cursor. Covers can be an image or are typeset from the title and author. The shelf scales down to fit narrow containers; when an open book no longer fits, the row pans to keep it in view and can be swiped sideways to reach the rest. ### When to use it - A publisher, author or newsletter site shows its books or issues. - A personal site lists a reading list or favorite books. - A product page groups guides, courses or collections as volumes on a shelf. ### Accessibility The shelf is a named list of toggle buttons, one per book, named by title and author and marked pressed while open. Arrow keys move focus between books and, while a book is open, open the next one instead; Home and End jump to the ends, and Escape puts the open book back. With reduced motion the books do not slide, turn, tip or tilt: the cover fades in over the spine. ### FAQ **How do I add a book cover image?** Set coverImage on a book to an image URL. Without one, the cover is typeset from the title and author in the book's color. **Can I control which book is open?** Yes. Pass value and onValueChange with a book id or null, or defaultValue to open a book on first render. **Can I change the size of the books?** Set height for the book height, coverRatio for the cover width as a fraction of it, and thickness on each book for its spine width. **Can it play sounds?** Yes. Pass sound to hear a soft slide as a book comes out or goes back and a light tap as the mouse runs along the spines. The sounds are synthesized at runtime with Web Audio, so there are no audio files, and they start only after the first click or key press. ## Source - Registry detail: https://beui.dev/r/bookshelf - Raw source: https://beui.dev/r/bookshelf/raw - GitHub: https://github.com/starc007/ui-components --- --- title: "Dropdown Menu" description: "Composable dropdown menu that opens from its trigger, with a gliding highlight, submenus that stay open on a diagonal path, checkbox and radio items, shortcuts and full keyboard support." category: "Components" publishedAt: "2026-11-16" updatedAt: "2026-11-30" documentation: "https://beui.dev/components/motion/dropdown-menu" markdown: "https://beui.dev/components/motion/dropdown-menu.md" license: "MIT" --- # Dropdown Menu > Composable dropdown menu that opens from its trigger, with a gliding highlight, submenus that stay open on a diagonal path, checkbox and radio items, shortcuts and full keyboard support. ## Install ```bash npx shadcn@latest add @beui/dropdown-menu ``` ## Dependencies - `clsx` - `lucide-react` - `motion` - `react` - `react-dom` - `tailwind-merge` ## Usage ```tsx "use client"; import { ChevronDown, CreditCard, Link2, LogOut, Mail, MessageSquare, Settings, Share2, User, } from "lucide-react"; import { useState } from "react"; import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/components/motion/dropdown-menu"; export function DropdownMenuPreview() { const [statusBar, setStatusBar] = useState(true); const [compact, setCompact] = useState(false); const [panel, setPanel] = useState("bottom"); return (
    {/* No press or hover scale: the menu measures the trigger as it opens. */} My account View Status bar Compact rows Panel Bottom Right Hidden
    ); } ``` ## API Reference ### DropdownMenu | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `open` | `boolean` | | No | Whether the menu is open, for controlled use. | | `defaultOpen` | `boolean` | `false` | No | Whether the menu starts open when uncontrolled. Default: false | | `onOpenChange` | `((open: boolean) => void)` | | No | Called with the new open state when the menu opens or closes. | | `sound` | `boolean` | `false` | No | Play a soft sweep as the menu opens and closes, and a tick for checkbox and radio rows. Off by default; a `SoundProvider` can mute it app-wide. | ### DropdownMenuTrigger | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `children` | `ReactElement>` | | Yes | A single focusable element, usually a button. | | `disabled` | `boolean` | `false` | No | Stops clicks and arrow keys from opening the menu. Default: false | ### DropdownMenuContent | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | | No | Classes merged onto the menu panel. | | `side` | `"top" \| "bottom"` | `bottom` | No | Preferred side. Flips when the viewport has no room. Default "bottom". | | `align` | `"start" \| "center" \| "end"` | `start` | No | Default "start". | | `sideOffset` | `number` | `6` | No | Gap between trigger and menu in px. Default 6. | ### DropdownMenuItem | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `onSelect` | `(() => void)` | | No | Called when the item is chosen by click, Enter or Space. | | `disabled` | `boolean` | | No | Dims the item and blocks selecting it. Default: false | | `closeOnSelect` | `boolean` | | No | Close the whole menu after selecting. Default true. | | `tone` | `"default" \| "destructive"` | | No | "destructive" tints the row for dangerous actions. Default: "default" | | `inset` | `boolean` | | No | Indent to line up with rows that start with an icon. | | `textValue` | `string` | | No | Text matched by typeahead when the label is not plain text. | | `className` | `string` | | No | Classes merged onto the item row. | ### DropdownMenuCheckboxItem | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `checked` | `boolean` | | Yes | Whether the row is checked. | | `onCheckedChange` | `((checked: boolean) => void)` | | No | Called with the new checked state when the row is toggled. | | `disabled` | `boolean` | | No | Dims the item and blocks selecting it. Default: false | | `closeOnSelect` | `boolean` | `false` | No | Close the whole menu after selecting. Default true. | | `textValue` | `string` | | No | Text matched by typeahead when the label is not plain text. | | `className` | `string` | | No | Classes merged onto the item row. | ### DropdownMenuRadioGroup | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `value` | `string` | | Yes | The `value` of the checked radio row. | | `onValueChange` | `((value: string) => void)` | | No | Called with the picked row's value when a radio row is selected. | | `className` | `string` | | No | Classes merged onto the group wrapper. | ### DropdownMenuRadioItem | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `value` | `string` | | Yes | The row's value. Checked when it matches the group's `value`. | | `disabled` | `boolean` | | No | Dims the item and blocks selecting it. Default: false | | `closeOnSelect` | `boolean` | `false` | No | Close the whole menu after selecting. Default true. | | `textValue` | `string` | | No | Text matched by typeahead when the label is not plain text. | | `className` | `string` | | No | Classes merged onto the item row. | ### DropdownMenuSubTrigger | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `disabled` | `boolean` | | No | Stops hover, click and keys from opening the submenu. | | `inset` | `boolean` | | No | Indent to line up with rows that start with an icon. | | `textValue` | `string` | | No | Text matched by typeahead when the label is not plain text. | | `className` | `string` | | No | Classes merged onto the trigger row. | ### DropdownMenuSubContent | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | | No | Classes merged onto the submenu panel. | | `sideOffset` | `number` | `6` | No | Gap between the menu's edge and the submenu in px. Default 6. | ### DropdownMenuLabel | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `inset` | `boolean` | | No | Indent to line up with rows that start with an icon. | | `className` | `string` | | No | Classes merged onto the label element. | ### DropdownMenuSeparator | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | | No | Classes merged onto the separator line. | ### DropdownMenuShortcut | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `className` | `string` | | No | Classes merged onto the shortcut text. | ## About Dropdown Menu Dropdown Menu is a composable menu button for React built with Framer Motion and Tailwind CSS. The menu scales out of its trigger, a highlight glides from row to row as you point or use the keys, and submenus open to the side. A pointer moving diagonally toward an open submenu can cross the rows below without closing it. It has plain items, checkbox and radio items, labels, separators, shortcut hints and a destructive tone, and it flips to stay on screen. ### When to use it - An account button, a toolbar or a table row needs a short list of actions. - A view menu needs toggles and a single choice in one place. - Actions group naturally into a second level, such as Share with its targets. ### Accessibility The trigger exposes aria-haspopup, aria-expanded and aria-controls, and the menu is labelled by the trigger. Items use the menuitem, menuitemcheckbox and menuitemradio roles and report aria-checked. Enter, Space or Arrow Down open the menu on its first item and Arrow Up on its last. Arrow keys move with wraparound, Home and End jump to the ends, typing jumps to a matching item, Arrow Right opens a submenu and Arrow Left closes it, Escape closes and returns focus to the trigger, and Tab closes the menu. Disabled items are skipped by the keys. With reduced motion the menu and its submenus fade without scaling or sliding. ### FAQ **How do I add a dropdown menu to a button in React?** Wrap your button in DropdownMenuTrigger inside DropdownMenu, then add DropdownMenuContent with DropdownMenuItem children. Each item takes an onSelect callback, and the menu closes after a pick. **Can the dropdown menu have submenus?** Yes. Put a DropdownMenuSubTrigger and a DropdownMenuSubContent inside DropdownMenuSub. The submenu opens on hover, click or Arrow Right, and flips to the left when there is no room on the right. **Does it support checkboxes and radio options?** Yes. Use DropdownMenuCheckboxItem with checked and onCheckedChange, or DropdownMenuRadioGroup with value and onValueChange around DropdownMenuRadioItem children. These stay open after a pick by default; pass closeOnSelect to close instead. ## Source - Registry detail: https://beui.dev/r/dropdown-menu - Raw source: https://beui.dev/r/dropdown-menu/raw - GitHub: https://github.com/starc007/ui-components --- --- title: "Before After Slider" description: "Compare two images with a draggable divider. Drag or click anywhere on the frame, use the arrow keys, and keep vertical page scroll on touch." category: "Components" publishedAt: "2026-11-14" updatedAt: "2026-11-24" documentation: "https://beui.dev/components/motion/before-after-slider" markdown: "https://beui.dev/components/motion/before-after-slider.md" license: "MIT" --- # Before After Slider > Compare two images with a draggable divider. Drag or click anywhere on the frame, use the arrow keys, and keep vertical page scroll on touch. ## Install ```bash npx shadcn@latest add @beui/before-after-slider ``` ## Dependencies - `clsx` - `lucide-react` - `motion` - `react` - `tailwind-merge` ## Usage ```tsx "use client"; import { BeforeAfterSlider } from "@/components/motion/before-after-slider"; const PHOTO = "https://images.unsplash.com/photo-1470770841072-f978cf4d019e?auto=format&fit=crop&w=1200&q=80"; export function BeforeAfterSliderPreview() { return (
    } after={ Lake house at dawn, color graded } />
    ); } ``` ## API Reference ### BeforeAfterSlider | Prop | Type | Default | Required | Description | | --- | --- | --- | --- | --- | | `before` | `ReactNode` | | Yes | Shown on the left of the divider, usually an image. | | `after` | `ReactNode` | | Yes | Shown on the right of the divider, usually an image of the same size. | | `value` | `number` | | No | Divider position as a percent of the width, 0 to 100 (controlled). | | `defaultValue` | `number` | `50` | No | Starting position when uncontrolled. | | `onValueChange` | `((value: number) => void)` | | No | Called with the new position (percent) as the divider moves. | | `showLabels` | `boolean` | `true` | No | Show the Before and After labels in the top corners. | | `hint` | `boolean` | `true` | No | Sweep the divider once when the slider first scrolls into view, to show it moves. | | `disabled` | `boolean` | `false` | No | Lock the divider in place and skip the hint sweep. Default: false | | `labels` | `Partial<{ label: string; before: string; after: string; valueText: string; }>` | | No | Override any built-in string, e.g. for translation. | | `className` | `string` | | No | Size the frame here; it defaults to a 3:2 box at full width. | ## About Before After Slider Before After Slider is a React image comparison component. It stacks two layers, usually two photos of the same size, and reveals the before layer up to a draggable divider. Drag the handle or anywhere on the frame, click to glide the divider to that point on a Framer Motion spring, or use the keyboard. The before layer is clipped rather than resized, so both layers stay aligned at every position. ### When to use it - A photo editor, filter or retouching tool shows the original next to the result. - A renovation, design or redesign case study compares two states of the same scene. - A landing page demonstrates what a product changes about an image or a screen. ### Accessibility The handle is a focusable slider with a translatable name and a value read as a percent of the before layer. Arrow keys move it by 1 percent, Shift with an arrow or Page Up and Page Down by 10, and Home and End jump to the edges. Pass alt text on your images; the Before and After corner labels are decorative. On touch, a vertical swipe still scrolls the page. With reduced motion the divider moves without the glide, the line stays straight, the first-view hint does not play and the handle does not grow or part its arrows. The hint only moves the picture, never the value, so screen readers announce nothing during it. ### FAQ **How do I make a before and after image slider in React?** Render BeforeAfterSlider with a before and an after element, usually two img tags with h-full w-full object-cover. Set the frame's size with className; it defaults to a full-width 3:2 box. **Can I control the divider position?** Yes. Pass value and onValueChange with a number from 0 to 100, or defaultValue to set where an uncontrolled slider starts. **Does it work on phones?** Yes. A sideways drag moves the divider and a tap glides it to the tap, while an up or down swipe scrolls the page as usual. ## Source - Registry detail: https://beui.dev/r/before-after-slider - Raw source: https://beui.dev/r/before-after-slider/raw - GitHub: https://github.com/starc007/ui-components --- --- title: "Timeline" description: "A draggable timeline of dated events around a focused card." category: "Components" publishedAt: "2026-10-20" updatedAt: "2026-11-10" documentation: "https://beui.dev/components/motion/timeline" markdown: "https://beui.dev/components/motion/timeline.md" license: "MIT" --- # Timeline > A draggable timeline of dated events around a focused card. ## Install ```bash npx shadcn@latest add @beui/timeline ``` ## Dependencies - `clsx` - `lucide-react` - `motion` - `react` - `tailwind-merge` ## Usage ```tsx "use client"; import { Heart } from "lucide-react"; import { Timeline, type TimelineEvent } from "@/components/motion/timeline"; function Likes({ count }: { count: string }) { return ( <>