npm.io
0.2.2 • Published 3d ago

@lambdaimg/react

Licence
MIT
Version
0.2.2
Deps
1
Size
4 kB
Vulns
0
Weekly
0

@lambdaimg/react

A tiny React component for LambdaImg. It renders one plain <img> with generated srcSet values.

import { Image } from "@lambdaimg/react";

<Image
  baseUrl="https://images.example.com"
  src="products/chair.jpeg"
  width={640}
  height={480}
  alt="Walnut chair"
/>;

Use priority for above-the-fold images:

<Image
  priority
  baseUrl="https://images.example.com"
  src="hero.jpeg"
  width={1440}
  height={810}
  alt="Showroom"
/>