Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
react-placehodl
Advanced tools
React placeholders made simple.
$ npm i react-placehodl
Placeholders are cool. Placeholder are way cooler than spinners. Current libraries implementing placeholder are super complicated. There's prefabricated components with pre-made styles you must import, and there's ways to make custom ones that interact with these libraries. This doesn't really allow much flexibility, which is the motivation of this lib.
Yeah, yeah, yeah... We're all aware of the hype going on with the render prop. Just happens to be that a placeholder is the perfect use case for them.
The <Placehodl />
component has the following props:
// lines - corresponds with number of lines in the paragraph
// words - corresponds with number of words per line
// size - corresponds with number of size possibilities for each word.
getParagraph(lines: int, words: int, size: int) => (paragraph: jsx)
// words - corresponds with number of words in the line
// size - corresponds with number of size possibilities for each word.
getLine(words: int, size: int) => (line: jsx)
// size - corresponds with number of size possibilities in the returned className.
getSize(size: int) => (className: string)
import Placehodl from 'react-placehodl';
// outputs paragraph with 10 lines, 3 words, 5 sizes
const Placeholder = props => {
return (
<Placehodl seed={props.seed} prefix="my-placeholder">
{({ getParagraph }) => getParagraph(10, 3, 5)}
</Placehodl>
);
};
import Placehodl from 'react-placehodl';
// outputs line with 3 words, 5 sizes
const Placeholder = props => {
return (
<Placehodl seed={props.seed} prefix="my-placeholder">
{({ getLine }) => (
<div className="my-placeholder-paragraph">
{Array(10)
.fill(0)
.map((line, i) => (
<div
key={`placeholder-line-container-${i}`}
className="my-placeholder-line-container"
>
{getLine(3, 5)}
<Icon name="info" />
</div>
))}
</div>
)}
</Placehodl>
);
};
import Placehodl from 'react-placehodl';
// outputs word 5 possible sizes
const Placeholder = props => {
return (
<Placehodl seed={props.seed} prefix="my-placeholder">
{({ getSize }) => (
<div className="my-placeholder-paragraph">
{Array(10)
.fill(0)
.map((line, i) => (
<div key={`placeholer-line-${i}`} className="my-placeholder-line">
{Array(3)
.fill(0)
.map((word, j) => (
<div
key={`placeholder-word-${j}`}
className={`my-placeholder-line-container ${getSize(5)}`}
/>
))}
</div>
))}
</div>
)}
</Placehodl>
);
};
FAQs
React placeholders made simple.
The npm package react-placehodl receives a total of 7 weekly downloads. As such, react-placehodl popularity was classified as not popular.
We found that react-placehodl demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.