• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

humanspeak / svelte-motion / 26118440534
68%
main: 3%

Build:
Build:
LAST BUILD BRANCH: fix/release-cleanup-always-run
DEFAULT BRANCH: main
Ran 19 May 2026 07:00PM UTC
Jobs 1
Files 220
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 May 2026 06:54PM UTC coverage: 68.428%. First build
26118440534

push

github

web-flow
feat(variants): custom prop + function-form variants (#350)

* feat(variants): custom prop + function-form variants

Adds framer-motion's `custom` prop on motion components and threads it
through variant resolution. Variant values can now be either a static
keyframes object or a `(custom) => keyframes` factory — pattern used for
staggered lists where each child needs its own offset or delay.

```svelte
<motion.li
    custom={i}
    variants={{
        hidden:  { opacity: 0, x: -100 },
        visible: (i) => ({ opacity: 1, x: 0, transition: { delay: i * 0.1 } })
    }}
    initial="hidden"
    animate="visible"
/>
```

Propagation: children with no `custom` prop inherit the nearest motion
ancestor's value through a Svelte context store (writable, so a parent
updating `custom` after mount re-resolves descendants). Closes #308 and
unblocks #309 (custom on AnimatePresence) + #305 (usePresenceData).

Changes:
  - src/lib/types.ts: `Variant` adds the function arm; `Variants`
    widened; new `custom?: unknown` field on `MotionProps`
  - src/lib/utils/variants.ts: `resolveVariant` / `resolveInitial` /
    `resolveAnimate` / `resolveExit` each gain a `custom?` arg and
    invoke function-form entries with it
  - src/lib/components/variantContext.context.ts: new
    `setCustomContext` / `getCustomContext` (store-based) for descendant
    inheritance
  - src/lib/html/_MotionContainer.svelte: receives `custom` prop, reads
    the parent store, publishes its own `effectiveCustom`, threads it
    into the three resolver calls

Tests (372/372 passing, +21 new):
  - src/lib/utils/variants.spec.ts (new) — 19 cases covering function
    + object forms, falsy-zero passthrough, undefined custom, all four
    resolvers
  - src/lib/html/_MotionContainer.spec.ts — 2 new cases: own custom
    forwarded to function-form variant on animate; child inherits
    parent's custom through nested context

Docs / discoverability:
  - README.md: extended Variants section with functio... (continued)

463 of 615 branches covered (75.28%)

Branch coverage included in aggregate %.

33 of 39 new or added lines in 3 files covered. (84.62%)

1752 of 2622 relevant lines covered (66.82%)

10.26 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
60.64
src/lib/html/_MotionContainer.svelte
Jobs
ID Job ID Ran Files Coverage
1 node-22 - 26118440534.1 19 May 2026 07:00PM UTC 220
68.43
GitHub Action Run
Source Files on build 26118440534
  • Tree
  • List 220
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26118440534
  • 851eceae on github
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc