# SmoothUI Component Catalog > For structured JSON data, see: https://smoothui.dev/llms-components.json ## Components (130) - agent-avatar: Canvas-based generative pixel avatar for AI agents, unique per seed. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/agent-avatar.json - ai-approval: Human-in-the-loop approval card where the chosen option expands to fill the card while the alternatives collapse away. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-approval.json - ai-artifact: Generated-artifact frame whose preview and code panes swap along a shared axis rather than cross-fading. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-artifact.json - ai-branch: An interactive AI branch component for displaying conversation flows. [ai] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/ai-branch.json - ai-citation: Inline citation pill that opens an origin-aware source card, anchored to the pill it came from. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-citation.json - ai-context-meter: Context window meter whose ring fills and shifts hue at the warning threshold, never changing size. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-context-meter.json - ai-conversation: Thread scroll container that follows the bottom only while the reader is already there, offering a jump-to-latest pill when it stops. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-conversation.json - ai-diff: Proposed code or data edit where added lines wipe in from the left and rejected lines collapse to nothing. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-diff.json - ai-loader: Family of AI waiting indicators — dots, sweep bar and pixel grid — sharing one cycle length, with an optional elapsed counter. [ai] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/ai-loader.json - ai-message: Chat message bubble whose action row slides out of the bubble's own edge, revealed on hover and on focus. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-message.json - ai-orb-face: Cartoon character orb whose expression carries the AI state — cursor-following gaze, natural blinks, thinking saccades, happy arcs and spiral eyes. [ai] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/ai-orb-face.json - ai-prompt-input: AI prompt composer with autogrowing textarea, attachment chips and a send-to-stop path morph. [ai] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/ai-prompt-input.json - ai-reasoning: Collapsible AI reasoning trace that shimmers only while the model works, reports how long it took and gets out of the way. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-reasoning.json - ai-response: Streaming assistant text where words animate in as they arrive, with a caret that rides the last glyph and inline citation pills. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-response.json - ai-sources: Favicon stack that fans out on hover and expands into a source list, with each favicon morphing into its row. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-sources.json - ai-suggestions: Prompt suggestion chips that radiate in from the centre of the row rather than sweeping left to right. [ai] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/ai-suggestions.json - ai-task-list: Live agent plan with nested steps, a drawn checkmark on completion and a travelling underline on whatever is running. [ai] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/ai-task-list.json - ai-tool-call: Collapsible tool invocation whose status badge is one ring that evolves — breathing, spinning, then drawing a check or a cross. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/ai-tool-call.json - animated-avatar-group: Stack of overlapping avatars with smooth expand/collapse animation [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/animated-avatar-group.json - animated-file-upload: Animated drag-and-drop file upload component [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/animated-file-upload.json - animated-input: A AnimatedInput component for SmoothUI. [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/animated-input.json - animated-o-t-p-input: A AnimatedOTPInput component for SmoothUI. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/animated-o-t-p-input.json - animated-progress-bar: A AnimatedProgressBar component for SmoothUI. [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/animated-progress-bar.json - animated-stepper: Animated stepper/wizard component with step transitions [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/animated-stepper.json - animated-tabs: Animated tabs component with sliding indicator [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/animated-tabs.json - animated-tags: A AnimatedTags component for SmoothUI. [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/animated-tags.json - animated-toggle: Animated toggle switch with morph and icon variants [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/animated-toggle.json - animated-tooltip: Spring-animated tooltip with multiple placement options [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/animated-tooltip.json - aperture-blur-transition: Persistent WebGL shader transition wrapper that swaps content behind a cinematic aperture bloom. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/aperture-blur-transition.json - app-download-stack: A AppDownloadStack component for SmoothUI. [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/app-download-stack.json - apple-invites: A AppleInvites component for SmoothUI. [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/apple-invites.json - basic-accordion: A BasicAccordion component for SmoothUI. [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/basic-accordion.json - basic-dropdown: A BasicDropdown component for SmoothUI. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/basic-dropdown.json - basic-modal: A BasicModal component for SmoothUI. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/basic-modal.json - basic-toast: A BasicToast component for SmoothUI. [feedback] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/basic-toast.json - blur-out-up: A BlurOutUp text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/blur-out-up.json - book: A 3D CSS book component with perspective transforms and hover animation [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/book.json - bottom-up-letters: A BottomUpLetters text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/bottom-up-letters.json - breadcrumb: Animated breadcrumb navigation with stagger-in animation [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/breadcrumb.json - button-copy: A ButtonCopy component for SmoothUI. [button] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/button-copy.json - checkbox: An animated Checkbox component for SmoothUI with checkmark and indeterminate state animations. [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/checkbox.json - chroma-blur-transition: Persistent WebGL shader transition wrapper that swaps content under a soft chromatic blur wash. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/chroma-blur-transition.json - clip-corners-button: A ClipCornersButton component for SmoothUI. [button] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/clip-corners-button.json - combobox: An animated Combobox component for SmoothUI with text filtering, async search, and keyboard navigation. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/combobox.json - context-menu: An animated Context Menu component for SmoothUI with spring animations, nested submenus, and keyboard navigation. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/context-menu.json - contribution-graph: A ContributionGraph component for SmoothUI. [data-display] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/contribution-graph.json - cursor-follow: A CursorFollow component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/cursor-follow.json - depth-parallax-words: A DepthParallaxWords text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/depth-parallax-words.json - dialog: Animated Dialog and AlertDialog components for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/dialog.json - dot-morph-button: A DotMorphButton component for SmoothUI. [button] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/dot-morph-button.json - drawer: An animated Drawer component for SmoothUI that slides from any side. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/drawer.json - dropdown-menu: An animated Dropdown Menu component for SmoothUI with spring animations, nested submenus, and keyboard navigation. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/dropdown-menu.json - dynamic-island: A DynamicIsland component for SmoothUI. [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/dynamic-island.json - expandable-cards: A ExpandableCards component for SmoothUI. [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/expandable-cards.json - exposure-slider: iOS-style exposure slider with draggable ticker and progress ring [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/exposure-slider.json - fade-through: A FadeThrough text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/fade-through.json - figma-comment: A FigmaComment component for SmoothUI. [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/figma-comment.json - focus-blur-resolve: A FocusBlurResolve text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/focus-blur-resolve.json - form: A lightweight, composable Form component with animated error messages and full accessibility support. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/form.json - github-stars-animation: A GitHubStarsAnimation component for SmoothUI. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/github-stars-animation.json - glow-hover-card: A GlowHoverCards component for SmoothUI. [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/glow-hover-card.json - gooey-popover: A GooeyPopover component for SmoothUI. [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/gooey-popover.json - grid-loader: 3x3 grid-based loading animation with preset patterns [feedback] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/grid-loader.json - image-metadata-preview: A ImageMetadataPreview component for SmoothUI. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/image-metadata-preview.json - infinite-slider: A InfiniteSlider component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/infinite-slider.json - interactive-image-selector: A InteractiveImageSelector component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/interactive-image-selector.json - job-listing-component: A JobListingComponent component for SmoothUI. [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/job-listing-component.json - kinetic-center-build: A KineticCenterBuild text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/kinetic-center-build.json - line-by-line-slide: A LineByLineSlide text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/line-by-line-slide.json - magnetic-button: Button that subtly follows the cursor with magnetic effect [button] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/magnetic-button.json - mask-reveal-up: A MaskRevealUp text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/mask-reveal-up.json - micro-scale-fade: A MicroScaleFade text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/micro-scale-fade.json - morph-surface: Feedback dock that morphs from a compact pill into a panel and back, with a spring layout transition. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/morph-surface.json - notification-badge: Animated notification badge with count and status variants [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/notification-badge.json - number-flow: A NumberFlow component for SmoothUI. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/number-flow.json - organic-merge-transition: A soft-min SDF merge transition with two organic expanding shapes. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/organic-merge-transition.json - pagination: Animated pagination with spring-based active page indicator [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/pagination.json - per-character-rise: A PerCharacterRise text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/per-character-rise.json - per-word-crossfade: A PerWordCrossfade text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/per-word-crossfade.json - photo-stack: A PhotoStack component for SmoothUI. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/photo-stack.json - phototab: A Phototab component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/phototab.json - power-off-slide: A PowerOffSlide component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/power-off-slide.json - price-flow: A PriceFlow component for SmoothUI. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/price-flow.json - prism-sweep-transition: A persistent WebGL prism sweep transition wrapper for route and state changes. [feedback] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/prism-sweep-transition.json - product-card: Animated product card component for ecommerce [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/product-card.json - radial-circles-transition: A radial SDF circle pattern transition inspired by the Codrops radial circles step. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/radial-circles-transition.json - radio-group: An animated Radio Group component for SmoothUI with selection indicator spring animation. [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/radio-group.json - reveal-text: A RevealText component for SmoothUI. [text] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/reveal-text.json - reviews-carousel: A ReviewsCarousel component for SmoothUI. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/reviews-carousel.json - rich-popover: A RichPopover component for SmoothUI. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/rich-popover.json - scale-down-fade: A ScaleDownFade text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/scale-down-fade.json - scramble-hover: A ScrambleHover component for SmoothUI. [text] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/scramble-hover.json - scroll-reveal-paragraph: A ScrollRevealParagraph component for SmoothUI. [text] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/scroll-reveal-paragraph.json - scrollable-card-stack: A ScrollableCardStack component for SmoothUI. [layout] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/scrollable-card-stack.json - scrubber: Design-tool style scrubber slider with animated thumb and built-in label [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/scrubber.json - sdf-blob-transition: A persistent WebGL SDF blob transition wrapper for route and state changes. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/sdf-blob-transition.json - sdf-circle-transition: A clean SDF circle reveal based on the first Codrops shader step. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/sdf-circle-transition.json - searchable-dropdown: A SearchableDropdown component for SmoothUI. [basic-ui] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/searchable-dropdown.json - select: An animated Select dropdown component for SmoothUI wrapping Radix Select with smooth animations. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/select.json - shader-reveal-circle-transition: Demo 3 adaptation: noisy circular reveal with radial interpolation. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-circle-transition.json - shader-reveal-luma-transition: Demo 5 adaptation: luminance-style vertical displacement translated into a shader overlay. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-luma-transition.json - shader-reveal-noise-transition: Demo 1 adaptation: 4D-noise threshold transition with an organic shader gate. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-noise-transition.json - shader-reveal-planetary-transition: Demo 6 adaptation: rotated displacement vectors with a planetary swirl feel. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-planetary-transition.json - shader-reveal-push-transition: Demo 8 adaptation: procedural noise push/pull displacement. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-push-transition.json - shader-reveal-stripes-transition: Demo 7 adaptation: divided UV stripe displacement with diagonal motion. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-stripes-transition.json - shader-reveal-transition: A shared WebGL transition engine with eight shader-driven reveal variants. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-transition.json - shader-reveal-wipe-transition: Demo 4 adaptation: displacement-noise horizontal wipe with a sharp eased edge. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-wipe-transition.json - shader-reveal-zoom-transition: Demo 2 adaptation: vertical-progress zoom mix translated into a UI frame transition. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shader-reveal-zoom-transition.json - shared-axis-x: A SharedAxisX text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shared-axis-x.json - shared-axis-y: A SharedAxisY text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shared-axis-y.json - shared-axis-z: A SharedAxisZ text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shared-axis-z.json - shimmer-sweep: A ShimmerSweep text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shimmer-sweep.json - shine-text: A ShineText light-sweep text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/shine-text.json - short-slide-down: A ShortSlideDown text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/short-slide-down.json - short-slide-right: A ShortSlideRight text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/short-slide-right.json - siri-orb: A beautiful animated orb component inspired by Siri's visual design. [ai] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/siri-orb.json - skeleton-loader: Animated skeleton loading placeholders [basic-ui] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/skeleton-loader.json - smooth-button: A polished button component with gradient variants and press animation [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/smooth-button.json - social-selector: A SocialSelector component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/social-selector.json - soft-blur-in: A SoftBlurIn text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/soft-blur-in.json - spring-scale-in: A SpringScaleIn text animation component for SmoothUI. [text] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/spring-scale-in.json - stagger-from-center: A StaggerFromCenter text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/stagger-from-center.json - stagger-from-edges: A StaggerFromEdges text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/stagger-from-edges.json - switchboard-card: A SwitchboardCard component with light grid illustration for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/switchboard-card.json - top-down-letters: A TopDownLetters text animation component for SmoothUI. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/top-down-letters.json - tweet-card: A beautiful tweet card component for displaying Twitter/X posts. [data-display] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/tweet-card.json - typewriter-text: A TypewriterText component for SmoothUI. [text] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/typewriter-text.json - user-account-avatar: A UserAccountAvatar component for SmoothUI. [other] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/user-account-avatar.json - warped-circle-transition: A wavy perimeter circle reveal inspired by the Codrops circle warping step. [other] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/warped-circle-transition.json - wave-text: A WaveText component for SmoothUI. [text] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/wave-text.json ## Blocks (34) - cta-1: Centered CTA block with radial glow background [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/cta-1.json - cta-2: Split layout CTA block with text and illustration [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/cta-2.json - cta-3: Compact banner CTA block [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/cta-3.json - faq-1: FAQ grid block with categorized tabs and icons [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/faq-1.json - faq-2: FAQ accordion block with expandable questions [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/faq-2.json - faq-3: Searchable FAQ section with filter animations [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/faq-3.json - faq-4: Categorized FAQ section with tab navigation [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/faq-4.json - features-1: Feature grid block with animated cards [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/features-1.json - features-2: Bento grid features block with asymmetric layout [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/features-2.json - features-3: Alternating features block with side-by-side layout [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/features-3.json - footer-1: Simple footer block with links and social icons [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/footer-1.json - footer-2: Complex footer block with newsletter and extended links [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/footer-2.json - footer-3: Mega footer with newsletter and social links [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/footer-3.json - footer-4: Minimal single-row footer [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/footer-4.json - header-1: Modern header block with navigation and mobile menu [layout] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/header-1.json - header-2: Premium header block with gradient logo and smooth animations [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/header-2.json - header-3: Premium header block with gradient logo and smooth animations [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/header-3.json - header-4: Interactive 3D grid hero header inspired by rauno.me 2024 [layout] (complex) — install: npx shadcn@latest add https://smoothui.dev/r/header-4.json - header-5: Spotlight hero block with dark theme and gradient text [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/header-5.json - header-6: Minimal hero block with clean typography [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/header-6.json - logo-cloud-1: Simple logo cloud block with grid layout [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/logo-cloud-1.json - logo-cloud-2: Animated logo cloud block with infinite scroll [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/logo-cloud-2.json - logo-cloud-3: Infinite scrolling logo marquee [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/logo-cloud-3.json - logo-cloud-4: Interactive logo grid with hover effects [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/logo-cloud-4.json - pricing-1: Simple pricing block with single plan [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/pricing-1.json - pricing-2: Modern pricing block with three tiers [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/pricing-2.json - pricing-3: Creative pricing block with two plans [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/pricing-3.json - stats-1: Grid stats section block with hover effects [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/stats-1.json - stats-2: Cards stats section block with icons and trends [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/stats-2.json - team-1: Grid team section block with hover effects [layout] (simple) — install: npx shadcn@latest add https://smoothui.dev/r/team-1.json - team-2: Carousel team section block with auto-play [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/team-2.json - testimonials-1: Simple testimonials block with auto-rotating cards [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/testimonials-1.json - testimonials-2: Grid testimonials block with navigation arrows [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/testimonials-2.json - testimonials-3: Star testimonials block with grid layout [layout] (moderate) — install: npx shadcn@latest add https://smoothui.dev/r/testimonials-3.json --- # CTA Blocks (/docs/blocks/cta) Call-to-action blocks designed to convert visitors with animated entrances and clean layouts. # FAQs Blocks (/docs/blocks/faqs) FAQ blocks help answer common questions and provide helpful information to your users. # Feature Blocks (/docs/blocks/features) Feature blocks showcase your product capabilities with animated card layouts and scroll-triggered entrances. # Footer Blocks (/docs/blocks/footer) Footer blocks provide essential navigation, links, and company information for your website. # Hero Blocks (/docs/blocks/hero) Hero blocks are eye-catching landing sections designed to grab attention and communicate your value proposition effectively. # UI Blocks (/docs/blocks) # Logo Clouds Blocks (/docs/blocks/logo-clouds) Logo clouds blocks showcase your partners and customers with beautiful layouts and smooth animations. # Pricing Blocks (/docs/blocks/pricing) Pricing blocks showcase your pricing plans with animated transitions and beautiful layouts. # Stats Blocks (/docs/blocks/stats) Stats blocks showcase key metrics and numbers with beautiful animations and layouts. # Team Sections Blocks (/docs/blocks/team-sections) Team sections blocks showcase your team members with beautiful layouts and smooth animations. # Testimonial Blocks (/docs/blocks/testimonial) Testimonial blocks are eye-catching landing sections designed to showcase customer feedback, reviews, and testimonials effectively. # Community (/docs/community) ## Join the SmoothUI Community [#join-the-smoothui-community] SmoothUI is built by and for the community. Whether you have an idea for a new component, want to show off what you have built, or just want to connect with fellow developers, there is a place for you.
## Get Involved [#get-involved] Learn how to submit a well-structured component request via GitHub Discussions. See what others have built with SmoothUI and submit your own project. Join the conversation, ask questions, and share ideas with the community. Want to contribute code? Read the contributing guide to get started. # Request a Component (/docs/community/request) ## How to Request a Component [#how-to-request-a-component] We love hearing from the community! If there is an animated component you would like to see in SmoothUI, you can submit a request through GitHub Discussions or by opening a GitHub Issue using our component request template. **GitHub Discussions** is great for open-ended ideas and gathering community feedback. **GitHub Issues** with our component request template is better for well-defined component proposals ready for implementation. ## Writing a Good Request [#writing-a-good-request] A well-structured request helps us understand your needs and prioritize effectively. Here is what to include:
### Component Name [#1-component-name] Give your component a clear, descriptive name. Think about what it does or how it looks. > **Example:** "Magnetic Dock" or "Animated Tabs with Sliding Indicator"
### Description [#2-description] Explain what the component does, how it behaves, and what makes it unique. Be specific about the animations and interactions you envision.
### Use Case [#3-use-case] Describe the real-world scenario where this component would be useful. This helps us understand the value and prioritize accordingly.
### Inspiration or Reference [#4-inspiration-or-reference] If you have seen something similar on another website or in another library, share a link. Visual references are incredibly helpful. Screenshots, videos, or CodePen links are all welcome.
### Priority Level [#5-priority-level] Let us know how important this component is to your workflow: | Priority | Description | | ------------------ | ---------------------------------------------------------------------- | | **Nice to have** | Would be a cool addition, but not blocking anything | | **Would be great** | Would significantly improve your project | | **Critical** | You need this component for a project and there is no good alternative |
## Submit Your Request [#submit-your-request] Start a discussion to propose your idea and get community feedback. Great for brainstorming and open-ended ideas. Use our structured template to submit a well-defined component request ready for implementation. ## What Happens Next [#what-happens-next] After you submit a request: 1. **Community feedback** — Other users can upvote and comment on your request. Requests with more community interest get prioritized. 2. **Triage** — Maintainers review requests regularly and label them for tracking. 3. **Implementation** — Accepted components are added to the roadmap and implemented. 4. **Release** — Once built and tested, the component ships in the next release and appears in the docs. Upvote existing requests that you would also like to see. Community interest is one of the strongest signals for prioritization. # Showcase (/docs/community/showcase) ## Community Showcase [#community-showcase] See what developers around the world are building with SmoothUI. From personal portfolios to production applications, these projects showcase the creative possibilities of smooth, animated interfaces. This showcase is just getting started. We would love to feature your project here! Submit your project below and help inspire the community. ## Submit Your Project [#submit-your-project] Built something with SmoothUI? We want to see it! Share your project with the community through GitHub Discussions. ### What to Include [#what-to-include] When submitting your project, please provide: * **Project name** — The name of your project or website * **URL** — A live link where others can see it in action * **Screenshot** — A screenshot or preview image of your project * **Description** — A brief description of the project and which SmoothUI components you used * **Tech stack** — The frameworks and tools you used alongside SmoothUI Share your project in the "Show and Tell" category. Include a screenshot, link, and description of the SmoothUI components you used. ## Featured Projects [#featured-projects] No projects featured yet. Yours could be the first! Submit your project through GitHub Discussions and we will add it here. # Accessibility (/docs/guides/accessibility) ## Overview [#overview] Every SmoothUI component is built with accessibility in mind. Interactive components follow [WAI-ARIA](https://www.w3.org/WAI/ARIA/apg/) design patterns and support keyboard navigation, screen readers, and reduced motion preferences. This page provides a quick reference for the accessibility features of each interactive component. *** ## Compliance Matrix [#compliance-matrix] ### Overlay & Dialog Components [#overlay--dialog-components] | Component | Keyboard Support | ARIA Roles | Screen Reader | Reduced Motion | | ----------------------------------------------- | ---------------------------------------- | ------------------------------------------------ | -------------------------------------------------------- | ----------------------------------------------- | | [Basic Modal](/docs/components/basic-modal) | `Escape` closes, `Tab` traps focus | `role="dialog"`, `aria-modal`, `aria-labelledby` | Focus moves to close button on open, announced via title | Scale/slide entrance and backdrop fade disabled | | [Basic Toast](/docs/components/basic-toast) | Auto-dismiss, focusable dismiss button | `role="alert"`, `aria-live="polite"` | Announced automatically via live region | Slide-in animation disabled | | [Rich Popover](/docs/components/rich-popover) | `Escape` closes, `Tab` navigates content | `aria-expanded`, `aria-haspopup` | Trigger state announced on toggle | Scale/fade transitions disabled | | [Gooey Popover](/docs/components/gooey-popover) | `Escape` closes | `aria-expanded` | Content announced on open | Gooey morph effect disabled, instant show/hide | ### Button & Action Components [#button--action-components] | Component | Keyboard Support | ARIA Roles | Screen Reader | Reduced Motion | | ----------------------------------------------------------- | ---------------------------- | -------------------------------- | ---------------------------- | ------------------------------------ | | [Smooth Button](/docs/components/smooth-button) | `Enter`/`Space` activates | Native ` ``` ```tsx // Scale and fade on hover — both compositor-friendly properties
Card
``` If your project has `tw-animate-css` — shadcn's init adds it for Tailwind v4 projects, and it is what powers the `data-[state=open]:animate-in` classes on shadcn's own dialogs — you also get enter and exit keyframes for free: ```tsx
Appears on mount
``` **Where CSS runs out:** it cannot do real spring physics, it cannot animate an element that has already unmounted, and it cannot animate layout changes (`flex-direction`, `justify-content`, an element moving from one list to another). Those are the cases that justify a library. ## Route 2 — Hand-rolled Motion [#route-2--hand-rolled-motion] Install [Motion](https://motion.dev) (formerly Framer Motion): ```bash npm install motion ``` The mechanics are easy. The decisions are the hard part, and they are what make motion feel professional rather than bolted on. ### Duration: shorter than you think [#duration-shorter-than-you-think] Aim for **0.2–0.25s** for standard UI. Up to 0.3s for something complex, 0.4s at the absolute most. Anything slower reads as sluggish because the user is waiting on your animation to finish before they can act. ### Easing: never use a string [#easing-never-use-a-string] ```tsx // Wrong — vague, and usually too slow at the start transition={{ ease: "easeInOut" }} // Right — entering elements decelerate into place transition={{ duration: 0.25, ease: [0.23, 1, 0.32, 1] }} ``` Use `ease-out` curves for elements arriving, `ease-in-out` for elements moving between two positions, and avoid `ease-in` for anything the user is waiting on — it feels like lag. ### Springs: keep the bounce low [#springs-keep-the-bounce-low] ```tsx transition={{ type: "spring", duration: 0.25, bounce: 0.1 }} ``` Bounce at or below `0.1` for interface elements. Save `0.2–0.3` for playful or drag interactions, where overshoot is the point. A dialog that wobbles open looks broken, not lively. ### Animate only `transform` and `opacity` [#animate-only-transform-and-opacity] These two are the only properties the browser can animate on the compositor, off the main thread. Animating `width`, `height`, `top` or `margin` forces layout on every frame and drops you below 60fps. Move things with `transform`, not `left`. ### Handle `prefers-reduced-motion` — this is not optional [#handle-prefers-reduced-motion--this-is-not-optional] Roughly one in three people who enable this setting do so because motion makes them physically unwell. Ignoring it turns your polish into an accessibility failure: ```tsx import { motion, useReducedMotion } from "motion/react"; export function Card() { const shouldReduceMotion = useReducedMotion(); return ( Content ); } ``` Reduced motion means **gentler, not none**. Keep opacity and colour changes; drop the movement. Reduced motion is the rule that gets skipped most often, and it is the one with real consequences. If you write your own animated components, make this the first thing you add, not the last. ## Route 3 — Pre-animated components [#route-3--pre-animated-components] SmoothUI is {COMPONENT_COUNT} components that already follow every rule above, installed through the shadcn registry you already use: ```bash npx shadcn@latest add @smoothui/magnetic-button ``` The code is copied into your project, exactly like a shadcn component — same `cn()` utility, same tokens, same full ownership. It is not a dependency and there is no wrapper to fight. This route makes sense when you want breadth. Getting one interaction right by hand is a good use of an afternoon; getting forty right is a project. ## What not to do [#what-not-to-do] * **Animating layout properties.** `width`, `height` and `top` cause layout thrash. Use `transform`. * **String easings.** `"easeInOut"` is imprecise and usually too slow. Use `cubic-bezier` values. * **Durations over 0.4s** on anything interactive. It reads as lag, not elegance. * **Hover animations without checking for hover.** On touch devices a hover effect fires on tap and sticks. Gate it behind `matchMedia("(hover: hover) and (pointer: fine)")`. * **Skipping `prefers-reduced-motion`.** See above. * **Animating everything.** Motion should direct attention. If it is everywhere, it directs nothing. ## Where to go next [#where-to-go-next] # AI Integration (/docs/guides/ai-integration) SmoothUI is designed from the ground up for AI-assisted development. Whether you are an AI agent selecting components programmatically, or a developer using AI coding tools, SmoothUI provides first-class integration paths. ## Quick Start [#quick-start] Choose the integration that fits your workflow: | You are... | What to use | Setup | | --------------------------------------------- | ------------------------ | ------------------------------------------ | | **AI coding agent** (Claude, Cursor, Copilot) | MCP Server | `npx shadcn@latest mcp init` | | **Building custom tooling** | REST API | Call `https://smoothui.dev/api/v1/...` | | **LLM / RAG pipeline** | Machine-readable catalog | Fetch `https://smoothui.dev/llms-full.txt` | ## For AI Agents [#for-ai-agents] AI agents can discover, search, and install SmoothUI components through multiple channels. ### MCP Server (Recommended) [#mcp-server-recommended] The fastest way to give an AI assistant full access to SmoothUI. The shadcn MCP server works out of the box with SmoothUI's registry. ```shell title="Terminal" npx shadcn@latest mcp init --client claude ``` ```shell title="Terminal" npx shadcn@latest mcp init --client cursor ``` ```shell title="Terminal" npx shadcn@latest mcp init --client vscode ``` Once configured, your AI assistant can discover, search, and install any SmoothUI component. See the full [MCP Server guide](/docs/guides/mcp) for detailed setup and example prompts. ### REST API [#rest-api] For agents that need structured JSON data, SmoothUI provides a public REST API with no authentication required. ```bash title="Discover components" curl "https://smoothui.dev/api/v1/suggest?need=animated+tab+navigation" ``` ```bash title="Get component source" curl "https://smoothui.dev/api/v1/components/animated-tabs?include=source" ``` **Key endpoints:** | Endpoint | Purpose | | ------------------------------------- | -------------------------------------- | | `GET /api/v1/components` | List all components with filtering | | `GET /api/v1/components/{name}` | Get component details and source | | `GET /api/v1/components/search?q=...` | Keyword search | | `GET /api/v1/suggest?need=...` | Natural-language component suggestions | | `GET /api/v1/blocks` | List pre-built page sections | | `GET /openapi.json` | Full OpenAPI 3.1 specification | See the full [REST API reference](/docs/guides/api) for query parameters, response schemas, and error handling. ### Machine-Readable Catalog [#machine-readable-catalog] For LLM context windows and RAG pipelines, SmoothUI provides machine-readable component catalogs following the `llms.txt` convention: | URL | Description | | -------------------------------------------------------------------- | -------------------------------------------------- | | [`/llms.txt`](https://smoothui.dev/llms.txt) | Compact overview of all components | | [`/llms-full.txt`](https://smoothui.dev/llms-full.txt) | Full catalog with metadata, props, and usage hints | | [`/llms-components.json`](https://smoothui.dev/llms-components.json) | Structured JSON catalog for programmatic use | ## Agent Workflow [#agent-workflow] Here is the recommended workflow for AI agents integrating SmoothUI components: 1. **Discover** — Use `/api/v1/suggest?need=...` or the MCP server to find relevant components based on what the user needs. 2. **Inspect** — Fetch full metadata and source with `/api/v1/components/{name}?include=source` to understand props and usage. 3. **Install** — Use the `installCommand` from the metadata: `npx shadcn@latest add @smoothui/{name}`. 4. **Integrate** — Use `compositionHints` and the source code to wire the component into the project correctly. ## Learn More [#learn-more] Full MCP setup guide with example prompts for Claude, Cursor, and VS Code. Complete API reference with endpoints, parameters, and response schemas. Get started with SmoothUI in your project. # Animated React Components (/docs/guides/animated-components) ## Motion & GSAP-Powered React Components [#motion--gsap-powered-react-components] SmoothUI provides a comprehensive collection of **animated React components** powered by [Motion](https://motion.dev) (formerly Framer Motion) and [GSAP](https://gsap.com). Every component is designed with smooth, performant animations that enhance user experience without sacrificing accessibility.
## Animation Categories [#animation-categories] ### Text Animations [#text-animations] Create engaging text effects that capture attention: | Component | Animation Type | Use Case | | --------------------------------------------------- | --------------------- | ---------------------------- | | [Typewriter Text](/docs/components/typewriter-text) | Character reveal | Hero sections, AI interfaces | | [Scramble Hover](/docs/components/scramble-hover) | Matrix-style scramble | Navigation, headings | | [Wave Text](/docs/components/wave-text) | Wave motion | Decorative headings | | [Reveal Text](/docs/components/reveal-text) | Directional reveal | Page transitions | ### Interactive Cards [#interactive-cards] Cards with smooth expand, hover, and transition animations: | Component | Animation Type | Use Case | | --------------------------------------------------------------- | --------------------- | ---------------------- | | [Expandable Cards](/docs/components/expandable-cards) | Layout animation | Portfolios, galleries | | [Glow Hover Card](/docs/components/glow-hover-card) | Cursor-following glow | Feature highlights | | [Scrollable Card Stack](/docs/components/scrollable-card-stack) | Parallax reveal | Testimonials, profiles | ### Button Animations [#button-animations] Buttons with satisfying micro-interactions: | Component | Animation Type | Use Case | | ----------------------------------------------------------- | ----------------- | ---------------- | | [Magnetic Button](/docs/components/magnetic-button) | Cursor attraction | CTAs, navigation | | [Button Copy](/docs/components/button-copy) | Success feedback | Code snippets | | [Clip Corners Button](/docs/components/clip-corners-button) | Corner animation | Unique CTAs | ### Form Inputs [#form-inputs] Inputs with smooth focus and validation animations: | Component | Animation Type | Use Case | | ----------------------------------------------------------- | --------------- | ------------------ | | [Animated Input](/docs/components/animated-input) | Floating label | Forms, search | | [Animated OTP Input](/docs/components/animated-o-t-p-input) | Digit animation | Verification flows | ### Notification Components [#notification-components] Animated feedback and notification elements: | Component | Animation Type | Use Case | | ------------------------------------------------- | --------------- | --------------------- | | [Dynamic Island](/docs/components/dynamic-island) | Expand/collapse | Notifications, status | | [Basic Toast](/docs/components/basic-toast) | Slide animation | Alerts, confirmations | ## Why Motion & GSAP? [#why-motion--gsap] ### Performance Optimized [#performance-optimized] All animations use GPU-accelerated transforms (`transform` and `opacity`) for smooth 60fps performance. No layout thrashing or paint operations. ### Accessibility First [#accessibility-first] Every component respects the `prefers-reduced-motion` media query. Users who are sensitive to motion see instant transitions instead of animations. ```tsx // Built into every component const shouldReduceMotion = useReducedMotion(); ``` ### Natural Feel [#natural-feel] Animations use spring physics with carefully tuned parameters for natural, fluid motion that feels right: ```tsx transition={{ type: "spring", duration: 0.25, bounce: 0.1 }} ``` ## Getting Started [#getting-started] Install any animated component using the shadcn CLI: ```bash npx shadcn@latest add @smoothui/expandable-cards ``` Or browse all components: Explore the complete collection of {COMPONENT_COUNT} animated components. Set up SmoothUI in your React or Next.js project. ## Frequently Asked Questions [#frequently-asked-questions] No! All animations are built-in and work out of the box. You can use components without writing any animation code. For customization, basic Motion or GSAP knowledge helps but isn't required. Motion and GSAP are the animation dependencies. Components are tree-shakeable, so you only ship the code you use. Most components use Motion, while some use GSAP for advanced effects like the Gooey Popover. Yes! All components are designed for Next.js App Router and work with Server Components. Client-side animations hydrate smoothly without layout shift. Absolutely. Since you own the code (copied into your project), you can modify any animation parameters - duration, easing, spring physics, and more. # Animation Best Practices (/docs/guides/animation-best-practices) ## Why Animation Matters [#why-animation-matters] Animation isn't just decoration—it's a fundamental part of user experience. Well-crafted animations: * **Guide attention** to important elements and changes * **Provide feedback** that actions were registered * **Create continuity** between UI states * **Reduce cognitive load** by showing relationships between elements * **Delight users** with polished, professional interactions Studies show that appropriate animation can increase user engagement by up to 400% and significantly improve perceived performance, even when actual load times remain the same. Every SmoothUI component follows these principles. Animations are fast (200-300ms), purposeful, and always respect user preferences for reduced motion. *** ## Core Animation Principles [#core-animation-principles] ### Duration & Timing [#duration--timing] The most common mistake is making animations too slow. Users perceive interfaces as sluggish when animations exceed 300-400ms. | Animation Type | Recommended Duration | | ------------------------------------- | -------------------- | | Micro-interactions (hover, focus) | 100-200ms | | Standard transitions (show/hide) | 200-300ms | | Complex animations (page transitions) | 300-400ms | | Decorative/ambient | Up to 1000ms | ```tsx // Good: Fast, snappy interaction transition={{ duration: 0.2 }} // Bad: Feels sluggish transition={{ duration: 0.8 }} ``` ### Easing Functions [#easing-functions] Easing determines how an animation accelerates and decelerates. The right easing makes motion feel natural. | Easing | Use Case | CSS/Motion Value | | --------------- | ---------------------- | -------------------------------------- | | **ease-out** | Elements entering | `cubic-bezier(0.23, 1, 0.32, 1)` | | **ease-in-out** | Elements moving | `cubic-bezier(0.645, 0.045, 0.355, 1)` | | **ease** | Hover/color changes | `ease` (built-in) | | **spring** | Natural, bouncy motion | `type: "spring"` | ```tsx // Natural spring animation (recommended for most cases) transition={{ type: "spring", duration: 0.25, bounce: 0.1 // Keep low for UI (0.1-0.2) }} // Cubic bezier for precise control transition={{ duration: 0.2, ease: [0.23, 1, 0.32, 1] // ease-out }} ``` Never use `ease-in` for UI animations—it starts slow and feels unresponsive. Users expect immediate feedback when they interact. ### Transform vs Layout Properties [#transform-vs-layout-properties] This is critical for performance. Only animate **transform** and **opacity**—these are GPU-accelerated and don't trigger layout recalculations. ```tsx // GOOD: GPU-accelerated, smooth 60fps animate={{ opacity: 1, scale: 1, x: 0, y: 0 }} // BAD: Triggers layout, causes jank animate={{ width: 200, height: 100, marginLeft: 20 }} ``` | Property | Performance | Use Instead | | -------------------------------- | ----------- | ------------------------------ | | `width`, `height` | Poor | `scale` or `scaleX`/`scaleY` | | `top`, `left`, `right`, `bottom` | Poor | `x`, `y` (transform) | | `margin`, `padding` | Poor | `x`, `y` with fixed dimensions | | `opacity` | Excellent | Use freely | | `transform` | Excellent | Use freely | *** ## Motion Library Essentials [#motion-library-essentials] SmoothUI uses [Motion](https://motion.dev) (formerly Framer Motion) for animations. Here are the key concepts. ### Spring Physics [#spring-physics] Spring animations feel more natural than duration-based animations because they simulate real-world physics. ```tsx import { motion } from "motion/react"; ``` **Simplified spring syntax** (recommended): ```tsx transition={{ type: "spring", duration: 0.25, // Approximate duration bounce: 0.1 // 0 = no bounce, 1 = very bouncy }} ``` ### Variants [#variants] Variants let you define animation states and orchestrate complex animations: ```tsx const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.1 // Animate children sequentially } } }; const itemVariants = { hidden: { opacity: 0, y: 20 }, visible: { opacity: 1, y: 0 } }; {items.map(item => ( {item.name} ))} ``` ### Layout Animations [#layout-animations] Motion's `layout` prop automatically animates layout changes: ```tsx // Automatically animates position/size changes {isExpanded ? : } // Smooth shared element transitions {/* This element animates between positions */} ``` ### AnimatePresence [#animatepresence] For enter/exit animations, wrap components in `AnimatePresence`: ```tsx import { AnimatePresence, motion } from "motion/react"; {isVisible && ( Content that animates in and out )} ``` *** ## Performance Optimization [#performance-optimization] ### GPU-Accelerated Properties [#gpu-accelerated-properties] Always prefer these properties for smooth 60fps animations: ```tsx // These run on the GPU (compositor thread) transform: translateX(), translateY(), scale(), rotate() opacity // These trigger layout/paint (main thread) - AVOID width, height, top, left, margin, padding, border ``` ### Avoiding Layout Thrash [#avoiding-layout-thrash] Layout thrash occurs when you read and write to the DOM in quick succession: ```tsx // BAD: Forces synchronous layout elements.forEach(el => { const height = el.offsetHeight; // READ el.style.height = height + 10; // WRITE }); // GOOD: Batch reads, then writes const heights = elements.map(el => el.offsetHeight); // All READs elements.forEach((el, i) => { el.style.height = heights[i] + 10; // All WRITEs }); ``` ### will-change Hint [#will-change-hint] Use sparingly to hint browser optimization: ```css .animated-element { will-change: transform, opacity; } ``` Only apply `will-change` to elements that will actually animate. Overuse consumes memory and can hurt performance. ### When to Use CSS vs JavaScript Animations [#when-to-use-css-vs-javascript-animations] | Use CSS | Use JavaScript (Motion) | | -------------------------- | -------------------------------- | | Simple hover effects | Complex choreographed animations | | State transitions | Physics-based motion | | Keyframe animations | Gesture-driven animations | | Performance-critical loops | Dynamic, data-driven animations | *** ## Accessibility Guidelines [#accessibility-guidelines] ### Respecting Reduced Motion [#respecting-reduced-motion] Always check `prefers-reduced-motion`. Users enable this for medical reasons (vestibular disorders, motion sickness) or personal preference. ```tsx import { useReducedMotion } from "motion/react"; function AnimatedComponent() { const shouldReduceMotion = useReducedMotion(); return ( ); } ``` Every SmoothUI component includes `useReducedMotion` support. Animations are automatically disabled or minimized for users who prefer reduced motion. ### Motion Sensitivity Guidelines [#motion-sensitivity-guidelines] Even for users without reduced motion enabled: * **Avoid large-scale motion** (full-screen transitions, parallax) * **Limit simultaneous animations** (no more than 2-3 elements animating at once) * **Keep animations brief** (under 300ms for most interactions) * **Avoid infinite loops** (or provide controls to pause) ### Focus Management [#focus-management] When animating elements that affect focus: ```tsx // Ensure focus moves appropriately after animation { if (isOpen) { firstFocusableElement.current?.focus(); } }} > ``` *** ## Common Patterns [#common-patterns] ### Enter/Exit Animations [#enterexit-animations] ```tsx // Fade + slide up (most common) const fadeSlideUp = { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -10 }, transition: { duration: 0.2 } }; // Scale + fade (for modals, popovers) const scaleFade = { initial: { opacity: 0, scale: 0.95 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: 0.95 }, transition: { type: "spring", duration: 0.25, bounce: 0.1 } }; ``` ### Hover Effects [#hover-effects] ```tsx Click me ``` ### Staggered Lists [#staggered-lists] ```tsx {items.map(item => ( {item.name} ))} ``` ### Scroll-Triggered Animations [#scroll-triggered-animations] ```tsx import { useInView, motion } from "motion/react"; function ScrollReveal({ children }) { const ref = useRef(null); const isInView = useInView(ref, { once: true, margin: "-100px" }); return ( {children} ); } ``` *** ## Anti-Patterns to Avoid [#anti-patterns-to-avoid]
### Overanimating [#1-overanimating] Not everything needs to animate. Too much motion is distracting and exhausting. ```tsx // BAD: Everything bounces and wiggles // GOOD: Purposeful, minimal animation ```
### Slow Animations [#2-slow-animations] Animations over 300ms feel sluggish. Users shouldn't wait for your UI. ```tsx // BAD: Too slow transition={{ duration: 0.8 }} // GOOD: Snappy transition={{ duration: 0.2 }} ```
### Competing Animations [#3-competing-animations] Multiple elements animating simultaneously creates visual chaos. ```tsx // BAD: Everything animates at once {items.map(item => ( ))} // GOOD: Stagger or animate one at a time variants={{ visible: { transition: { staggerChildren: 0.05 } } }} ```
### Animation Without Purpose [#4-animation-without-purpose] Every animation should serve a function: feedback, guidance, or continuity. ```tsx // BAD: Spinning logo for no reason // GOOD: Spinner indicates loading state {isLoading && } ```
### Ignoring Reduced Motion [#5-ignoring-reduced-motion] Always implement reduced motion support. It's an accessibility requirement. ```tsx // BAD: No reduced motion check animate={{ x: 100, rotate: 360 }} // GOOD: Respects user preference animate={shouldReduceMotion ? { opacity: 1 } : { x: 100, rotate: 360 }} ``` ***
## Quick Reference [#quick-reference] ### Recommended Defaults [#recommended-defaults] ```tsx // Standard UI animation transition={{ type: "spring", duration: 0.25, bounce: 0.1 }} // Hover/tap feedback transition={{ type: "spring", stiffness: 400, damping: 17 }} // Enter/exit transition={{ duration: 0.2, ease: [0.23, 1, 0.32, 1] }} ``` ### Checklist for New Animations [#checklist-for-new-animations] * [ ] Duration under 300ms for interactions * [ ] Only animating transform/opacity * [ ] `useReducedMotion` implemented * [ ] Purposeful (not decorative) * [ ] Tested on low-end devices *** ## Further Reading [#further-reading] Browse all {COMPONENT_COUNT} animated components in SmoothUI. Learn about SmoothUI's design philosophy and patterns. Official Motion (Framer Motion) documentation. # REST API (/docs/guides/api) SmoothUI exposes a public REST API that lets you discover, search, and retrieve component metadata and source code programmatically. The API is designed for both human developers building tooling and AI agents that need structured component data. ## Overview [#overview] **Base URL:** `https://smoothui.dev/api/v1` **Authentication:** None required. The API is fully public. **CORS:** All endpoints include `Access-Control-Allow-Origin: *` headers, so you can call them from any origin. **Format:** All responses are JSON. Errors follow a consistent `{"error": "...", "status": 400}` envelope. **OpenAPI Spec:** A full OpenAPI 3.1 specification is available at [`/openapi.json`](https://smoothui.dev/openapi.json). ## Endpoints [#endpoints] ### List Components [#list-components] Returns a paginated list of all SmoothUI components. Supports filtering by category, complexity, animation type, and tag. ```bash title="Request" curl "https://smoothui.dev/api/v1/components?category=navigation&pageSize=10" ``` **Query parameters:** | Parameter | Type | Default | Description | | --------------- | ------- | ------- | ------------------------------------------------------------------------------------------------------------------- | | `category` | string | - | Filter by category: `basic-ui`, `button`, `text`, `ai`, `layout`, `feedback`, `data-display`, `navigation`, `other` | | `complexity` | string | - | Filter by complexity: `simple`, `moderate`, `complex` | | `animationType` | string | - | Filter by animation: `spring`, `tween`, `gesture`, `scroll`, `none` | | `tag` | string | - | Filter by tag (case-insensitive exact match) | | `page` | integer | `1` | Page number (1-based) | | `pageSize` | integer | `50` | Items per page (max 100) | ```json title="Response" { "data": [ { "name": "animated-tabs", "displayName": "AnimatedTabs", "description": "Tab navigation with smooth spring-based transitions.", "category": "navigation", "tags": ["animation", "tabs", "navigation"], "useCases": ["Tab navigation with smooth transitions"], "compositionHints": ["Combine with animated-tooltip for rich tab headers"], "complexity": "moderate", "animationType": "spring", "dependencies": ["motion"], "registryDependencies": [], "hasReducedMotion": true, "propsCount": 5, "installCommand": "npx shadcn@latest add @smoothui/animated-tabs", "docUrl": "https://smoothui.dev/docs/components/animated-tabs", "registryUrl": "https://smoothui.dev/r/animated-tabs.json" } ], "total": 84, "page": 1, "pageSize": 10, "totalPages": 9 } ``` ### Get Component Details [#get-component-details] Returns full metadata for a single component. Add `?include=source` to also retrieve the raw source code. ```bash title="Request" curl "https://smoothui.dev/api/v1/components/animated-tabs" ``` ```bash title="Request (with source code)" curl "https://smoothui.dev/api/v1/components/animated-tabs?include=source" ``` ```json title="Response" { "component": { "name": "animated-tabs", "displayName": "AnimatedTabs", "description": "Tab navigation with smooth spring-based transitions.", "category": "navigation", "tags": ["animation", "tabs", "navigation"], "complexity": "moderate", "animationType": "spring", "installCommand": "npx shadcn@latest add @smoothui/animated-tabs", "docUrl": "https://smoothui.dev/docs/components/animated-tabs", "registryUrl": "https://smoothui.dev/r/animated-tabs.json" }, "source": "// --- index.tsx ---\n\"use client\";\nimport { motion } from ..." } ``` Returns `404` if the component name does not exist. ### Search Components [#search-components] Keyword-based relevance search across component names, descriptions, tags, use cases, and categories. At least one of `q`, `category`, or `tags` is required. ```bash title="Request" curl "https://smoothui.dev/api/v1/components/search?q=modal+dialog" ``` **Query parameters:** | Parameter | Type | Required | Description | | ---------- | ------ | -------- | ---------------------------------------------- | | `q` | string | No\* | Search query | | `category` | string | No\* | Pre-filter by category | | `tags` | string | No\* | Comma-separated required tags (all must match) | \*At least one parameter is required. ```json title="Response" { "data": [ { "name": "basic-modal", "displayName": "BasicModal", "description": "Accessible modal dialog with smooth enter/exit animations.", "category": "feedback", "tags": ["modal", "dialog", "overlay"], "relevanceScore": 12 } ], "total": 3, "query": "modal dialog", "filters": {} } ``` Results are ranked by relevance score (higher is better). Exact name matches score highest, followed by tag matches, use case matches, description matches, and category matches. ### List Blocks [#list-blocks] Returns a paginated list of pre-built page sections (blocks). Supports filtering by block type and tag. ```bash title="Request" curl "https://smoothui.dev/api/v1/blocks?blockType=hero" ``` **Query parameters:** | Parameter | Type | Default | Description | | ----------- | ------- | ------- | ------------------------------------------------------------------------------------------------- | | `blockType` | string | - | Filter by type: `hero`, `features`, `pricing`, `testimonials`, `cta`, `footer`, `header`, `other` | | `tag` | string | - | Filter by tag (case-insensitive exact match) | | `page` | integer | `1` | Page number | | `pageSize` | integer | `50` | Items per page (max 100) | ```json title="Response" { "data": [ { "name": "hero-section", "displayName": "HeroSection", "description": "Animated hero section with gradient text and CTA buttons.", "blockType": "hero", "components": ["animated-gradient-text", "magnetic-button"], "category": "layout", "tags": ["hero", "landing-page"], "complexity": "moderate", "animationType": "spring", "installCommand": "npx shadcn@latest add @smoothui/hero-section" } ], "total": 5, "page": 1, "pageSize": 50, "totalPages": 1 } ``` ### Get Block Details [#get-block-details] Returns full metadata for a single block. Add `?include=source` for raw source code. ```bash title="Request" curl "https://smoothui.dev/api/v1/blocks/hero-section?include=source" ``` Returns `404` if the block name does not exist. ### Suggest Components [#suggest-components] Given a natural-language description of what you need, returns the top 10 most relevant components and blocks. This endpoint is particularly useful for AI agents selecting components based on a user's request. ```bash title="Request" curl "https://smoothui.dev/api/v1/suggest?need=animated+tab+navigation" ``` | Parameter | Type | Required | Description | | --------- | ------ | -------- | --------------------------------------------- | | `need` | string | Yes | Natural-language description of what you need | ```json title="Response" { "need": "animated tab navigation", "suggestions": [ { "type": "component", "name": "animated-tabs", "displayName": "AnimatedTabs", "description": "Tab navigation with smooth spring-based transitions.", "category": "navigation", "relevanceScore": 21, "installCommand": "npx shadcn@latest add @smoothui/animated-tabs", "docUrl": "https://smoothui.dev/docs/components/animated-tabs", "registryUrl": "https://smoothui.dev/r/animated-tabs.json" } ], "total": 1 } ``` Suggestions include both components and blocks, distinguished by the `type` field. Results are ranked by keyword relevance. ## Error Handling [#error-handling] All error responses use a consistent JSON envelope: ```json title="Error response" { "error": "Component \"unknown\" not found", "status": 404 } ``` Common status codes: | Status | Meaning | | ------ | ------------------------------------------- | | `200` | Success | | `400` | Bad request (missing or invalid parameters) | | `404` | Resource not found | ## For AI Agents [#for-ai-agents] If you are building an AI agent or coding assistant that works with SmoothUI, here is the recommended workflow: 1. **Discovery** -- Use `/api/v1/suggest?need=...` with the user's natural-language request to find relevant components. 2. **Detail** -- Fetch full metadata and source with `/api/v1/components/{name}?include=source`. 3. **Install** -- Use the `installCommand` field from the metadata to install the component. 4. **Integrate** -- Use the source code and `compositionHints` to wire the component into the user's project. You can also fetch the full [OpenAPI specification](https://smoothui.dev/openapi.json) for automated client generation or tool registration. For MCP-based integration with AI coding assistants, see the [MCP Server](/docs/guides/mcp) guide. # Astro Integration (/docs/guides/astro) ## Overview [#overview] Astro's [islands architecture](https://docs.astro.build/en/concepts/islands/) lets you use SmoothUI React components as interactive islands within your static Astro pages. Each SmoothUI component hydrates independently, giving you smooth animations with minimal JavaScript overhead. SmoothUI components are standard React components. Astro renders them server-side and hydrates them on the client using directives like `client:load` and `client:visible`. No modifications to the components are needed. ## Prerequisites [#prerequisites] Before getting started, make sure you have the following: | Requirement | Minimum Version | Purpose | | ------------------------------------------------------------------------------ | --------------- | --------------------------- | | [Node.js](https://nodejs.org/en) | 18+ | Runtime | | [Astro](https://astro.build) | 4.0+ | Framework | | [@astrojs/react](https://docs.astro.build/en/guides/integrations-guide/react/) | 4.0+ | React integration for Astro | | [Tailwind CSS](https://tailwindcss.com) | 4.0+ | Styling | | [Motion](https://motion.dev) | 12.0+ | Animations (Framer Motion) | ## Project Setup [#project-setup]
### Create a New Astro Project [#1-create-a-new-astro-project] If you're starting from scratch, create a new Astro project:
### Add the React Integration [#2-add-the-react-integration] SmoothUI components are React components, so you need `@astrojs/react`: This automatically updates your `astro.config.mjs{:js}` to include the React integration: ```js title="astro.config.mjs" import { defineConfig } from "astro/config"; import react from "@astrojs/react"; export default defineConfig({ integrations: [react()], }); ```
### Set Up Tailwind CSS 4 [#3-set-up-tailwind-css-4] Install Tailwind CSS and the Astro integration: Add the Tailwind CSS Vite plugin to your Astro config: ```js title="astro.config.mjs" import { defineConfig } from "astro/config"; import react from "@astrojs/react"; import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ integrations: [react()], vite: { plugins: [tailwindcss()], }, }); ``` Create your main CSS file and import Tailwind: ```css title="src/styles/global.css" @import "tailwindcss"; ``` Import the stylesheet in your layout: ```astro title="src/layouts/Layout.astro" --- interface Props { title: string; } const { title } = Astro.props; --- {title} ```
### Install Motion [#4-install-motion] SmoothUI animations are powered by Motion (Framer Motion). Install it as a dependency:
### Configure Path Aliases [#5-configure-path-aliases] SmoothUI components use the `@/{:js}` path alias. Add it to your `tsconfig.json{:js}`: ```json title="tsconfig.json" { "extends": "astro/tsconfigs/strict", "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./src/*"] } } } ```
## Installing SmoothUI Components [#installing-smoothui-components] ### Using the SmoothUI CLI [#using-the-smoothui-cli] ### Using the shadcn CLI [#using-the-shadcn-cli] If this is your first time using the shadcn CLI in an Astro project, it will prompt you to create a `components.json{:js}` file. Accept the defaults — the CLI auto-detects Astro projects and configures paths accordingly. ## Client Directives [#client-directives] Astro components are static by default. To make SmoothUI components interactive, you need to add a [client directive](https://docs.astro.build/en/reference/directives-reference/#client-directives) that tells Astro when to hydrate the component. | Directive | When It Hydrates | Best For | | ----------------------------- | ------------------------------------ | ------------------------------------------------ | | `client:load{:astro}` | Immediately on page load | Above-the-fold components, critical interactions | | `client:visible{:astro}` | When the component scrolls into view | Below-the-fold components, cards, animations | | `client:idle{:astro}` | When the browser is idle | Non-critical UI, background animations | | `client:only="react"{:astro}` | Client-only, no SSR | Components that use browser APIs on mount | Use `client:visible{:astro}` for most SmoothUI components — it gives the best performance since components only hydrate when the user can see them. Use `client:load{:astro}` for hero sections or components that must be interactive immediately. ## Using Components in Astro Pages [#using-components-in-astro-pages] Here is a complete example of using a SmoothUI component in an Astro page: ```astro title="src/pages/index.astro" --- import Layout from "../layouts/Layout.astro"; import { SiriOrb } from "@/components/smoothui/ui/SiriOrb"; ---

SmoothUI in Astro

``` ### Using Multiple Components [#using-multiple-components] ```astro title="src/pages/demo.astro" --- import Layout from "../layouts/Layout.astro"; import { MagneticButton } from "@/components/smoothui/ui/MagneticButton"; import { ExpandableCards } from "@/components/smoothui/ui/ExpandableCards"; import { TypewriterText } from "@/components/smoothui/ui/TypewriterText"; ---
Get Started
``` ## Motion in Astro Islands [#motion-in-astro-islands] Motion (Framer Motion) works seamlessly inside Astro islands. Since each island is a fully hydrated React component, all animation features are available — spring physics, layout animations, gestures, and `AnimatePresence{:tsx}`. If you create custom animated components alongside SmoothUI, follow the same pattern: ```tsx title="src/components/FadeIn.tsx" "use client"; import { motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; export type FadeInProps = { children: ReactNode; }; const FadeIn = ({ children }: FadeInProps) => { const shouldReduceMotion = useReducedMotion(); return ( {children} ); }; export default FadeIn; ``` ```astro title="src/pages/index.astro" --- import FadeIn from "../components/FadeIn"; ---

This content fades in when scrolled into view.

``` The `"use client"{:tsx}` directive at the top of React component files is a Next.js convention. Astro ignores it, so it does no harm — and it keeps your components compatible with both frameworks. ## Troubleshooting [#troubleshooting] Make sure you added a client directive (`client:load{:astro}`, `client:visible{:astro}`, etc.) to the component. Without a client directive, Astro renders the component as static HTML with no JavaScript, so animations won't run. Verify that your `global.css{:css}` includes `@import "tailwindcss"{:css}` and that it's imported in your layout. Also check that the Tailwind Vite plugin is configured in `astro.config.mjs{:js}`. If a component relies on browser-only APIs (like `window{:js}` or `localStorage{:js}`) during initial render, use `client:only="react"{:astro}` instead of `client:load{:astro}`. This skips server-side rendering entirely for that component. Motion works well with SSR by default. If you see warnings about `useLayoutEffect{:tsx}`, it's usually harmless. For components that heavily depend on browser measurements, use `client:only="react"{:astro}`. ## Next Steps [#next-steps] Learn about all available installation methods including the SmoothUI CLI and shadcn registry. Explore the complete collection of {COMPONENT_COUNT} animated React components. Master animation performance, accessibility, and timing guidelines. The simplest setup for using SmoothUI in a client-side React app. Full-stack SSR setup with Remix and React Router v7. Type-safe full-stack React with streaming SSR. # Changelog (/docs/guides/changelog) > This page is a curated highlight reel of major SmoothUI releases. For the > full technical log auto-generated from conventional commits, see > [GitHub Releases](https://github.com/educlopez/smoothui/releases) or > [`CHANGELOG.md`](https://github.com/educlopez/smoothui/blob/main/CHANGELOG.md). ## 3.6.0 [#360] ### AI components [#ai-components] * Twenty new components for agent surfaces: `ai-message`, `ai-response`, `ai-reasoning`, `ai-tool-call`, `ai-task-list`, `ai-diff`, `ai-artifact`, `ai-approval`, `ai-sources`, `ai-suggestions`, `ai-context-meter`, `ai-loader`, `ai-prompt-input`, `ai-conversation` and `ai-core` * A shared **`AIState` contract** (`idle` -> `listening` -> `thinking` -> `streaming` -> `done` -> `error`) that every one of them reads, so a whole surface can be driven from one piece of state * **`siri-orb`**: layered conic gradients animated through a registered `--angle` property, reacting to real microphone loudness ### Templates [#templates] * New **[Templates](/docs/templates)** section: a whole product surface installed in one command, with every component it composes pulled in as a registry dependency * **[Chat Template](/docs/templates/chat)** - sidebar, transcript and composer, with a scripted agent that exercises every AI component. No model, no network call, no API key * Template pages lead with a live preview and screenshots rather than source, and list what installing gives you, read from the registry so it cannot drift ### Docs, rebuilt [#docs-rebuilt] * **Component pages** split: the documentation scrolls, the component stays pinned beside it in an iframe, so the viewport switcher shows what a phone would actually show * **Block pages** keep every control on the block it belongs to (Preview/Code, viewport, install command, add to bundle, Open in v0) because a page documenting five heroes cannot answer "the code of which one?" * **Masonry indexes** for components and blocks, each card as tall as its own demo * A **file tree** beside the source on block pages, keyed by the path each file lands at after installing ### Fixes worth knowing about [#fixes-worth-knowing-about] * `text-primary` was invisible ink in both themes: `primary` is a surface here, not an accent. It affected an icon chip, a bento highlight, two link variants, a skeleton, and **ten focus rings across six components** * Buttons had no pointer cursor after Tailwind v4 dropped it from Preflight * Block sources never resolved in the docs, so no block ever showed its own code * The chat template on a phone: the composer was cut off, the orb avatar was clipped, and there was no way to change conversation ## 3.5.0 [#350] ### Theme Studio [#theme-studio] * New **[Theme Studio](/themes)**: a draggable, infinite-canvas board previewing all 70 component demos with your theme applied live * Dialkit-style inspector with palette, light/dark, font, neutral tint, a continuous radius scrubber, and an accent lightness scrubber * Component search and one-click board re-centering ### Installable Themes & Presets [#installable-themes--presets] * Six **`registry:theme`** items (`theme-candy` … `theme-green`) installable in any shadcn project — full token set, light and dark, Radix and Base UI compatible * **SmoothUI presets**: shareable codes (`s1.…`) that round-trip the entire studio state via URL, and install as on-the-fly custom themes through `theme-custom-.json` * Per-palette [shadcn/create](https://ui.shadcn.com/create) preset mapping, labeled as approximation ### Accessibility & Quality [#accessibility--quality] * **100% `prefers-reduced-motion` compliance**: every animated block now renders statically under reduced motion (WCAG 2.1 SC 2.3.3) * Fixed real accessibility violations caught by new tests: unlabeled logo links, unlabeled carousel buttons, invalid `
` structure * All images across the library are now non-draggable, so drag interactions never fight browser ghost-drags ### Registry & Infrastructure [#registry--infrastructure] * Registry content rewriting: installed components and blocks now ship with fully resolvable imports (no more workspace specifiers leaking) * Blocks correctly typed as `registry:block`; new `lib` (animation constants) and `data` items; AI **skill** item installable at `/r/skill.json` * Test suite grew from 106 to 186 tests (every block and component covered) with coverage gates in CI, plus typecheck and registry-validation CI jobs ## 3.4.0 [#340] ### AI Integration [#ai-integration] * Added **REST API** with 6 endpoints under `/api/v1/` for component discovery, search, and suggestions * Added **OpenAPI 3.1 spec** at `/openapi.json` for programmatic access * Added **`/llms-components.json`** machine-readable component catalog endpoint * Enhanced **`/llms-full.txt`** with structured component metadata * Added structured `smoothui` metadata to all **84 component and block** `package.json` files * Added **AI Integration** and **REST API reference** docs pages * Added animated **AI-Native** section to the landing page ### New Components [#new-components] * Added **Book** component inspired by Vercel Geist * Added **Exposure Slider** component inspired by iOS Camera ### Documentation [#documentation] * Added per-component **accessibility documentation** across all components * Added **bundle size badges** to component docs and gallery * Added **Astro**, **Vite**, **Remix**, and **TanStack Start** framework integration guides * Added **visual component gallery** with filtering, search, and live previews * Added **community section** with component requests and showcase ### Fixes [#fixes] * Resolved 12 Dependabot vulnerability alerts * Fixed recently-modified indicator system and sorted sidebar components ## 3.3.0 [#330] ### New Components [#new-components-1] * Added **Gooey Popover** component with SVG filter effects and GSAP * Added **Agent Avatar** component for AI assistant interfaces * Added **Animated Avatar Group** component with stacking animations * Added **Animated Tooltip** component with spring transitions * Added **Scrubber** component integrated with Grid Loader demo ### Enhancements [#enhancements] * Enhanced **Grid Loader** with blur, gap, rounded props and redesigned customizer panel * Added theme tokens for Scrubber, Grid Loader customizer, and reference links * Added Vercel OSS Program badge and Speed Insights * Improved structured data across docs site ### Fixes [#fixes-1] * Fixed TweetCard 100% error rate on Vercel (removed isomorphic-dompurify) * Reduced Vercel function GB-Hours usage ## 3.2.0 [#320] ### New Components [#new-components-2] * Added **Grid Loader** component with 65 preset patterns ### CLI [#cli] * Added standalone **SmoothUI CLI** with ASCII logo header and improved TUI * Redesigned installer component with dual CLI tabs * Added custom Shiki themes and global package manager state ### Blog & Landing [#blog--landing] * Added interactive tutorial blog section * Added CLI announcement badge to hero section ### Fixes [#fixes-2] * Patched Dependabot security vulnerabilities ## 3.1.0 [#310] ### New Components [#new-components-3] * Added **Magnetic Button** component with cursor-following magnetic effect and shadcn-style button variants * Added **Notification Badge** component with dot, count, and status variants * Added **Skeleton Loader** component with shimmer, pulse, and wave animation variants * Added **Animated Tabs** component with underline, pill, and segment style variants * Added **Animated Toggle** component with morph and icon transition variants ### New Blocks [#new-blocks] * Added **FAQ 3** block with searchable questions and filter animations * Added **FAQ 4** block with categorized questions and tab navigation * Added **Footer 3** mega footer block with newsletter signup * Added **Footer 4** minimal single-row footer block * Added **Logo Cloud 3** block with infinite marquee and pause on hover * Added **Logo Cloud 4** block with interactive grid and hover effects ## 3.0.6 [#306] * Enhanced accessibility and keyboard navigation across all input components * Added motion reduction support (`prefers-reduced-motion`) across components * Integrated motion reduction in AI Branch component ## 3.0.5 [#305] * Added **TweetCard** component for displaying Twitter/X posts with media support * Enhanced TweetCard security with DOMPurify sanitization ## 3.0.4 [#304] * Added **SwitchboardCard** component with animated light grid effect * Added **Header 4** block with interactive 3D grid hero section * Enhanced dropdown components with portal rendering and position handling ## 3.0.3 [#303] * Added **Searchable Dropdown** component with search filtering and keyboard navigation * Improved Wave Text animation performance ## 3.0.2 [#302] * Added GlowHover component with cursor-following glow effect - generic and reusable component that works with any React element (cards, buttons, etc.) * Added InfiniteSlider component for smooth, infinite scrolling with customizable speed and direction * Added ReviewsCarousel component for displaying testimonials with smooth animations and keyboard navigation * Enhanced AppleInvites component with responsive sizing and styling support * Improved RSS feed processing for blocks with better categorization and date extraction * Optimized image loading across components with enhanced getImageKitUrl options * Refactored ScrollableCardStack component to use images instead of videos for better performance * Fixed GitHub Stars Animation component issues ## 3.0.1 [#301] * Added RSS feed integration using @wandry/analytics-sdk for component registry updates * Fixed Safari rendering bug in Siri Orb component with improved mask-radius handling * Created dedicated sponsors page with tier-based sections (Velocity, Supporters, Own Projects) * Enhanced sponsor display components with rotation and empty state handling ## 3.0.0 [#300] * Complete monorepo restructure with improved organization and maintainability * Migrated to Next.js 16 with latest features and performance improvements * Integrated Fumadocs for better documentation experience * Added Ultracite for enhanced code quality and tooling * Implemented Biome for fast linting and formatting * Improved build system and package management * Enhanced developer experience with better TypeScript configuration * Updated all dependencies to latest stable versions ## 2.9.0 [#290] * New Logo Clouds, Stats, Team, Footer, and FAQs blocks sections * Enhanced sidebar filter system with All, Components, and Blocks categories * Improved navigation with conditional sidebar content * Better content organization separating components from blocks ## 2.8.0 [#280] * New comprehensive search system with keyboard shortcuts and real-time results * Advanced tag-based component discovery with categorized organization * New tag pages with related components and category information * Enhanced component search dialog with popular tags and smart suggestions ## 2.7.0 [#270] * Full compatibility with shadcn CLI v3 namespace system * New registry system with automatic dependency management * MCP (Model Context Protocol) support for AI assistants * Enhanced documentation with comprehensive installation guides ## 2.6.0 [#260] * New AI section with AI-powered components * New components: AI Input, AI Branch, Scrollable Card Stack, Rich Popover * New AI menu in the landing page navigation ## 2.0.0 [#200] * New Design System and website look * New mascot called Smoothy * Props documentation * Color switcher * Refine shadcn/ui installation ## 1.0.0 [#100] * Initial release of SmoothUI * Core component library with React and Framer Motion * Basic documentation and examples * CLI tool for component installation # Design Principles (/docs/guides/design-principles) ## Design Philosophy [#design-philosophy] SmoothUI is built on the principles of simplicity, accessibility, and performance. Each component is designed to be beautiful by default while remaining highly customizable.
## Color System [#color-system] SmoothUI uses a carefully crafted color system based on OKLCH color space for better color consistency and accessibility. The system includes both light and dark variants. ### Brand Colors [#brand-colors]
oklch(0.72 0.2 352.53)
oklch(0.66 0.21 354.31)
### Neutral Colors [#neutral-colors] The neutral color palette provides a range of grays that work well in both light and dark modes.

50

100

200

300

400

500

600

700

800

900

950

1000

## Design System CSS [#design-system-css] Add this CSS to your global styles to enable the full SmoothUI design system:
Expand CSS
```css title="global.css" @import "tailwindcss"; @import "tw-animate-css"; @custom-variant dark (&:is(.dark *)); @theme inline { --color-brand: var(--color-brand); --color-brand-secondary: var(--color-brand-secondary); --color-smooth-50: var(--color-smooth-50); --color-smooth-100: var(--color-smooth-100); --color-smooth-200: var(--color-smooth-200); --color-smooth-300: var(--color-smooth-300); --color-smooth-400: var(--color-smooth-400); --color-smooth-500: var(--color-smooth-500); --color-smooth-600: var(--color-smooth-600); --color-smooth-700: var(--color-smooth-700); --color-smooth-800: var(--color-smooth-800); --color-smooth-900: var(--color-smooth-900); --color-smooth-950: var(--color-smooth-950); --color-smooth-1000: var(--color-smooth-1000); --color-border: var(--color-smooth-500); --color-sidebar-ring: var(--color-brand); --color-sidebar-border: var(--color-smooth-400); --color-sidebar-accent-foreground: var(--color-smooth-900); --color-sidebar-accent: var(--sidebar-accent); --color-sidebar-primary-foreground: var(--color-smooth-1000); --color-sidebar-primary: var(--color-brand); --color-sidebar-foreground: var(--color-smooth-1000); --color-sidebar: var(--color-smooth-100); --color-ring: var(--color-brand); --color-input: var(--color-smooth-400); --color-destructive: var(--destructive); --color-accent-foreground: var(--color-smooth-1000); --color-accent: var(--color-brand); --color-muted-foreground: var(--color-smooth-800); --color-muted: var(--color-smooth-200); --color-background: var(--color-smooth-50); --color-foreground: var(--color-smooth-1000); --color-primary: var(--color-smooth-100); --color-primary-foreground: var(--color-smooth-950); --color-secondary: var(--color-smooth-200); --color-secondary-foreground: var(--color-smooth-900); --color-popover-foreground: var(--color-smooth-1000); --color-popover: var(--color-smooth-50); --color-card-foreground: var(--color-smooth-1000); --color-card: var(--color-smooth-100); --radius-sm: calc(var(--radius) - 4px); --radius-md: calc(var(--radius) - 2px); --radius-lg: var(--radius); --radius-xl: calc(var(--radius) + 4px); } :root { --color-brand: oklch(0.72 0.2 352.53); --color-brand-secondary: oklch(0.66 0.21 354.31); --color-smooth-50: oklch(99.11% 0 0); --color-smooth-100: oklch(97.91% 0 0); --color-smooth-200: oklch(96.42% 0 0); --color-smooth-300: oklch(94.61% 0 0); --color-smooth-400: oklch(93.1% 0 0); --color-smooth-500: oklch(91.28% 0 0); --color-smooth-600: oklch(89.14% 0 0); --color-smooth-700: oklch(82.97% 0 0); --color-smooth-800: oklch(65% 0 0); --color-smooth-900: oklch(61.67% 0 0); --color-smooth-950: oklch(54.17% 0 0); --color-smooth-1000: oklch(20.46% 0 0); --border: var(--color-smooth-300); --shimmer-highlight: var(--color-smooth-200); --shimmer-base: var(--color-smooth-1000); --radius: 0.625rem; } .dark { --color-smooth-50: oklch(20.02% 0 0); --color-smooth-100: oklch(22.64% 0 0); --color-smooth-200: oklch(25.62% 0 0); --color-smooth-300: oklch(27.68% 0 0); --color-smooth-400: oklch(30.12% 0 0); --color-smooth-500: oklch(32.5% 0 0); --color-smooth-600: oklch(36.39% 0 0); --color-smooth-700: oklch(43.13% 0 0); --color-smooth-800: oklch(54.52% 0 0); --color-smooth-900: oklch(59.31% 0 0); --color-smooth-950: oklch(70.58% 0 0); --color-smooth-1000: oklch(94.61% 0 0); --border: var(--color-smooth-300); --shimmer-highlight: var(--color-smooth-200); --shimmer-base: var(--color-smooth-1000); } /* Component NumberFlow */ @layer utilities { .slide-in-up { animation: slideInUp 0.3s forwards; } .slide-out-up { animation: slideOutUp 0.3s forwards; } .slide-in-down { animation: slideInDown 0.3s forwards; } .slide-out-down { animation: slideOutDown 0.3s forwards; } @keyframes slideInUp { from { transform: translateY(50px); filter: blur(5px); } to { transform: translateY(0px); filter: blur(0px); } } @keyframes slideOutUp { from { transform: translateY(0px); filter: blur(0px); } to { transform: translateY(-50px); filter: blur(5px); } } @keyframes slideInDown { from { transform: translateY(-50px); filter: blur(5px); } to { transform: translateY(0px); filter: blur(0px); } } @keyframes slideOutDown { from { transform: translateY(0px); filter: blur(0px); } to { transform: translateY(50px); filter: blur(5px); } } } /* Component PowerOffSlide */ @layer utilities { .loading-shimmer { text-fill-color: transparent; -webkit-text-fill-color: transparent; animation-delay: 0.5s; animation-duration: 3s; animation-iteration-count: infinite; animation-name: loading-shimmer; background: var(--shimmer-base) gradient( linear, 100% 0, 0 0, from(var(--shimmer-base)), color-stop(0.5, var(--shimmer-highlight)), to(var(--shimmer-base)) ); background: var(--shimmer-base) -webkit-gradient( linear, 100% 0, 0 0, from(var(--shimmer-base)), color-stop(0.5, var(--shimmer-highlight)), to(var(--shimmer-base)) ); background-clip: text; -webkit-background-clip: text; background-repeat: no-repeat; background-size: 50% 200%; display: inline-block; } .loading-shimmer { background-position: -100% top; } .loading-shimmer:hover { -webkit-text-fill-color: var(--shimmer-base); animation: none; background: transparent; } @keyframes loading-shimmer { 0% { background-position: -100% top; } to { background-position: 250% top; } } } /* Component AppleInvites */ @layer utilities { .gradient-mask-t-0 { -webkit-mask-image: linear-gradient(#0000, #000); mask-image: linear-gradient(#0000, #000); } } ```
## Customization [#customization] SmoothUI components are highly customizable. Here are the main ways to customize them: Override CSS variables to customize colors, spacing, and other design tokens globally. Use Tailwind utility classes to customize individual components or create variants. Many components accept props for customization like size, variant, and color options. # Getting Started (/docs/guides/getting-started) ## Prerequisites [#prerequisites] Before you begin, make sure you have: * **Node.js** 18.17 or later * **React** 19 or later * **Tailwind CSS** 4 or later configured in your project * A package manager: pnpm (recommended), npm, yarn, or bun Already have a project? Jump to the framework-specific setup guides: * **[Next.js](/docs/guides/nextjs)** — Recommended for most projects * **[Vite + React](/docs/guides/vite)** — Client-side React apps * **[Astro](/docs/guides/astro)** — Islands architecture * **[Remix](/docs/guides/remix)** — Full-stack SSR * **[TanStack Start](/docs/guides/tanstack-start)** — Type-safe full-stack *** ## Step 1: Set Up a Next.js Project [#step-1-set-up-a-nextjs-project] If you already have a project, skip to [Step 2](#step-2-initialize-shadcnui). ```bash npx create-next-app@latest my-app --typescript --tailwind --app cd my-app ``` *** ## Step 2: Initialize shadcn/ui [#step-2-initialize-shadcnui] SmoothUI builds on the shadcn ecosystem. If you haven't initialized shadcn yet: Follow the prompts to configure your project. This sets up the `components.json` file and the utility functions SmoothUI components depend on. *** ## Step 3: Install Your First Component [#step-3-install-your-first-component] SmoothUI is an official shadcn registry — no extra configuration needed. Install a component using either the SmoothUI CLI or the shadcn CLI: ### Option A: SmoothUI CLI (recommended) [#option-a-smoothui-cli-recommended] ### Option B: shadcn Registry [#option-b-shadcn-registry] Both methods automatically install the component files and any required dependencies (like `motion`). *** ## Step 4: Use the Component [#step-4-use-the-component] Import and render the component in your page: ```tsx title="app/page.tsx" import SmoothButton from "@/components/smoothui/ui/SmoothButton" export default function Home() { return (
Click me
) } ``` Start your dev server to see it in action: You should see an animated button with smooth hover and press transitions. *** ## Step 5: Explore More Components [#step-5-explore-more-components] Browse the full component library and install anything you need: Running the add command without arguments launches interactive mode where you can search and select multiple components at once. ### Popular Components to Try [#popular-components-to-try] * **[Expandable Cards](/docs/components/expandable-cards)** — Cards that expand with smooth spring animations * **[Animated Tabs](/docs/components/animated-tabs)** — Tab navigation with animated indicator * **[Siri Orb](/docs/components/siri-orb)** — Mesmerizing animated gradient orb * **[Rich Popover](/docs/components/rich-popover)** — Contextual popover with fluid transitions * **[Dynamic Island](/docs/components/dynamic-island)** — Apple-inspired adaptive container *** ## How It Works [#how-it-works] SmoothUI components are **copied into your project** — not installed as a dependency. This means: 1. **Full ownership** — You can customize any component to fit your needs 2. **No version lock-in** — Components don't break when a library updates 3. **Tree-shakeable** — Only the components you install are in your bundle 4. **Type-safe** — Full TypeScript support with exported prop types Components are installed to `components/smoothui/ui/` by default and use: * **[Motion](https://motion.dev)** for spring-based animations * **[Tailwind CSS](https://tailwindcss.com)** for styling * **[shadcn/ui](https://ui.shadcn.com)** primitives where applicable *** ## Next Steps [#next-steps] * **[Installation methods](/docs/guides/installation)** — Learn about all installation options in detail * **[Animation best practices](/docs/guides/animation-best-practices)** — Understand how SmoothUI handles animations * **[Design principles](/docs/guides/design-principles)** — The philosophy behind SmoothUI components * **[SmoothUI vs shadcn](/docs/guides/shadcn-alternative)** — How SmoothUI complements shadcn/ui # React Hooks (/docs/guides/hooks) ## Overview [#overview] SmoothUI provides utility hooks that help you build responsive, device-aware components. These hooks are designed for performance and work seamlessly with Server-Side Rendering (SSR). *** ## useIsMobile [#useismobile] Detects whether the current viewport is mobile-sized. Returns a boolean that updates in real-time as the viewport changes. ### Installation [#installation] ```bash npx shadcn@latest add @smoothui/use-mobile ``` Or copy the hook directly: ```tsx import * as React from "react"; const MOBILE_BREAKPOINT = 768; export function useIsMobile() { const [isMobile, setIsMobile] = React.useState( undefined ); React.useEffect(() => { const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`); const onChange = () => { setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); }; mql.addEventListener("change", onChange); setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); return () => mql.removeEventListener("change", onChange); }, []); return !!isMobile; } ``` ### Usage [#usage] ```tsx import { useIsMobile } from "@/hooks/use-mobile"; function ResponsiveComponent() { const isMobile = useIsMobile(); return (
{isMobile ? ( ) : ( )}
); } ``` ### Parameters [#parameters] This hook takes no parameters. The mobile breakpoint is set to **768px** by default. ### Returns [#returns] | Value | Type | Description | | ---------- | --------- | ------------------------------------------- | | `isMobile` | `boolean` | `true` if viewport width is less than 768px | ### Features [#features] * **SSR Safe**: Returns `false` during server-side rendering (no hydration mismatch) * **Real-time Updates**: Responds to viewport changes via `matchMedia` listener * **Performance Optimized**: Uses `matchMedia` instead of resize events for better performance * **Memory Safe**: Properly cleans up event listeners on unmount ### Common Use Cases [#common-use-cases] #### Conditional Rendering [#conditional-rendering] ```tsx function Header() { const isMobile = useIsMobile(); return (
{isMobile ? : }
); } ``` #### Responsive Animations [#responsive-animations] ```tsx import { motion } from "motion/react"; import { useIsMobile } from "@/hooks/use-mobile"; function AnimatedCard() { const isMobile = useIsMobile(); return ( Card content ); } ``` #### Responsive Grid [#responsive-grid] ```tsx function ProductGrid({ products }) { const isMobile = useIsMobile(); const columns = isMobile ? 1 : 3; return (
{products.map(product => ( ))}
); } ``` ### SSR Considerations [#ssr-considerations] The hook returns `false` on the initial server render, then updates on the client. If you need to avoid layout shift, consider: ```tsx function ResponsiveLayout() { const isMobile = useIsMobile(); const [mounted, setMounted] = React.useState(false); React.useEffect(() => { setMounted(true); }, []); // Show a loading state or neutral layout until mounted if (!mounted) { return ; } return isMobile ? : ; } ``` ### Customizing the Breakpoint [#customizing-the-breakpoint] If you need a different breakpoint, create a modified version: ```tsx const TABLET_BREAKPOINT = 1024; export function useIsTablet() { const [isTablet, setIsTablet] = React.useState( undefined ); React.useEffect(() => { const mql = window.matchMedia(`(max-width: ${TABLET_BREAKPOINT - 1}px)`); const onChange = () => { setIsTablet(window.innerWidth < TABLET_BREAKPOINT); }; mql.addEventListener("change", onChange); setIsTablet(window.innerWidth < TABLET_BREAKPOINT); return () => mql.removeEventListener("change", onChange); }, []); return !!isTablet; } ``` *** ## Best Practices [#best-practices] ### Prefer CSS for Simple Responsive Layouts [#prefer-css-for-simple-responsive-layouts] For simple responsive styling, CSS media queries are more performant than JavaScript: ```tsx // Prefer CSS when possible
// Use hooks for complex logic or conditional rendering const isMobile = useIsMobile(); if (isMobile) return ; ``` ### Avoid Excessive Re-renders [#avoid-excessive-re-renders] The hook only triggers re-renders when crossing the breakpoint threshold, not on every resize event. ### Test Across Devices [#test-across-devices] Always test responsive behavior on actual devices, not just browser dev tools resizing. *** ## Related [#related] Explore utility functions like cn() for class merging. Learn how to create performant, accessible animations. # Introduction (/docs/guides) ## What is SmoothUI? [#what-is-smoothui] SmoothUI is a modern component library that brings together the best of React, Tailwind CSS, [Motion](https://motion.dev), and [GSAP](https://gsap.com) to create beautiful, accessible, and performant user interfaces. Each component is carefully crafted with smooth animations and thoughtful design principles.
## Key Features [#key-features] * **shadcn CLI Compatible**: Install components using the familiar shadcn CLI * **MCP Support**: AI assistants can discover and install components automatically * **TypeScript First**: Full type safety with comprehensive TypeScript support * **Accessible by Default**: Built with accessibility best practices * **Dark Mode Support**: All components work seamlessly in light and dark themes * **Customizable**: Easy to customize with Tailwind CSS classes * **Performance Optimized**: Built with performance in mind using modern React patterns ## Get Started [#get-started] Learn how to install SmoothUI components using shadcn CLI or manual installation methods. Explore all available components with live demos and documentation. ## Frequently Asked Questions [#frequently-asked-questions] Yes! SmoothUI is completely free and open source. You can use it in personal and commercial projects. No! All animations are built-in. You can use components without any Motion or GSAP knowledge. Absolutely! All components are built with Tailwind CSS and can be customized using standard Tailwind classes. Yes! SmoothUI works with any React framework including Next.js, Vite, Create React App, and more. ## Contributing [#contributing] We welcome contributions to SmoothUI! Whether you want to add new components, improve existing ones, or fix bugs, your contributions help make SmoothUI better for everyone. * Fork the repository on GitHub * Create a new branch for your feature or bug fix * Make your changes and test them thoroughly * Submit a pull request with a clear description Check out our [contributing guide](https://github.com/educlopez/smoothui/blob/main/CONTRIBUTING.md) for more detailed information. # Installation (/docs/guides/installation) SmoothUI works with any React-compatible framework. Check out the dedicated setup guides: * **[Vite + React](/docs/guides/vite)** — The simplest setup for client-side React apps * **[Astro](/docs/guides/astro)** — Islands architecture with selective hydration * **[Remix](/docs/guides/remix)** — Full-stack SSR with React Router v7 * **[TanStack Start](/docs/guides/tanstack-start)** — Type-safe full-stack with streaming SSR ## Installation (SmoothUI CLI) [#installation-smoothui-cli] The SmoothUI CLI provides an interactive way to browse and install components with automatic dependency resolution. ### Add Components [#add-components] ### Add Multiple Components [#add-multiple-components] ### Interactive Mode [#interactive-mode] ### List Available Components [#list-available-components] Run the add command without arguments to launch an interactive picker. Search and browse components by category, then select multiple components to install at once. *** ## Installation (shadcn Registry) [#installation-shadcn-registry] SmoothUI is an official shadcn registry, so you can install components directly without any configuration. Just use the `@smoothui{:js}` namespace. Since SmoothUI is an official registry, you don't need to add anything to your `components.json{:js}` file. Just install components directly! ### Install Components [#install-components] Install SmoothUI components using the shadcn CLI with the `@smoothui{:js}` namespace: ### Install Multiple Components [#install-multiple-components] ### Use Components [#use-components] Import and use the installed components in your React application: ```tsx import { SiriOrb } from "@/components/smoothui/ui/SiriOrb" import { RichPopover } from "@/components/smoothui/ui/RichPopover" export default function App() { return (
) } ``` # MCP Server (/docs/guides/mcp) MCP support for registry developers - Enable AI assistants to discover and use SmoothUI components. The **shadcn MCP server** works out of the box with any shadcn-compatible registry. You do not need to do anything special to enable MCP support for your SmoothUI registry. ## Prerequisites [#prerequisites] The MCP server works by requesting your registry index. Make sure you have a registry item file at the root of your registry named `registry.json{:js}`. For example, if your registry is hosted at `https://smoothui.dev/r/[name].json{:js}`, you should have a file at `https://smoothui.dev/r/registry.json{:js}`. This file must be a valid JSON file that conforms to the registry schema. ## Configuring MCP [#configuring-mcp] Ask your registry consumers to configure your registry in their `components.json{:js}` file and install the shadcn MCP server:
**Configure your registry** in your `components.json{:js}` file: ```json title="components.json" { "registries": { // [!code highlight] "@smoothui": "https://smoothui.dev/r/{name}.json" } } ``` **Run the following command** in your project: ```shell title="Terminal" pnpm dlx shadcn@latest mcp init --client claude ``` ```shell title="Terminal" npx shadcn@latest mcp init --client claude ``` ```shell title="Terminal" yarn dlx shadcn@latest mcp init --client claude ``` ```shell title="Terminal" bunx shadcn@latest mcp init --client claude ``` **Restart Claude Code** and try the following prompts: * Show me the components in the smoothui registry * Create a landing page using items from the smoothui registry * Install the SiriOrb component from smoothui **Note:** You can use `/mcp{:js}` command in Claude Code to debug the MCP server.
**Configure your registry** in your `components.json{:js}` file: ```json title="components.json" { "registries": { // [!code highlight] "@smoothui": "https://smoothui.dev/r/{name}.json" } } ``` **Run the following command** in your project: ```shell title="Terminal" pnpm dlx shadcn@latest mcp init --client cursor ``` ```shell title="Terminal" npx shadcn@latest mcp init --client cursor ``` ```shell title="Terminal" yarn dlx shadcn@latest mcp init --client cursor ``` ```shell title="Terminal" bunx shadcn@latest mcp init --client cursor ``` Open **Cursor Settings** and **Enable the MCP server** for shadcn. Then try the following prompts: * Show me the components in the smoothui registry * Create a landing page using items from the smoothui registry * Install the SiriOrb component from smoothui
**Configure your registry** in your `components.json{:js}` file: ```json title="components.json" { "registries": { // [!code highlight] "@smoothui": "https://smoothui.dev/r/{name}.json" } } ``` **Run the following command** in your project: ```shell title="Terminal" pnpm dlx shadcn@latest mcp init --client vscode ``` ```shell title="Terminal" npx shadcn@latest mcp init --client vscode ``` ```shell title="Terminal" yarn dlx shadcn@latest mcp init --client vscode ``` ```shell title="Terminal" bunx shadcn@latest mcp init --client vscode ``` Open `.vscode/mcp.json{:js}` and click **Start** next to the shadcn server. Then try the following prompts with GitHub Copilot: * Show me the components in the smoothui registry * Create a landing page using items from the smoothui registry * Install the SiriOrb component from smoothui
## Example Prompts [#example-prompts] Once MCP is configured, you can use these prompts with your AI assistant:

Component Discovery

  • “Show me all available components in the smoothui registry”
  • “What animation components are available in smoothui?”
  • “List all interactive components from smoothui”

Component Installation

  • “Install the SiriOrb component from smoothui”
  • “Add the RichPopover component to my project”
  • “Install multiple components: SiriOrb, AnimatedInput, and ScrollableCardStack”

Component Usage

  • “Create a landing page using the SiriOrb component”
  • “Show me how to use the ScrollableCardStack component”
  • “Build a dashboard with smoothui components”
## Learn More [#learn-more] Full overview of all AI integration options — MCP, REST API, and machine-readable catalogs. Complete API reference for programmatic access to the component catalog. You can also read more about the shadcn MCP protocol in the shadcn MCP documentation. # Migration from shadcn (/docs/guides/migration-from-shadcn) ## Overview [#overview] SmoothUI is designed to complement shadcn/ui, not replace it entirely. This guide covers how to swap specific shadcn components with their SmoothUI animated equivalents when you want to add motion and polish to your interface. SmoothUI components are additive. You can migrate one component at a time without affecting the rest of your application. Both shadcn and SmoothUI components can coexist in the same project. *** ## Step 1: Install the SmoothUI Component [#step-1-install-the-smoothui-component] Use either the SmoothUI CLI or the shadcn registry to add the component you want: This installs the component to `components/smoothui/ui/` alongside your existing shadcn components in `components/ui/`. *** ## Step 2: Update Imports [#step-2-update-imports] Replace the shadcn import with the SmoothUI import: ```tsx // Before: shadcn/ui import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs" // After: SmoothUI import AnimatedTabs from "@/components/smoothui/ui/AnimatedTabs" ``` SmoothUI components use a **default export** pattern rather than named exports. Each component is a single self-contained import. *** ## Step 3: Adapt Props [#step-3-adapt-props] SmoothUI components have their own prop interfaces. Here are the common patterns to adjust: ### Composition vs Props [#composition-vs-props] shadcn uses a **compound component** pattern with multiple named exports. SmoothUI components are **single components** that accept data as props: ```tsx // shadcn: Compound components Tab 1 Tab 2 Content 1 Content 2 // SmoothUI: Data-driven props Content 1
}, { label: "Tab 2", content:
Content 2
}, ]} /> ``` ### Styling [#styling] Both shadcn and SmoothUI use Tailwind CSS. SmoothUI components accept a `className` prop for customization: ```tsx // Both support className for custom styling ``` *** ## Component Mapping Reference [#component-mapping-reference] Below is a mapping of shadcn components to their SmoothUI animated equivalents: | shadcn/ui Component | SmoothUI Equivalent | Key Differences | | ------------------- | --------------------------------------------------------------- | ------------------------------------------------------------ | | `Tabs` | [Animated Tabs](/docs/components/animated-tabs) | Animated sliding indicator, data-driven API | | `Dialog` | [Basic Modal](/docs/components/basic-modal) | Spring entrance animation, controlled via `isOpen`/`onClose` | | `Toast` / `Sonner` | [Basic Toast](/docs/components/basic-toast) | Animated entrance/exit with spring physics | | `Accordion` | [Accordion](/docs/components/accordion) | Smooth height animation with spring easing | | `Tooltip` | [Animated Tooltip](/docs/components/animated-tooltip) | Spring-based show/hide with configurable delay | | `DropdownMenu` | [Basic Dropdown](/docs/components/basic-dropdown) | Animated open/close with spring transitions | | `Input` | [Animated Input](/docs/components/animated-input) | Floating label animation, focus effects | | `Toggle` | [Animated Toggle](/docs/components/animated-toggle) | Spring-based toggle with smooth state transitions | | `Progress` | [Animated Progress Bar](/docs/components/animated-progress-bar) | Animated fill with spring physics | | `Skeleton` | [Skeleton Loader](/docs/components/skeleton-loader) | Enhanced shimmer animation | | `Avatar` | [Animated Avatar Group](/docs/components/animated-avatar-group) | Staggered entrance, hover expansion | *** ## Disabling Animations [#disabling-animations] If you need to disable animations for specific instances (for example, in a performance-critical area), SmoothUI components respect the system `prefers-reduced-motion` setting automatically. To programmatically control animation behavior, you can wrap components and use the Motion library's `MotionConfig` provider: ```tsx import { MotionConfig } from "motion/react" // Disable all animations within this subtree // Respect system setting (default behavior) ``` *** ## Migration Checklist [#migration-checklist] For each component you migrate: * [ ] Install the SmoothUI component via CLI * [ ] Update the import path from `@/components/ui/` to `@/components/smoothui/ui/` * [ ] Adjust the JSX from compound component pattern to SmoothUI's prop-based API * [ ] Verify the component renders correctly in development * [ ] Test keyboard navigation still works as expected * [ ] Test with `prefers-reduced-motion` enabled to verify graceful degradation * [ ] Remove the old shadcn component file if it is no longer used elsewhere *** ## Keeping Both [#keeping-both] You don't have to choose one or the other. A common pattern is: * **shadcn/ui** for form primitives, data tables, and areas where animation adds no value * **SmoothUI** for hero sections, interactive cards, navigation, and anywhere you want to add visual delight Both libraries use Tailwind CSS and share the same design token system, so they integrate seamlessly. # Next.js (/docs/guides/nextjs) ## Overview [#overview] [Next.js](https://nextjs.org) is the recommended framework for SmoothUI. With App Router, React Server Components, and built-in Tailwind CSS support, Next.js provides the best developer experience for building animated interfaces. SmoothUI components work seamlessly with both the App Router and Pages Router. SmoothUI components are React client components that use the `"use client"{:tsx}` directive. In Next.js App Router, they render on the server and hydrate on the client — animations start smoothly after hydration with no extra configuration. ## Prerequisites [#prerequisites] Before getting started, make sure you have the following: | Requirement | Minimum Version | Purpose | | --------------------------------------- | --------------- | -------------------------- | | [Node.js](https://nodejs.org/en) | 18+ | Runtime | | [Next.js](https://nextjs.org) | 15.0+ | Framework | | [React](https://react.dev) | 19.0+ | UI library | | [Tailwind CSS](https://tailwindcss.com) | 4.0+ | Styling | | [Motion](https://motion.dev) | 12.0+ | Animations (Framer Motion) | ## Project Setup [#project-setup]
### Create a New Next.js Project [#1-create-a-new-nextjs-project] If you're starting from scratch, create a new Next.js project with TypeScript and Tailwind CSS: ```bash npx create-next-app@latest my-smoothui-app --typescript --tailwind --app cd my-smoothui-app ``` This scaffolds a Next.js project with App Router, TypeScript, and Tailwind CSS 4 pre-configured.
### Tailwind CSS 4 Configuration [#2-tailwind-css-4-configuration] If you used `create-next-app` with the `--tailwind` flag, Tailwind CSS 4 is already configured. Your `app/globals.css` should contain: ```css title="app/globals.css" @import "tailwindcss"; ``` If you're adding Tailwind to an existing project, install it: Then configure PostCSS: ```js title="postcss.config.mjs" const config = { plugins: { "@tailwindcss/postcss": {}, }, }; export default config; ```
### Install Motion [#3-install-motion] SmoothUI animations are powered by Motion (Framer Motion). Install it as a dependency:
### Initialize shadcn/ui [#4-initialize-shadcnui] SmoothUI builds on the shadcn ecosystem. Initialize shadcn in your project: Follow the prompts to configure your project. This sets up `components.json` and the `cn()` utility that SmoothUI components depend on.
## Installing SmoothUI Components [#installing-smoothui-components] ### Using the SmoothUI CLI [#using-the-smoothui-cli] ### Using the shadcn CLI [#using-the-shadcn-cli] SmoothUI is an official shadcn registry. You don't need to add anything to `components.json{:json}` — just use the `@smoothui{:ts}` namespace and components are installed automatically. ## Server Component Boundaries [#server-component-boundaries] Next.js App Router uses React Server Components by default. SmoothUI components include the `"use client"{:tsx}` directive, so they automatically become client components when imported. Here's what you need to know: | Pattern | Behavior | | ----------------------------------------------- | --------------------------------------------------------------------------------- | | Import SmoothUI component in a Server Component | Works — the component boundary switches to client at the import. | | Import SmoothUI component in a Client Component | Works — standard client-side rendering. | | Pass Server Component children to SmoothUI | Works — Server Components can be passed as `children{:tsx}` to client components. | | Use SmoothUI in `layout.tsx` | Works — layout renders on server, SmoothUI component hydrates on client. | ### Example: Server Component with SmoothUI [#example-server-component-with-smoothui] ```tsx title="app/page.tsx" import { SiriOrb } from "@/components/smoothui/ui/SiriOrb"; import { MagneticButton } from "@/components/smoothui/ui/MagneticButton"; // This is a Server Component — SmoothUI components hydrate on the client export default function Home() { return (

