Skip to content
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

feat: add animation begin support on web #280

Merged

Conversation

nicholasyan
Copy link
Contributor

Summary

This PR adds a prop to expose the underlying web SVG animation element's begin attribute.

(My specific motivation is to then be able to use this field to stagger a series of loading component animations, but I can imagine broader use-cases as well given the other possible values of the begin attribute.)

Related Issue #[issue number]

None

Any Breaking Changes

None

Checklist

  • Are all the test cases passing?
  • If any new feature has been added, then are the test cases updated/added?
  • Has the documentation been updated for the proposed change, if required?

@@ -126,6 +126,7 @@ const MyLoader = () => (
| **`style?: React.CSSProperties`** <br /> Defaults to `{}` | React DOM only | |
| **`uniqueKey?: string`** <br /> Defaults to random unique id | React DOM only | Use the same value of prop key, <br/>that will solve inconsistency on the SSR, see more [here](https://github.com/danilowoz/react-content-loader/issues/78). |
| **`beforeMask?: JSX.Element`** <br /> Defaults to null | React DOM<br/>React Native | Define custom shapes before content, <br/>see more [here](https://github.com/danilowoz/react-content-loader/issues/266). |
| **`animateBegin?: string`** <br /> Defaults to `undefined` | React DOM only | Delay before the animation begins, identical to the [SVG animate element begin attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/begin)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to co-locate this prop with the animate property above, but it looks like so far props in this list seem to have been added chronologically.

parameters: {
notes: `##\`animateBegin?: string\`

Defaults to \`0s\`. This attribute accepts the same values as the SVG animate element's [\`begin\` attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/begin).`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note default to 0s is only implicit here; the actual default value lives with the begin attribute itself on the animation element.

@nicholasyan
Copy link
Contributor Author

nicholasyan commented Feb 17, 2022

@danilowoz would love to get feedback on this — let me know if there's anything I can do to help it get merged 😄

Copy link
Owner

@danilowoz danilowoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, sorry for the late answer! This looks good to me. Any reason why package-lock.json got so many changes? I think we could ignore it for while

@danilowoz danilowoz merged commit 7799084 into danilowoz:master Mar 9, 2022
@github-actions
Copy link

github-actions bot commented Mar 9, 2022

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants