Skip to content

Pull request for issue #1204 #3293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

google-labs-jules[bot]
Copy link

Fixes #1204

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.
@mattgperry mattgperry closed this Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] staggerFrom
1 participant