SmoothUI + Next.js

Get Started
); } ``` ### Example: Passing Server Component Children [#example-passing-server-component-children] ```tsx title="app/page.tsx" import { ExpandableCards } from "@/components/smoothui/ui/ExpandableCards"; // Server-fetched data passed to a client component export default async function Page() { const items = await fetchItems(); // Runs on the server return ( ); } ``` You do **not** need to add `"use client"{:tsx}` to your page or layout files just because they use SmoothUI components. The directive is already in the component files themselves. Your pages stay as Server Components, keeping data fetching on the server. ## App Router vs Pages Router [#app-router-vs-pages-router] SmoothUI works with both routing systems, but there are differences to be aware of: ### App Router (Recommended) [#app-router-recommended] The App Router is the recommended approach. Server Components are the default, and SmoothUI's `"use client"{:tsx}` directive handles the boundary automatically. ```tsx title="app/dashboard/page.tsx" import { AnimatedTabs } from "@/components/smoothui/ui/AnimatedTabs"; export default function Dashboard() { return ; } ``` ### Pages Router [#pages-router] In the Pages Router, every page is a client component by default, so there are no Server Component boundaries to consider. SmoothUI components work the same way as any other React component: ```tsx title="pages/dashboard.tsx" import { AnimatedTabs } from "@/components/smoothui/ui/AnimatedTabs"; export default function Dashboard() { return ; } ``` Pages Router still uses SSR via `getServerSideProps{:ts}` or SSG via `getStaticProps{:ts}`. SmoothUI components render on the server and hydrate on the client — the same as App Router, just without the Server Component model. ## Custom Animated Components [#custom-animated-components] If you create custom animated components alongside SmoothUI, follow the same pattern: ```tsx title="components/FadeIn.tsx" "use client"; import { motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; export type FadeInProps = { children: ReactNode; }; const FadeIn = ({ children }: FadeInProps) => { const shouldReduceMotion = useReducedMotion(); return ( {children} ); }; export default FadeIn; ``` ## Troubleshooting [#troubleshooting] This means you're trying to use React hooks in a Server Component. SmoothUI components already include `"use client"{:tsx}`, so importing them in a Server Component should work. If you're building a custom wrapper, add `"use client"{:tsx}` at the top of that file. Hydration mismatches happen when server-rendered HTML differs from client output. Common causes: using `Math.random(){:ts}`, `Date.now(){:ts}`, or browser APIs during render. Wrap those values in `useEffect{:tsx}` or use `useState{:tsx}` with an initial value that matches server output. Verify that `@tailwindcss/postcss{:ts}` is configured in `postcss.config.mjs{:js}` and that `app/globals.css{:css}` contains `@import "tailwindcss"{:css}`. Also check that `globals.css` is imported in your root layout. Next.js 15+ uses Turbopack in development by default. SmoothUI components are fully compatible with Turbopack. If you encounter issues, try running `next dev --no-turbopack` to verify the issue is Turbopack-related, then report it. Motion supports tree-shaking, so only the features you use are included in your bundle. Import from `motion/react{:ts}` rather than `framer-motion{:ts}` for the smallest bundle. Next.js also optimizes client bundles automatically with code splitting. ## Next Steps [#next-steps] Learn about all available installation methods including the SmoothUI CLI and shadcn registry. Explore the complete collection of {COMPONENT_COUNT} animated React components. Master animation performance, accessibility, and timing guidelines. The simplest setup for using SmoothUI in a client-side React app. # Remix (/docs/guides/remix) ## Overview [#overview] [Remix](https://remix.run) is a full-stack React framework focused on web standards and progressive enhancement. As of v2, Remix has evolved into the framework mode of [React Router v7](https://reactrouter.com), bringing the same SSR-first architecture with a streamlined API. SmoothUI components work seamlessly in both Remix and React Router v7 projects. SmoothUI components are standard React client components. Remix renders them on the server and hydrates them on the client. The `"use client"{:tsx}` directive ensures components with animations and browser APIs hydrate correctly. No special wrappers are needed for most components. ## Prerequisites [#prerequisites] Before getting started, make sure you have the following: | Requirement | Minimum Version | Purpose | | -------------------------------------------------------------------- | --------------- | -------------------------- | | [Node.js](https://nodejs.org/en) | 18+ | Runtime | | [Remix](https://remix.run) / [React Router](https://reactrouter.com) | 2.0+ / 7.0+ | Framework | | [React](https://react.dev) | 19.0+ | UI library | | [Tailwind CSS](https://tailwindcss.com) | 4.0+ | Styling | | [Motion](https://motion.dev) | 12.0+ | Animations (Framer Motion) | Remix has merged into React Router v7. If you're starting a new project, use `create react-router{:bash}`. Existing Remix v2 projects can upgrade to React Router v7 — see the [migration guide](https://reactrouter.com/upgrading/remix). Both setups work identically with SmoothUI. ## Project Setup [#project-setup]
### Create a New Project [#1-create-a-new-project] If you're starting from scratch, create a new React Router v7 project (the successor to Remix): Then install dependencies:
### Set Up Tailwind CSS 4 [#2-set-up-tailwind-css-4] Remix and React Router v7 use Vite under the hood, so Tailwind CSS 4 setup uses the Vite plugin: Add the Tailwind CSS Vite plugin to your Vite config: ```ts title="vite.config.ts" import { reactRouter } from "@react-router/dev/vite"; import { defineConfig } from "vite"; import tailwindcss from "@tailwindcss/vite"; import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ plugins: [tailwindcss(), reactRouter(), tsconfigPaths()], }); ``` Update your main CSS file with the Tailwind import: ```css title="app/app.css" @import "tailwindcss"; ```
### Install Motion [#3-install-motion] SmoothUI animations are powered by Motion (Framer Motion). Install it as a dependency:
### Configure Path Aliases [#4-configure-path-aliases] SmoothUI components use the `@/{:ts}` path alias. React Router v7 projects typically use `vite-tsconfig-paths{:ts}` to resolve paths from `tsconfig.json{:json}` automatically. Make sure your tsconfig includes the alias: ```json title="tsconfig.json" { "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./app/*"] } } } ``` React Router v7 projects include `vite-tsconfig-paths{:ts}` by default, which reads your `tsconfig.json{:json}` paths and applies them as Vite aliases. You only need to configure paths in one place — your tsconfig.
## Installing SmoothUI Components [#installing-smoothui-components] ### Using the SmoothUI CLI [#using-the-smoothui-cli] ### Using the shadcn CLI [#using-the-shadcn-cli] If this is your first time using the shadcn CLI in a Remix / React Router project, it will prompt you to create a `components.json{:json}` file. Accept the defaults — the CLI auto-detects the project structure and configures paths accordingly. ## SSR Considerations [#ssr-considerations] Remix and React Router v7 render components on the server first, then hydrate them on the client. Here's what you need to know when using SmoothUI components in an SSR environment: | Concern | How SmoothUI Handles It | | ------------------------ | ---------------------------------------------------------------------------------------------------- | | `"use client"` directive | SmoothUI components include this directive. Remix respects it for client-side hydration. | | Motion SSR | Motion handles SSR gracefully — animations simply start after hydration. No special config needed. | | Browser APIs | Components that use `window{:ts}` or `localStorage{:ts}` during render need a `ClientOnly` wrapper. | | Hydration mismatches | Rare with SmoothUI. If seen, ensure no random values are generated during SSR (see Troubleshooting). | ### The ClientOnly Pattern [#the-clientonly-pattern] If you use a SmoothUI component that relies on browser measurements during initial render, wrap it with a `ClientOnly` helper: ```tsx title="app/components/client-only.tsx" "use client"; import { type ReactNode, useEffect, useState } from "react"; export type ClientOnlyProps = { children: ReactNode; fallback?: ReactNode; }; const ClientOnly = ({ children, fallback = null }: ClientOnlyProps) => { const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); return mounted ? children : fallback; }; export default ClientOnly; ``` ```tsx title="app/routes/home.tsx" import ClientOnly from "@/components/client-only"; import { SiriOrb } from "@/components/smoothui/ui/SiriOrb"; const Home = () => { return ( }> ); }; export default Home; ``` The majority of SmoothUI components work fine with SSR out of the box. Only use `ClientOnly` for components that access browser-only APIs like `window.matchMedia{:ts}` or `ResizeObserver{:ts}` during their initial render. ## Using Components in Routes [#using-components-in-routes] Here is a complete example of using SmoothUI components in a Remix / React Router v7 route: ```tsx title="app/routes/home.tsx" import { SiriOrb } from "@/components/smoothui/ui/SiriOrb"; import { MagneticButton } from "@/components/smoothui/ui/MagneticButton"; const Home = () => { return (

