Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-spring-lightbox

Package Overview
Dependencies
Maintainers
1
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-spring-lightbox - npm Package Versions

1
9

1.6.0-beta.3

Diff

tim-soft
published 1.6.0-beta.2 •

tim-soft
published 1.6.0-beta.1 •

tim-soft
published 1.6.0-beta.0 •

tim-soft
published 1.5.0 •

Changelog

Source

[1.5.0] - 2021-02-17

  • Rewrite project with typescript 4
  • Upgrade react-use-gesture@7.0.15 to react-use-gesture@9.0.4
    • This upgrade should fix some miscellaneous bugs such as unable to spread non iterable instance and more consistent trackpad support

Added

  • The images prop now accepts a list of objects whose properties can be almost any valid React <img /> prop including srcset and loading (lazy loading)

If you use typescript, the exact type can be imported/used like this

import Lightbox, { ImagesListType } from 'react-spring-lightbox';

const images: ImagesListType = [
    {
        alt: 'Windows 10 Dark Mode Setting',
        'aria-details': 'Some details',
        'aria-disabled': 'false',
        loading: 'lazy',
        src: 'https://timellenberger.com/static/blog-content/dark-mode/win10-dark-mode.jpg',
        srcSet: '/wp-content/uploads/flamingo4x.jpg 4x, /wp-content/uploads/flamingo3x.jpg 3x, /wp-content/uploads/flamingo2x.jpg 2x, /wp-content/uploads/flamingo1x.jpg 1x',
    },
    {
        alt: 'macOS Mojave Dark Mode Setting',
        'aria-details': 'Some details',
        'aria-disabled': 'false',
        loading: 'lazy',
        src: 'https://timellenberger.com/static/blog-content/dark-mode/macos-dark-mode.png',
        srcSet: '/wp-content/uploads/flamingo4x.jpg 4x, /wp-content/uploads/flamingo3x.jpg 3x, /wp-content/uploads/flamingo2x.jpg 2x, /wp-content/uploads/flamingo1x.jpg 1x',
    },
];

const SimpleLightbox = () => <Lightbox images={images} {...otherProps} />;

The exact type is:

export type ImagesListItem = Omit<
    React.HTMLProps<HTMLImageElement>,
    'draggable' | 'onClick' | 'onDragStart' | 'ref'
> & { alt: string; loading?: 'auto' | 'eager' | 'lazy'; src: string };

Which translates to any React <img /> prop minus draggable, onClick, onDragStart and ref as they are used internally. alt and src are required and explicitly support loading as it is an experimental chrome feature not included in React.HTMLProps<HTMLImageElement>.

tim-soft
published 1.5.0-beta.fb4f02c •

tim-soft
published 1.5.0-beta.665b356v2 •

tim-soft
published 1.5.0-beta.665b356 •

tim-soft
published 1.5.0-beta.98999b8v5 •

tim-soft
published 1.5.0-beta.98999b8v4 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc