🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@spronta/images-react

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spronta/images-react

Spronta Image CDN — React components with blurhash placeholders

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

@spronta/images-react

React components for the Spronta image CDN. Responsive images with automatic srcset generation and blurhash placeholders.

Install

npm install @spronta/images @spronta/images-react

Quick start

import { Spronta } from "@spronta/images";
import { SprontaProvider, SprontaImage } from "@spronta/images-react";

const client = new Spronta({
  baseUrl: "https://cdn.spronta.com",
  project: "my-project",
});

function App() {
  return (
    <SprontaProvider client={client}>
      <SprontaImage
        path="hero.jpg"
        alt="Hero image"
        widths={[400, 800, 1200]}
        sizes="(max-width: 768px) 100vw, 50vw"
        blurhash="LEHV6nWB2y"
        width={1200}
        height={800}
      />
    </SprontaProvider>
  );
}

Components

<SprontaProvider>

Wrap your app once to provide the Spronta client to all <SprontaImage> components.

<SprontaProvider client={sprontaClient}>
  {children}
</SprontaProvider>

<SprontaImage>

Renders a responsive <img> with automatic srcset, format negotiation, and blurhash placeholder.

PropTypeDescription
pathstringImage path on the CDN
altstringAlt text (required)
transformsobjectTransform options (width, height, fit, etc.)
widthsnumber[]Srcset breakpoints
sizesstringSizes attribute
blurhashstringBlurhash string for placeholder
widthnumberIntrinsic width
heightnumberIntrinsic height
loadingstringlazy (default) or eager

How it works

  • Generates src + srcset via the core SDK
  • Decodes blurhash to a 32px canvas placeholder
  • Fades in the actual image on load

Requirements

  • React 18+
  • @spronta/images (core SDK)

License

MIT

FAQs

Package last updated on 21 Mar 2026

Did you know?

Socket

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.

Install

Related posts