BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/boldkit/motion-core

Motion Core

boldkit/motion-core
FreeUtility

BoldKit Motion core — framework-agnostic, SSR-safe primitives (observeReveal, staggerChildren, triggerAnimation, startViewTransition, prefersReducedMotion) shared by every motion adapter.

Live preview

live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://boldkit.dev/r/motion-core.json

Source

registry/default/lib/motion-core.tsboldkit.dev/r/motion-core.json · first 6 KB
1/**
2 * BoldKit Motion Core — framework-agnostic primitives.
3 *
4 * Consumed by every L3 adapter (React, Vue, future Svelte/Solid/Qwik).
5 * Adding a new framework = wrap these functions. No CSS or token changes needed.
6 *
7 * All functions are SSR-safe: they no-op on the server.
8 */
9
10const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
11
12// ──────────────────────────────────────────────────────────────────
13// Reduced motion detection (cached; updates on media-query change)
14// ──────────────────────────────────────────────────────────────────
15
16let _reducedMotion = false;
17let _reducedMotionMql: MediaQueryList | null = null;
18
19if (isBrowser) {
20 _reducedMotionMql = window.matchMedia('(prefers-reduced-motion: reduce)');
21 _reducedMotion = _reducedMotionMql.matches;
22 _reducedMotionMql.addEventListener('change', (e) => {
23 _reducedMotion = e.matches;
24 });
25}
26
27export function prefersReducedMotion(): boolean {
28 return _reducedMotion;
29}
30
31// ──────────────────────────────────────────────────────────────────
32// observeReveal — IntersectionObserver-driven scroll reveal
33// ──────────────────────────────────────────────────────────────────
34
35export type RevealOptions = {
36 /** Margin around the root. Negative bottom fires reveal slightly before viewport entry. */
37 rootMargin?: string;
38 /** Intersection ratio threshold. 0 = any pixel visible. */
39 threshold?: number;
40 /** If true, unobserves after first reveal. Default true. */
41 once?: boolean;
42 /** Delay before applying the reveal-in class, in ms. */
43 delay?: number;
44};
45
46const DEFAULT_REVEAL_OPTS: Required<RevealOptions> = {
47 rootMargin: '0px 0px -10% 0px',
48 threshold: 0,
49 once: true,
50 delay: 0,
51};
52
53/**
54 * Observes `el` and toggles `.bk-reveal-in` when it enters the viewport.
55 * The element must have the `.bk-reveal` class (and optionally a direction
56 * modifier like `.bk-reveal-up`) already applied for the CSS animation to fire.
57 *
58// … truncated

Files it writes

  • registry/default/lib/motion-core.ts

Facts

Registry
boldkit
Type
registry:lib
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
today

Go to the source

Docs on boldkit boldkit.dev ANIBIT14/boldkit on GitHub Raw registry item This item as JSON

More from boldkit

All 94 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Chart Exportchart-exportboldkitUtilitiesFreeno deps
Math Curvesmath-curvesboldkitUtilitiesFreeno deps
UtilsutilsboldkitUtilitiesFree2 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex