0.13.2 ā¢ Published 2 years ago
sito-image v0.13.2
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
Name | Type | Default | Description | |
---|---|---|---|---|
id | string | html identifier | ||
name | string | html name | ||
className | string | css class name | ||
src | string | source image | ||
error | node | component to show when something goes wrong | ||
loadingComponent | node | shimmer | component to show while image is loading | |
alt | string | "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! | |
sx | Array<func| object| bool>| func| object | The system prop that allows defining system overrides as well as additional CSS styles. See the sx page for more details. | ||
style | Array<func| object| bool>| func| object | inline css | ||
extraProps | Array<func| object| bool>| func| object | extra props like: onClick, onMouseEnter, etc | ||
onLoad | function | functions to handle when the image is loaded | ||
onError | function | functions 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
2 years 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