Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
react-text-skeleton
Advanced tools
A simple and small react library in order to create a loading text skeleton that either blurs out a dummy text or displays a loading gradient until the loaded text is provided.
A simple and small react library in order to create a text skeleton that either blurs out a dummy text or displays a loading gradient until the final text is loaded. The advantage is that it the blurred/gradient length is determined by the dummy text that should aproximatelly match the length of the data that is going to be fetched(it also takes in consideration the font-size). This way it creates a nice simple effect without the need of measuring the data that is beining loaded in a fixed pixel ratio. Demo: https://techbinator.github.io/react-text-skeleton
npm i react-text-skeleton
Add the dummyText prop while having a text similar to the one that is fetched. For example if a price that has 3 digits set the dummyText with a 3 digits number. Once the children prop is provided the blurring and dummy text are replaced with that.
<TextSkeleton dummyText="Dummy text">{realText}</TextSkeleton>
dummyText: string; className?: string; skeletonType?: 'blurred' | 'gradient';
<TextSkeleton>
Name | Type | Default | Description |
---|---|---|---|
dummyText | string | null | Mandatory field, provide a string of a length that has aproximatelly the same dimensions as the data that is being fetched |
className | string | '' | Extra class(es) that would be prepended |
skeletonType | string | 'blurred' | The desired effect can be either 'blurred' or 'gradient' |
import React from 'react';
import TextSkeleton from 'react-text-skeleton';
const App: React.FC = () => {
return <TextSkeleton dummyText="Dummy text">{loadingText}</TextSkeleton>;
};
MIT
FAQs
A simple and small react library in order to create a loading text skeleton that either blurs out a dummy text or displays a loading gradient until the loaded text is provided.
We found that react-text-skeleton 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.