SmoothUI + Remix

Get Started
); }; export default Home; ``` ### Custom Animated Components [#custom-animated-components] If you create custom animated components alongside SmoothUI, follow the same pattern: ```tsx title="app/components/FadeIn.tsx" "use client"; import { motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; export type FadeInProps = { children: ReactNode; }; const FadeIn = ({ children }: FadeInProps) => { const shouldReduceMotion = useReducedMotion(); return ( {children} ); }; export default FadeIn; ``` ## Troubleshooting [#troubleshooting] Hydration mismatches occur when the server-rendered HTML differs from what the client renders. Common causes: using `Math.random(){:ts}`, `Date.now(){:ts}`, or browser APIs during render. Use the `ClientOnly` pattern shown above for components that depend on browser-only values. If you see `useLayoutEffect{:tsx}` warnings in your server logs, they're harmless — Motion uses `useLayoutEffect{:tsx}` for performance, and React warns when it's called during SSR. The animations will work correctly after hydration. To suppress the warning, you can use `client:only` or the `ClientOnly` wrapper. Verify that `@tailwindcss/vite{:ts}` is included in your `vite.config.ts{:ts}` plugins array and that your `app/app.css{:css}` (or `app/root.css{:css}`) contains `@import "tailwindcss"{:css}`. Also check that the CSS file is imported in your root route. When using `ClientOnly`, provide a `fallback{:tsx}` with the same dimensions as the component to prevent layout shifts. For example: `}>{:tsx}`. ## Next Steps [#next-steps] Learn about all available installation methods including the SmoothUI CLI and shadcn registry. Explore the complete collection of {COMPONENT_COUNT} animated React components. Master animation performance, accessibility, and timing guidelines. The simplest setup for using SmoothUI in a client-side React app. # SmoothUI vs shadcn/ui (/docs/guides/shadcn-alternative) ## The Best of Both Worlds [#the-best-of-both-worlds] SmoothUI isn't a replacement for shadcn/ui - it's the perfect companion. While shadcn/ui excels at providing solid, accessible base components, SmoothUI extends the ecosystem with **animated, interactive components** that bring your interfaces to life.
## Why Choose SmoothUI? [#why-choose-smoothui] ### Smooth Motion Animations [#smooth-motion-animations] Every SmoothUI component is built with **[Motion](https://motion.dev)** and **[GSAP](https://gsap.com)** animations that feel natural and polished. No more wrestling with CSS keyframes or animation libraries - animations are built-in and optimized for performance. ```tsx // Just import and use - animations included import { ExpandableCards } from "@/components/ui/expandable-cards" ``` ### Same Workflow, Added Motion [#same-workflow-added-motion] If you're familiar with shadcn/ui, you'll feel right at home. SmoothUI uses the **same CLI installation pattern**: ```bash npx shadcn@latest add @smoothui/expandable-cards ``` Components are copied into your project, giving you full ownership and customization control. ### Built for Modern React [#built-for-modern-react] SmoothUI components follow React best practices: * **Server Components compatible** - Works with Next.js App Router * **TypeScript first** - Full type definitions included * **Tailwind CSS v4** - Uses the latest Tailwind features * **Accessibility** - Respects `prefers-reduced-motion` ## Feature Comparison [#feature-comparison] | Feature | shadcn/ui | SmoothUI | | ------------------- | ------------ | ----------------- | | Static Components | Excellent | Good | | Animated Components | Limited | Excellent | | Motion Animations | Manual setup | Built-in | | Installation | shadcn CLI | shadcn CLI | | Customization | Full control | Full control | | TypeScript | Yes | Yes | | Tailwind CSS | v3/v4 | v4 | | Dark Mode | Yes | Yes | | Accessibility | Excellent | Good | | Component Count | 40+ | {COMPONENT_COUNT} | ## When to Use Each [#when-to-use-each] ### Use shadcn/ui for: [#use-shadcnui-for] * Form inputs, selects, and form validation * Modal dialogs and alert dialogs * Navigation menus and dropdowns * Data tables and pagination * Basic buttons and badges ### Use SmoothUI for: [#use-smoothui-for] * Animated card layouts and expandable cards * Smooth hover effects and micro-interactions * Dynamic content transitions * Interactive showcases and galleries * Animated text effects (typewriter, wave, scramble) * Loading states with motion ## Working Together [#working-together] The best approach is using both libraries together. Here's a typical setup: ```tsx // shadcn/ui for the form structure import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Dialog, DialogContent } from "@/components/ui/dialog" // SmoothUI for animated elements import { AnimatedInput } from "@/components/ui/animated-input" import { ScrambleHover } from "@/components/ui/scramble-hover" import { ExpandableCards } from "@/components/ui/expandable-cards" ``` Both libraries use the same folder structure (`components/ui/`) and Tailwind CSS foundation, making them seamlessly compatible. ## Get Started [#get-started] Set up SmoothUI in your project alongside shadcn/ui. Explore {COMPONENT_COUNT} animated components ready to use. ## Frequently Asked Questions [#frequently-asked-questions] No! SmoothUI is designed to complement shadcn/ui, not replace it. Use shadcn/ui for forms and foundational UI, and add SmoothUI components when you need animations and interactivity. Absolutely! Both libraries use the same installation pattern and folder structure. They work together seamlessly in the same project. Minimal. If you're familiar with shadcn/ui, you already know the workflow. SmoothUI components follow the same patterns - just with added animations. SmoothUI animations are built with Motion and GSAP, optimized for performance. They use GPU-accelerated transforms and respect the user's reduced motion preferences for accessibility. # Sponsors (/docs/guides/sponsors) # TanStack Start (/docs/guides/tanstack-start) ## Overview [#overview] [TanStack Start](https://tanstack.com/start/latest) is a modern full-stack React framework built on [Vinxi](https://vinxi.vercel.app) (a Vite-based server toolkit) and [TanStack Router](https://tanstack.com/router/latest). It provides type-safe routing, streaming SSR, and server functions out of the box. SmoothUI components integrate smoothly with TanStack Start's architecture. TanStack Start uses Vite under the hood via Vinxi, so SmoothUI components work the same way as in any Vite-based project. Components are server-rendered and hydrated on the client. The `"use client"{:tsx}` directive ensures animations activate after hydration. TanStack Start is a newer framework that is evolving quickly. The setup steps below reflect the current stable release. Check the [official docs](https://tanstack.com/start/latest/docs/framework/react/overview) for the latest changes. ## Prerequisites [#prerequisites] Before getting started, make sure you have the following: | Requirement | Minimum Version | Purpose | | --------------------------------------------------- | --------------- | -------------------------- | | [Node.js](https://nodejs.org/en) | 18+ | Runtime | | [TanStack Start](https://tanstack.com/start/latest) | 1.0+ | Framework | | [React](https://react.dev) | 19.0+ | UI library | | [Tailwind CSS](https://tailwindcss.com) | 4.0+ | Styling | | [Motion](https://motion.dev) | 12.0+ | Animations (Framer Motion) | ## Project Setup [#project-setup]
### Create a New TanStack Start Project [#1-create-a-new-tanstack-start-project] If you're starting from scratch, create a new TanStack Start project: Then install dependencies:
### Set Up Tailwind CSS 4 [#2-set-up-tailwind-css-4] TanStack Start uses Vinxi, which is built on Vite. Install Tailwind CSS and the Vite plugin: Add the Tailwind CSS Vite plugin to your app config: ```ts title="app.config.ts" import { defineConfig } from "@tanstack/react-start/config"; import tailwindcss from "@tailwindcss/vite"; export default defineConfig({ vite: { plugins: () => [tailwindcss()], }, }); ``` Create or update your main CSS file with the Tailwind import: ```css title="app/styles/app.css" @import "tailwindcss"; ``` Import the stylesheet in your root route (typically `app/routes/__root.tsx{:tsx}`): ```tsx title="app/routes/__root.tsx" import { createRootRoute, Outlet } from "@tanstack/react-router"; import appCss from "@/styles/app.css?url"; export const Route = createRootRoute({ head: () => ({ links: [{ rel: "stylesheet", href: appCss }], }), component: RootComponent, }); function RootComponent() { return ( ); } ```
### Install Motion [#3-install-motion] SmoothUI animations are powered by Motion (Framer Motion). Install it as a dependency:
### Configure Path Aliases [#4-configure-path-aliases] SmoothUI components use the `@/{:ts}` path alias. Configure it in your `tsconfig.json{:json}`: ```json title="tsconfig.json" { "compilerOptions": { "baseUrl": ".", "paths": { "@/*": ["./app/*"] } } } ``` TanStack Start resolves TypeScript paths automatically via Vinxi's Vite integration. If path aliases don't resolve at runtime, add `vite-tsconfig-paths{:ts}` to your app config: ```ts title="app.config.ts" import { defineConfig } from "@tanstack/react-start/config"; import tailwindcss from "@tailwindcss/vite"; import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ vite: { plugins: () => [tailwindcss(), tsconfigPaths()], }, }); ```
## Installing SmoothUI Components [#installing-smoothui-components] ### Using the SmoothUI CLI [#using-the-smoothui-cli] ### Using the shadcn CLI [#using-the-shadcn-cli] If this is your first time using the shadcn CLI in a TanStack Start project, it will prompt you to create a `components.json{:json}` file. Configure the `aliases.components{:json}` path to match your project structure (typically `@/components{:json}`). ## SSR & Streaming [#ssr--streaming] TanStack Start supports streaming SSR by default, which means components render progressively on the server. Here's what you need to know when using SmoothUI components: | Concern | How SmoothUI Handles It | | ------------------------ | ------------------------------------------------------------------------------------------------- | | `"use client"` directive | SmoothUI components include this directive. TanStack Start respects it for client-side hydration. | | Motion SSR | Motion handles SSR gracefully — animations start after hydration. No special config needed. | | Streaming compatibility | SmoothUI components work with streaming SSR. Animations start as each component hydrates. | | Browser APIs | Components using `window{:ts}` or `ResizeObserver{:ts}` during render need a client-only guard. | ### Client-Only Components [#client-only-components] For the rare component that needs browser APIs during initial render, use a mounted check: ```tsx title="app/components/client-only.tsx" "use client"; import { type ReactNode, useEffect, useState } from "react"; export type ClientOnlyProps = { children: ReactNode; fallback?: ReactNode; }; const ClientOnly = ({ children, fallback = null }: ClientOnlyProps) => { const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); return mounted ? children : fallback; }; export default ClientOnly; ``` ## Using Components in Routes [#using-components-in-routes] Here is a complete example of using SmoothUI components in a TanStack Start route: ```tsx title="app/routes/index.tsx" import { createFileRoute } from "@tanstack/react-router"; import { SiriOrb } from "@/components/smoothui/ui/SiriOrb"; import { MagneticButton } from "@/components/smoothui/ui/MagneticButton"; export const Route = createFileRoute("/")({ component: Home, }); function Home() { return (

SmoothUI + TanStack Start

Get Started
); } ``` ### Custom Animated Components [#custom-animated-components] If you create custom animated components alongside SmoothUI, follow the same pattern: ```tsx title="app/components/FadeIn.tsx" "use client"; import { motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; export type FadeInProps = { children: ReactNode; }; const FadeIn = ({ children }: FadeInProps) => { const shouldReduceMotion = useReducedMotion(); return ( {children} ); }; export default FadeIn; ``` ## Troubleshooting [#troubleshooting] Verify that `@tailwindcss/vite{:ts}` is included in your `app.config.ts{:ts}` Vite plugins, and that your CSS file contains `@import "tailwindcss"{:css}`. Also check that the stylesheet is linked in your root route's `head{:tsx}` function. TanStack Start uses Vinxi (Vite-based), which should resolve TypeScript paths. If aliases don't work, add `vite-tsconfig-paths{:ts}` to your `app.config.ts{:ts}` Vite plugins as shown in the setup section. Hydration mismatches occur when server-rendered HTML differs from client output. Avoid using `Math.random(){:ts}`, `Date.now(){:ts}`, or browser APIs during render. For components that depend on client-only values, use the `ClientOnly` wrapper pattern. With streaming SSR, components hydrate progressively. Animations using `initial{:tsx}` and `animate{:tsx}` props will play as each component hydrates — this is the expected behavior. If you want animations to trigger on scroll instead, use Motion's `whileInView{:tsx}` prop. ## Next Steps [#next-steps] Learn about all available installation methods including the SmoothUI CLI and shadcn registry. Explore the complete collection of {COMPONENT_COUNT} animated React components. Master animation performance, accessibility, and timing guidelines. Full-stack SSR setup with Remix and React Router v7. # Themes (/docs/guides/themes) SmoothUI ships complete color themes you can install in **any shadcn project** with one command — light and dark mode included, compatible with both Radix UI and Base UI primitives. ## Quick start [#quick-start] Pick a palette and install it. The CLI writes every CSS variable into your global stylesheet: ```bash npx shadcn@latest add https://smoothui.dev/r/theme-candy.json ``` Available themes: `theme-candy`, `theme-indigo`, `theme-blue`, `theme-red`, `theme-orange`, `theme-green`. Each theme defines the full token set — backgrounds, foregrounds, borders, inputs, ring, charts, sidebar — using SmoothUI's smooth neutral scale with the palette's accent, in both `:root` and `.dark`. ## Theme Studio [#theme-studio] [smoothui.dev/themes](https://smoothui.dev/themes) is an interactive studio: a draggable board previewing the entire component registry with your theme applied live. * **Theme** — six accent palettes. * **Mode** — preview light or dark. * **Font** — Sans, Serif or Mono, applied to the preview and the exported CSS (`--font-sans`). * **Tint** — re-tint the neutral scale: pure Neutral, Warm or Cool. * **Radius** — a continuous 0–24px scrubber driving every `rounded-*` value. * **Accent** — shift the accent's oklch lightness ±15 points. Every card on the board shows a real component demo, links to its docs, and copies its install command. ## SmoothUI presets [#smoothui-presets] The studio encodes your full configuration into a compact preset code: ``` s1.candy.16.20.mono.warm ``` Unlike shadcn/create presets (limited to their catalog values), SmoothUI presets carry the exact oklch palette, continuous radius, accent shift, font and tint. Three ways to use one: ### Share it [#share-it] `Copy preset link` produces a URL that restores every control: ``` https://smoothui.dev/themes?preset=s1.candy.16.20.mono.warm ``` ### Install it [#install-it] Any custom configuration is installable directly — the registry builds the theme on the fly from the code: ```bash npx shadcn@latest add https://smoothui.dev/r/theme-custom-s1.candy.16.20.mono.warm.json ``` ### Copy the CSS [#copy-the-css] `Copy CSS variables` exports the exact `:root` / `.dark` blocks for manual pasting, always reflecting the current controls. ## shadcn/create interop [#shadcncreate-interop] Each palette also maps to the closest [shadcn/create](https://ui.shadcn.com/create) preset (for example Candy ≈ `b3gmgq`, their pink). The studio links to it as an **approximation**: shadcn's preset system only supports its own catalog values, so the exact SmoothUI palette, tint and accent shift don't survive the round trip. For full fidelity, use SmoothUI presets. # Utility Functions (/docs/guides/utilities) ## Overview [#overview] SmoothUI provides utility functions that simplify common patterns in React development. These utilities are used throughout the component library and are available for your own components. *** ## cn() - Class Name Utility [#cn---class-name-utility] The `cn()` function merges class names intelligently, combining the power of [clsx](https://github.com/lukeed/clsx) for conditional classes and [tailwind-merge](https://github.com/dcastil/tailwind-merge) for resolving Tailwind CSS conflicts. ### Installation [#installation] The `cn()` utility is included with any SmoothUI component installation. You can also install it directly: ```bash pnpm add clsx tailwind-merge ``` Then create the utility: ```tsx // lib/utils.ts import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } ``` ### Usage [#usage] ```tsx import { cn } from "@/lib/utils"; function Button({ className, variant, ...props }) { return (