Skip to content

Commit

Permalink
feat: add animation begin support on web (#280)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasyan committed Mar 9, 2022
1 parent 18bcad6 commit 7799084
Show file tree
Hide file tree
Showing 6 changed files with 36,051 additions and 189 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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

Expand Down
20 changes: 20 additions & 0 deletions docs/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,23 @@ export const BeforeMask = () => {
</>
)
}

/**
* Animation begin delay
*/
export const animateBegin = () => {
return (
<>
<SyntaxCode>{' <ContentLoader animateBegin="5s" />'}</SyntaxCode>
<ContentLoader animateBegin="5s" />
</>
)
}

animateBegin.story = {
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).`,
},
}

0 comments on commit 7799084

Please sign in to comment.