Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: motiondivision/motion
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: motiondivision/motion
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/stagger-from-prop
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jun 30, 2025

  1. feat(animation): Initial implementation of staggerFrom prop

    This commit introduces the initial groundwork for the `staggerFrom` feature.
    
    Changes include:
    - Added `staggerFrom` to the `AnimationOrchestrationOptions` type definition in `packages/motion-dom/src/animation/types.ts`. This allows `staggerFrom` to be a valid property within transition objects.
    - Updated the `animateVariant` function in `packages/framer-motion/src/animation/interfaces/visual-element-variant.ts` to extract the `staggerFrom` prop from transition options.
    - Modified the `animateChildren` function in the same file (`visual-element-variant.ts`) to:
        - Accept `staggerFrom` as a parameter.
        - Prioritize `staggerFrom` for calculating individual child animation delays if it's provided. This implements the "stagger outwards" behavior from a specified index.
        - Fall back to the existing `staggerDirection` logic if `staggerFrom` is not defined, maintaining backward compatibility.
        - Imported `getOriginIndex` and `StaggerOrigin` from `../utils/stagger.ts` to help resolve string-based `staggerFrom` values like "center", "first", "last".
    
    This is an intermediate step. Next steps based on your feedback involve exploring the possibility of using `delayChildren: stagger()` for a more flexible API, which might alter the final implementation of this feature.
    google-labs-jules[bot] committed Jun 30, 2025
    Configuration menu
    Copy the full SHA
    355e4ad View commit details
    Browse the repository at this point in the history
Loading