0.4.9 • Published 6 months ago

@nanlabs/react-ui v0.4.9

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Documentation | Contributing

Continious Integration npm npm License: MIT

This library provides a set of React components that can be used in any React application.

Installation

npm install @nanlabs/react-ui

Usage

The following example shows how one of the multiple hooks provided by this library can be used.

In the example bellow we use the Image component to render an image with a list of fallbacks and retrying on error.

You can find more examples in the documentation.

import React from "react";
import { Image } from "@nanlabs/react-ui";

const Component = () => (
  <Image
    src="https://picsum.photos/400"
    fallback={["https://picsum.photos/300", "https://picsum.photos/200"]}
    maxRetry={3}
    retryDelay={1000}
    initialTimeout={1000}
    decoding="async"
    loading="lazy"
    className="async-image"
    onLoad={() => console.log("Image loaded!")}
    style={{
      width: "300px",
      objectFit: "cover",
    }}
  />
);
0.4.9

6 months ago

0.4.8

7 months ago

0.4.7

12 months ago

0.4.6

12 months ago