Socket
Book a DemoInstallSign in
Socket

@dreamworld/dw-image

Package Overview
Dependencies
Maintainers
4
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dreamworld/dw-image

A WebComponent to show zoomable image on documentation & blog sites

latest
Source
npmnpm
Version
1.5.1
Version published
Maintainers
4
Created
Source

dw-image

A WebComponent to show zoomable image on documentation & blog sites.

Behaviours

  • Auto compute height or width based on auto property, give another value as a css of element.
  • When user click on image, then image open in dialog using zoomSrc property. if zoomSrc is not available then use src property to show image in dialog.
  • If you want to disable the above zoomable behaviour then disableZoom property passed as a true.

Examples

  • Default example

      <dw-image src='https://picsum.photos/id/237/200/300' zoom-src='https://picsum.photos/id/237/1000/1000'></dw-image>
    
      <!-- In this above case you give a height css property as an element. -->
      dw-image {
        width: 200px;
      }
    
  • Auto width

      <dw-image auto='width' src='https://picsum.photos/id/237/200/300' zoom-src='https://picsum.photos/id/237/1000/1000'></dw-image>
    
  • Auto none

      <dw-image auto='none' src='https://picsum.photos/id/237/200/300' zoom-src='https://picsum.photos/id/237/1000/1000'></dw-image>
    
      <!-- In this above case you give a height css property as an element. -->
      dw-image {
        height: 200px;
      }
    
  • Disabled zoomable behaviour and open link click on image.

      <a href="https://www.google.com/">
        <dw-image src='https://picsum.photos/id/237/200/300' disable-zoom></dw-image>
      </a>
    

Properties

PropertyAttributeTypeDescription
autoautostringAuto compute css property name.
Default value: height
Possible value: height, width, none.
disableZoomdisable-zoombooleanDisabled zoom behaviour when this value is true.
srcsrcstringImage path/source.
titletitlestringImage title.
zoomSrczoom-srcstringZoomable image path.

Keywords

image

FAQs

Package last updated on 07 Dec 2023

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