Gathering detailed insights and metrics for react-placeholder
Gathering detailed insights and metrics for react-placeholder
Gathering detailed insights and metrics for react-placeholder
Gathering detailed insights and metrics for react-placeholder
react-placeholder-loading
<p align="center">A simple component to create loading placeholders without write any SVG line</p> <p align="center"> <img src="https://github.com/gabrielbs/react-placeholder-loading/blob/master/example/shapes-example.gif"> </p>
react-placeholder-typing
The `react-placeholder-typing` is a highly customizable React component that simulates an animated typing and deleting effect for placeholder text within an input field. The placeholders cycle through a list of specified text strings, creating a dynamic t
slate-react-placeholder
A Slate plugin to render a placeholder with React.
react-placeholder-image
Quickly mock up UI's with placeholder images.
npm install react-placeholder
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,613 Stars
208 Commits
97 Forks
23 Watching
15 Branches
33 Contributors
Updated on 18 Sept 2024
Minified
Minified + Gzipped
TypeScript (88.17%)
JavaScript (8.87%)
HTML (1.7%)
SCSS (1.26%)
Cumulative downloads
Total Downloads
Last day
6%
6,666
Compared to previous day
Last week
-1.9%
33,082
Compared to previous week
Last month
5.4%
149,742
Compared to previous month
Last year
-7.6%
1,692,860
Compared to previous year
1
31
A React component to easily replicate your page with nice placeholders while the content is loading. You can use a placeholder from the default set, or pass your own!
1import ReactPlaceholder from 'react-placeholder';
2import "react-placeholder/lib/reactPlaceholder.css";
3
4React.renderComponent(
5 <div>
6 <ReactPlaceholder type='media' rows={7} ready={this.state.ready}>
7 <MyComponent />
8 </ReactPlaceholder>
9 </div>,
10 document.body);
npm install --save react-placeholder
1children: ReactNode; 2ready: boolean; 3delay?: number; 4firstLaunchOnly?: boolean; 5showLoadingAnimation?: boolean; 6type?: 'text' | 'media' | 'textRow' | 'rect' | 'round'; 7rows?: number; 8color?: string; 9customPlaceholder?: ReactElement; 10className?: string; 11style?: CSSProperties;
The default props will render a text
placeholder with 3
rows and the color #CDCDCD
.
If the built-in set of placeholders is not enough, you can pass you own through the prop "customPlaceholder"
1<ReactPlaceholder ready={this.state.ready} customPlaceholder={<MyCustomPlaceholder />}> 2 <MyComponent /> 3</ReactPlaceholder>
You can also import the built-in placeholders directly. This might be useful to use them to create your own customized placeholder:
1import {TextBlock, MediaBlock, TextRow, RectShape, RoundShape} from 'react-placeholder/lib/placeholders'; 2 3const awesomePlaceholder = ( 4 <div className='my-awesome-placeholder'> 5 <RectShape color='blue' style={{width: 30, height: 80}}/> 6 <TextBlock rows={7} color='yellow'/> 7 </div> 8); 9 10<ReactPlaceholder ready={this.state.ready} customPlaceholder={awesomePlaceholder}> 11 <MyComponent /> 12</ReactPlaceholder>
You can pass an optional delay
prop which specifies the time (in milliseconds) react-placeholder
should wait before displaying the placeholder element. This is useful if you want to show a placeholder for slower connections while avoiding a brief "flash" on faster connections.
Note that this delay will not affect the initial render, only subsequent "ready" state changes. Setting the firstLaunchOnly
prop to true
will also disable this feature.
react-placeholder
already comes with one default pulse animation to better tell the user that the page is loading.
The animation is defined in a separate CSS file so, in order to enable it, you should import that style in your project like this:
1import 'react-placeholder/lib/reactPlaceholder.css';
Once you've done this, you can simply pass the boolean prop showLoadingAnimation
to tell ReactPlaceholder
to animate itself:
1import 'react-placeholder/lib/reactPlaceholder.css'; 2 3<ReactPlaceholder showLoadingAnimation ready={this.state.ready} type="media" rows={5}> 4 <p>This is a Test.</p> 5</ReactPlaceholder>
you can style the placeholder by passing className
or style
or by using the built-in classes:
"text-block", "media-block", "text-row", "rect-shape", "round-shape".
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
106 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More