![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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">
{({ getLine }) => (
<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 0 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.