Skip to content

Commit 7799084

Browse files
authored
feat: add animation begin support on web (#280)
1 parent 18bcad6 commit 7799084

File tree

6 files changed

+36051
-189
lines changed

6 files changed

+36051
-189
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ const MyLoader = () => (
126126
| **`style?: React.CSSProperties`** <br /> Defaults to `{}` | React DOM only | |
127127
| **`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). |
128128
| **`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). |
129+
| **`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)
129130

130131
See all options [live](https://danilowoz.com/react-content-loader/)
131132

docs/index.stories.tsx

+20
Original file line numberDiff line numberDiff line change
@@ -468,3 +468,23 @@ export const BeforeMask = () => {
468468
</>
469469
)
470470
}
471+
472+
/**
473+
* Animation begin delay
474+
*/
475+
export const animateBegin = () => {
476+
return (
477+
<>
478+
<SyntaxCode>{' <ContentLoader animateBegin="5s" />'}</SyntaxCode>
479+
<ContentLoader animateBegin="5s" />
480+
</>
481+
)
482+
}
483+
484+
animateBegin.story = {
485+
parameters: {
486+
notes: `##\`animateBegin?: string\`
487+
488+
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).`,
489+
},
490+
}

0 commit comments

Comments
 (0)