0.13.2 ā€¢ Published 1 year ago

sito-image v0.13.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

sito-image

Image with shimmer loader

What is a shimmer?

A powerful, customizable, Suspense-like component that (optionally) simulates a shimmer effect while loading.

How to use it?

import SitoImage from "sito-image";

function App() {
    return {
        <SitoImage src="https://source.unsplash.com/random/800x600" alt="shimmer-example" />
    }
}

You can change the name of the container, if you don't like its name šŸ˜‚

import Image as Container from "sito-image";

function App() {
    return {
        <Image src="https://source.unsplash.com/random/800x600" alt="shimmer-example" />
    }
}

Yo can add your css rules, like sx prop for styled-component, style prop like inline css styles and classNames from your css files

import Image as Container from "sito-image";

function App() {
    return {
        <Image
            sx={{ width: "350px", height: "350px" }}
            src="https://source.unsplash.com/random/800x600"
            alt="shimmer-example"
        />
    }
}

Props

NameTypeDefaultDescription
idstringhtml identifier
namestringhtml name
classNamestringcss class name
srcstringsource image
errornodecomponent to show when something goes wrong
loadingComponentnodeshimmercomponent to show while image is loading
altstring"no-image"The required alt attribute specifies an alternate text for an image, if the image cannot be displayed.The alt attribute provides alternative information for an image if a user for some reason cannot view it (because of slow connection, an error in thesrc attribute, or if the user uses a screen reader).Tip: To create a tooltip for an image, use the title attribute!
sxArray<func| object| bool>| func| objectThe system prop that allows defining system overrides as well as additional CSS styles. See the sx page for more details.
styleArray<func| object| bool>| func| objectinline css
extraPropsArray<func| object| bool>| func| objectextra props like: onClick, onMouseEnter, etc
onLoadfunctionfunctions to handle when the image is loaded
onErrorfunctionfunctions to handle when the image could not be loaded

šŸ™Œ Good luck out there my friend šŸ™Œ

0.12.1

2 years ago

0.13.1

2 years ago

0.12.2

2 years ago

0.13.2

1 year ago

0.8.4

2 years ago

0.3.9

2 years ago

0.10.2

2 years ago

0.11.3

2 years ago

0.11.4

2 years ago

0.11.5

2 years ago

0.7.2

2 years ago

0.5.4

2 years ago

0.3.6

2 years ago

0.3.8

2 years ago

0.9.1

2 years ago

0.7.3

2 years ago

0.3.7

2 years ago

0.4.1

2 years ago

0.6.1

2 years ago

0.2.20

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.10

2 years ago

0.2.8

2 years ago

0.1.6

2 years ago