{"name":"react-content-loader","version":"5.0.0-rc4","keywords":["react","react-native","skeleton","placeholder","loader","loading","content","svg"],"author":{"name":"Danilo Woznica","email":"danilowoz@gmail.com"},"license":"MIT","_id":"react-content-loader@5.0.0-rc4","maintainers":[{"name":"danilowoz","email":"danilowoz@gmail.com"}],"homepage":"https://github.com/danilowoz/react-content-loader","bugs":{"url":"https://github.com/danilowoz/react-content-loader/issues"},"dist":{"shasum":"51ab2eb4b8ffd69857b36c6e84a58577866e7a55","tarball":"http://registry-npm.ywwl.com/react-content-loader/download/react-content-loader-5.0.0-rc4.tgz","fileCount":122,"integrity":"sha512-0RVVwAFEp3YKZpOdTkARUf0AXr8hD+KgmG/L6Z1244k7daYLa6xOmmSuPXqhsCbRE/zEWs80YnY28Y2mCVSSZA==","signatures":[{"sig":"MEQCIBVdCJpdxjnoHBkkFKMVaGc8PINVedxGXzCo6KWVnh9NAiAHj8xrKxeBdSp09ZEsF5otmBpMwTuN1yiwjcNv5EFwQQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":157534,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLelsCRA9TVsSAnZWagAAGY0P/3nFa1AZBrUljXZvedt1\nXp8mFFJpG+A+rWxJwA7RYDElFg6Ah1VxChDhuqWAzID1KwRJDsdAHgGNmK4h\nkIQPnTxid+EaWkBfjYz/T8r0VhBvYc71kPWylJOwGP73I8G1vQARQ+qX6dcb\n9NmY6NPPy4aYjfrRWI0CYHaKfhGwv+7UwLERc/zdeREFLGG8V0LQCaDbbS9D\nHjtnaV2b2fBLqDiqiCco31HAwX5mGqQ/WRedI9IzG5OG9fLHA32olVjH4gSM\nEcaYq9rzJ9WRZSfGzsdRX8OZ2gS+Z4VRpO6ns37m8MyWuaVN9huQup4KFFHO\nWt8GNqd49XI6R1PvtwB9HwLCBHCl04TJVASa+/TiBJEiryuCCIVJLHWi459U\nLH70EVCq5HFUY1ToisS4gzz3oTH4Qs5r2UzU55NwDaaX+MqS6zXfLO3b26f7\nCl3/ClV9w1FyDG1mQEl1Kjfs9ZH28kRN3AASgbR1B4ngGMFtm8lUf/k53Eki\n0BiAYlF33pVN8EdqFAYUgy9KSdZ77C4HOW+vyQ+lKnJP2GAdQO91o/XMxkYe\nrIvPQJK6poG/L4pMSYO/gocLuvp5RqA3Pfol6khIMVKPkm6qaHK0JDk+vw4n\novNRHWXJM5CvE9xWesZnzCwHmCCrH5nsFbtCOA8qc0yf1NWprPLoHvMQqXZY\n8F73\r\n=+Q0g\r\n-----END PGP SIGNATURE-----\r\n","size":22528,"noattachment":false,"key":"/react-content-loader/-/react-content-loader-5.0.0-rc4.tgz"},"main":"dist/react-content-loader.cjs.js","_from":"file:react-content-loader-5.0.0-rc4.tgz","husky":{"hooks":{"pre-push":"npm run test","commit-msg":"commitlint -E HUSKY_GIT_PARAMS","pre-commit":"npm run lint && npm run format"}},"types":"dist/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"module":"dist/react-content-loader.es.js","readme":"<p align=\"center\">\n  <a href=\"https://www.react-europe.org/\"><img alt=\"react-europe-badge\" src=\"https://img.shields.io/badge/join%20us%20at-ReactEurope-blue\"/></a>\n</p>\n<p align=\"center\">\n  <img width=\"350\" alt=\"react-content-loader\" src=\"https://user-images.githubusercontent.com/4838076/34419335-5669c3f8-ebea-11e7-9668-c47b7846970b.png\"/>\n</p>\n<p align=\"center\">\n  <img width=\"400\" alt=\"Example's react-content-loader\" src=\"https://user-images.githubusercontent.com/4838076/34308760-ec55df82-e735-11e7-843b-2e311fa7b7d0.gif\" />\n</p>\n\nSVG-Powered component to easily create placeholder loadings (like Facebook's cards loading).\n\n## Features\n\n- :gear: **Customizable:** Feel free to change the colors, speed, sizes and even **RTL**;\n- :ok_hand: **Plug and play:** with many presets to use, see the [examples](http://danilowoz.com/create-content-loader/#gallery);\n- :pencil2: **DIY:** use the [create-content-loader](https://danilowoz.github.io/create-content-loader/) to create your own custom loaders easily;\n- 📱 **React Native support**: same API, as same powerful features;\n- ⚛️ **Really lightweight:** less than **2kB** and **0 dependencies** for web version;\n\n## Index\n\n- [Getting Started](#gettingstarted)\n- [Usage](#usage)\n  - [Native](#native)\n- [Options](#options)\n- [Examples](#examples)\n- [Similar packages](#similarpackages)\n- [Development](#development)\n- [Known Issues](#knownissues)\n\n## Getting Started\n\n```sh\nnpm i react-content-loader --save\n```\n\n```sh\nyarn add react-content-loader\n```\n\n### For React Native\n\n```sh\nnpm i react-content-loader react-native-svg --save\n```\n\n```sh\nyarn add react-content-loader react-native-svg\n```\n\nCDN from [JSDELIVR](https://www.jsdelivr.com/package/npm/react-content-loader)\n\n## Usage\n\nThere are two ways to use it:\n\n**1. Presets, see the [examples](#examples):**\n\n```jsx\nimport ContentLoader, { Facebook } from 'react-content-loader'\n\nconst MyLoader = () => <ContentLoader />\nconst MyFacebookLoader = () => <Facebook />\n```\n\n**2. Custom mode, see the [online tool](https://danilowoz.github.io/create-react-content-loader/)**\n\n```jsx\nconst MyLoader = () => (\n  <ContentLoader viewBox=\"0 0 380 70\">\n    {/* Only SVG shapes */}    \n    <rect x=\"0\" y=\"0\" rx=\"5\" ry=\"5\" width=\"70\" height=\"70\" />\n    <rect x=\"80\" y=\"17\" rx=\"4\" ry=\"4\" width=\"300\" height=\"13\" />\n    <rect x=\"80\" y=\"40\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" />\n  </ContentLoader>\n)\n```\n\n**Still not clear?** Take a look at this working example at [codesandbox.io](https://codesandbox.io/s/moojk887z9)  \nOr try the components editable demo hands-on and install it from [bit.dev](https://bit.dev/danilowoz/react-content-loader)\n\n## Native\n\n`react-content-loader` can be used with React Native in the same way as web version with the same import:\n\n**1. Presets, see the [examples](#examples):**\n\n```jsx\nimport ContentLoader, { Facebook } from 'react-content-loader/native'\n\nconst MyLoader = () => <ContentLoader />\nconst MyFacebookLoader = () => <Facebook />\n```\n\n**2. Custom mode**\n\n**To create custom loaders there is an important difference:** as React Native doesn't have any native module for SVG components, it's necessary to import the shapes from [react-native-svg](https://github.com/react-native-community/react-native-svg) or use the named export Rect and Circle from `react-content-loader` import:\n\n```jsx\nimport ContentLoader, { Rect, Circle } from 'react-content-loader/native'\n\nconst MyLoader = () => (\n  <ContentLoader viewBox=\"0 0 380 70\">\n    <Circle cx=\"30\" cy=\"30\" r=\"30\" />\n    <Rect x=\"80\" y=\"17\" rx=\"4\" ry=\"4\" width=\"300\" height=\"13\" />\n    <Rect x=\"80\" y=\"40\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" />\n  </ContentLoader>\n)\n```\n\n## Options\n\n#### **`animate?: boolean`**\n\nDefaults to `true`. Opt-out of animations with `false`\n\n#### **`title?: string`** - _Web only_\n\nDefaults to `Loading interface...`. It's used to describe what element it is. Use ''(empty string) to remove.\n\n#### **`baseUrl?: string`** - _Web only_\n\nRequired if you're using `<base url=\"/\" />` document `<head/>`. \nDefaults to an empty string. This prop is common used as: `<ContentLoader baseUrl={window.location.pathname} />` which will fill the SVG attribute with the relative path. Related [#93](https://github.com/danilowoz/react-content-loader/issues/93).\n\n#### **`speed?: number`**\n\nDefaults to `1.2`. Animation speed in seconds.\n\n#### **`interval?: number`** - _Web only_\n\nDefaults to `0.25`. Interval of time between runs of the animation, as a fraction of the animation speed.\n\n#### **`viewBox?: string`**\n\nUse viewBox props to set a custom viewBox value, for more information about how to use it, read the article [How to Scale SVG](https://css-tricks.com/scale-svg/).\n\n#### **`gradientRatio?: number`** - _Web only_\n\nDefaults to `1.2`. Width of the animated gradient as a fraction of the viewbox width.\n\n#### **`rtl?: boolean`**\n\nDefaults to `false`. Content right-to-left.\n\n#### **`backgroundColor?: string`**\n\nDefaults to `#f5f6f7` which is used as background of animation.\n\n#### **`foregroundColor?: string`**\n\nDefaults to `#eee` which is used as the foreground of animation.\n\n#### **`backgroundOpacity?: number`** - _Web only_\n\nDefaults to `1`. Background opacity (0 = transparent, 1 = opaque) used to solve a issue in [Safari](#safari--ios)\n\n#### **`foregroundOpacity?: number`** - _Web only_\n\nDefaults to `1`. Animation opacity (0 = transparent, 1 = opaque) used to solve a issue in [Safari](#safari--ios)\n\n#### **`style?: React.CSSProperties`**\n\nDefaults to an empty object.\n\n#### **`uniqueKey?: string`** - _Web only_\n\nDefaults to random unique id. Use the same value of prop key, that will solve inconsistency on the SSR, see more [here](https://github.com/danilowoz/react-content-loader/issues/78).\n\n## Examples\n\n##### Facebook Style\n\n```jsx\nimport { Facebook } from 'react-content-loader'\n\nconst MyFacebookLoader = () => <Facebook />\n```\n\n![Facebook Style](https://user-images.githubusercontent.com/4838076/34308760-ec55df82-e735-11e7-843b-2e311fa7b7d0.gif)\n\n##### Instagram Style\n\n```jsx\nimport { Instagram } from 'react-content-loader'\n\nconst MyInstagramLoader = () => <Instagram />\n```\n\n![Instagram Style](https://cloud.githubusercontent.com/assets/4838076/22555637/749f9e26-e94b-11e6-84ff-83cd415c1eb9.gif)\n\n##### Code Style\n\n```jsx\nimport { Code } from 'react-content-loader'\n\nconst MyCodeLoader = () => <Code />\n```\n\n![Code Style](https://cloud.githubusercontent.com/assets/4838076/22555473/effa54c2-e94a-11e6-9128-9b608bcc69d9.gif)\n\n##### List Style\n\n```jsx\nimport { List } from 'react-content-loader'\n\nconst MyListLoader = () => <List />\n```\n\n![List Style](https://user-images.githubusercontent.com/4838076/36352948-b8931430-149e-11e8-9f4b-3f00bc444a6d.gif)\n\n##### Bullet list Style\n\n```jsx\nimport { BulletList } from 'react-content-loader'\n\nconst MyBulletListLoader = () => <BulletList />\n```\n\n![Bullet list Style](https://user-images.githubusercontent.com/4838076/31998372-59817bac-b96e-11e7-8ef8-07f61670ee18.gif)\n\n### Custom Style\n\nFor the custom mode, use the\n[online tool](https://danilowoz.github.io/create-react-content-loader/).\n\n```jsx\nconst MyLoader = () => (\n  <ContentLoader\n    height={140}\n    speed={1}\n    backgroundColor={'#333'}\n    foregroundColor={'#999'}\n    viewBox=\"0 0 380 70\"\n  >\n    {/* Only SVG shapes */}\n    <rect x=\"0\" y=\"0\" rx=\"5\" ry=\"5\" width=\"70\" height=\"70\" />\n    <rect x=\"80\" y=\"17\" rx=\"4\" ry=\"4\" width=\"300\" height=\"13\" />\n    <rect x=\"80\" y=\"40\" rx=\"3\" ry=\"3\" width=\"250\" height=\"10\" />\n  </ContentLoader>\n)\n```\n\n---\n\n![Custom](https://user-images.githubusercontent.com/4838076/36352947-b87019a8-149e-11e8-99ba-c71c2bcf8733.gif)\n\n## Similar packages\n\n- React Native: [rn-placeholder](https://github.com/mfrachet/rn-placeholder), [react-native-svg-animated-linear-gradient](https://github.com/virusvn/react-native-svg-animated-linear-gradient);\n- [Preact](https://github.com/bonitasoft/preact-content-loader);\n- Vue.js: [vue-content-loading](https://github.com/LucasLeandro1204/vue-content-loading), [vue-content-loader](https://github.com/egoist/vue-content-loader);\n- Angular: [ngx-content-loading](https://github.com/Gbuomprisco/ngx-content-loading), [ngx-content-loader](https://github.com/NetanelBasal/ngx-content-loader).\n\n## Development\n\nFork the repo then clone it\n\n```\n$ git clone git@github.com:YourUsername/react-content-loader.git && cd react-content-loader\n```\n\n`$ npm i`: Install the dependencies;\n\n`$ npm run build`: Build to production;\n\n`$ npm run dev`: Run the docz to see your changes;\n\n`$ npm run test`: Run all tests: type checking, unit tests on web and native;\n\n`$ yarn test:watch`: Watch unit tests;\n\n`$ yarn tsc`: Typescript checking;\n\n`$ yarn tsc:watch`: Typescript checking with watching;\n\n### Commit messages\n\nCommit messages should follow the [commit message convention](https://conventionalcommits.org/) so, changelogs could be generated automatically by that. Commit messages are validated automatically upon commit. If you aren't familiar with the commit message convention, you can use yarn commit (or `npm run commit`) instead of git commit, which provides an interactive CLI for generating proper commit messages.\n\n## License\n\n[MIT](https://github.com/danilowoz/react-content-loader/blob/master/LICENSE)\n\n## Known Issues\n\n##### **Alpha is not working: Safari / iOS**\n\nWhen using `rgba` as a `backgroundColor` or `foregroundColor` value, [Safari does not respect the alpha channel](https://github.com/w3c/svgwg/issues/180), meaning that the color will be opaque. To prevent this, instead of using an `rgba` value for `backgroundColor`/`foregroundColor`, use the `rgb` equivalent and move the alpha channel value to the `backgroundOpacity`/`foregroundOpacity` props.\n\n```jsx\n{/* Opaque color in Safari and iOS */}\n<ContentLoader\n  backgroundColor=\"rgba(0,0,0,0.06)\"\n  foregroundColor=\"rgba(0,0,0,0.12)\">\n\n\n{/_ Semi-transparent color in Safari and iOS _/}\n<ContentLoader\n    backgroundColor=\"rgb(0,0,0)\"\n    foregroundColor=\"rgb(0,0,0)\"\n    backgroundOpacity={0.06}\n    foregroundOpacity={0.12}>\n\n\n```\n\n##### **Black box in Safari / iOS (again)**\n\nUsing base tag on a page that contains SVG elements fails to render and it looks like a black box. Just remove the **base-href** tag from the `<head />` and issue solved.\n\n<img width=\"200\" alt=\"Black box\" src=\"https://user-images.githubusercontent.com/11562881/39406054-2f308de6-4bce-11e8-91fb-bbb35e29fc10.png\" />\n\nSee: [#93](https://github.com/danilowoz/react-content-loader/issues/93) / [109](\n","scripts":{"dev":"start-storybook -p 6006","lint":"eslint --ext .jsx --ext .ts,.tsx src/","test":"npm run test:tsc && npm run test:unit && npm run build","build":"rm -fr ./dist ./native && rollup -c && npm run test:size","commit":"git-cz","format":"prettier --write \"src/**/*.{ts,tsx}\"","release":"semantic-release","test:tsc":"tsc","test:size":"bundlesize","test:unit":"npm run test:unit:web && npm run test:unit:native","test:watch":"npm run test:unit -- --watch","test:unit:web":"jest -c jest.web.config.js","test:tsc:watch":"npm run tsc -- --watch","test:unit:native":"jest -c jest.native.config.js"},"_npmUser":{"name":"danilowoz","email":"danilowoz@gmail.com"},"_resolved":"","_integrity":"","bundlesize":[{"path":"./dist/react-content-loader.min.js","maxSize":"2 kB"},{"path":"./native/react-content-loader.native.es.js","maxSize":"3 kB"}],"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/danilowoz/react-content-loader.git","type":"git"},"_npmVersion":"6.11.3","description":"SVG-Powered component to easily create placeholder loadings (like Facebook cards loading)","directories":{},"jsnext:main":"dist/react-content-loader.es.js","sideEffects":false,"_nodeVersion":"10.17.0","dependencies":{},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"24.9.0","husky":"3.1.0","react":"16.9.0","eslint":"6.8.0","rollup":"1.27.14","ts-jest":"24.2.0","prettier":"1.19.1","react-dom":"16.12.0","babel-core":"7.0.0-bridge.0","babel-jest":"24.9.0","bundlesize":"0.18.0","commitizen":"4.0.3","typescript":"3.7.4","@babel/core":"7.7.7","@types/jest":"24.0.24","@types/react":"16.9.17","babel-eslint":"10.0.3","babel-loader":"8.0.6","react-native":"0.61.5","@babel/runtime":"7.7.7","@babel/polyfill":"7.7.0","@babel/register":"7.7.7","@commitlint/cli":"8.2.0","@storybook/react":"5.2.8","@types/react-dom":"16.9.4","react-native-svg":"9.13.6","semantic-release":"15.14.0","@babel/preset-env":"7.7.7","@storybook/addons":"5.2.8","eslint-plugin-jest":"23.1.1","rollup-plugin-copy":"3.1.0","@babel/preset-react":"7.7.4","@types/react-native":"0.60.26","eslint-plugin-react":"7.17.0","react-test-renderer":"16.12.0","rollup-plugin-uglify":"6.0.4","rollup-plugin-replace":"2.2.0","@storybook/addon-notes":"5.2.8","@significa/eslint-config":"0.0.9","react-syntax-highlighter":"^12.2.1","awesome-typescript-loader":"5.2.1","cz-conventional-changelog":"3.0.2","eslint-plugin-react-hooks":"2.3.0","rollup-plugin-typescript2":"0.25.3","@significa/prettier-config":"0.0.9","@types/react-test-renderer":"16.9.1","@commitlint/config-conventional":"8.2.0","metro-react-native-babel-preset":"0.57.0","@typescript-eslint/eslint-plugin":"2.13.0"},"peerDependencies":{"react":"^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/react-content-loader_5.0.0-rc4_1580067179893_0.21173554198978883","host":"s3://npm-registry-packages"},"publish_time":1580067180045,"_cnpm_publish_time":1580067180045,"dist-tags":{"beta":"6.0.0-beta.2","latest":"7.1.2","next":"5.0.4-rc1"}}