Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@s-ui/react-atom-image
Advanced tools
AtomImage is a component that loads an image inside, maintaining all the accesibility attributes. This component can be set to show a placeholder image, a skeleton and/or a spinner while the final image is being loaded. This component will also show an Er
AtomImage is a component that loads an image inside, maintaining all the accesibility attributes. This component can be set to show a placeholder image, a skeleton and/or a spinner while the final image is being loaded. This component will also show an Error Box if the image could't be loaded
$ npm install @s-ui/react-atom-image --save
After importing the component AtomImage
like this
import AtomImage from '@s-ui/react-atom-image'
<AtomImage
src={ urlImage }
alt="Nice Picture"
/>
<AtomImage
src={ urlImage }
alt="Nice Picture"
skeleton={ urlImageSkeleton }
/>
<AtomImage
src={ urlImage }
alt="Nice Picture"
placeholder={ urlImagePlaceholder }
/>
<AtomImage
src={ urlImage }
alt="Nice Picture"
spinner={ Spinner }
/>
<AtomImage
src={ urlImage }
alt="Nice Picture"
errorText="Oh no!! This image couldn't be loaded"
errorIcon={ MyIconErrorLoading }
/>
Loads 50x50 image when the viewport is under 480px, elsewise it loads a 150x150 image
<AtomImage
src='https://via.placeholder.com/50'
alt=''
sources={[
{srcset: 'https://via.placeholder.com/150', media: '(min-width: 480px)'}
]}
Attributes to optimize image that is a LCP element, usually the first image in the viewport
import AtomImage, {DECODING, FETCHPRIORITY, LOADING} from '@s-ui/react-atom-image'
<AtomImage
src='https://via.placeholder.com/50'
alt='Optimized image for LCP'
decoding={DECODING.sync}
fetchpriority={FETCHPRIORITY.high}
loading={LOADING.eager}
sources={[
{srcset: 'https://via.placeholder.com/150', media: '(min-width: 480px)'}
]}
Attributes to optimize image that is not a LCP element, usually the the images out of the viewport
import AtomImage, {DECODING, FETCHPRIORITY, LOADING} from '@s-ui/react-atom-image'
<AtomImage
src='https://via.placeholder.com/50'
alt='Optimized image to lazy load and low the priority'
decoding={DECODING.async}
fetchpriority={FETCHPRIORITY.low}
loading={LOADING.lazy}
sources={[
{srcset: 'https://via.placeholder.com/150', media: '(min-width: 480px)'}
]}
Find full description and more examples in the demo page.
FAQs
AtomImage is a component that loads an image inside, maintaining all the accesibility attributes. This component can be set to show a placeholder image, a skeleton and/or a spinner while the final image is being loaded. This component will also show an Er
The npm package @s-ui/react-atom-image receives a total of 602 weekly downloads. As such, @s-ui/react-atom-image popularity was classified as not popular.
We found that @s-ui/react-atom-image 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.