New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-3-fullscreen-image-directive-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-3-fullscreen-image-directive-plugin

Vue 3 plugin to open an image in a modal on click

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-56.34%
Maintainers
1
Weekly downloads
 
Created
Source

Vue 3 Fullscreen Image Directive Plugin

A lightweight Vue.js plugin for creating a fullscreen image modal with customizable options.

Demo

Installation

Install the package using npm:

npm install vue-3-fullscreen-image-directive-plugin
yarn add vue-3-fullscreen-image-directive-plugin

Usage

Register the Plugin

import { createApp } from 'vue'
import App from './App.vue'
import { fullscreenImagePlugin } from './fullscreen-image-plugin'

createApp(App).use(fullscreenImagePlugin).mount('#app')

Use the Directive

Add the v-fullscreen-image directive to any element you want to trigger the fullscreen image modal on click.

<template>
  <img v-fullscreen-image="{
    imageUrl: 'https://placehold.co/2000x4000',
    withDownload: false,
    animation: 'blur'
  }"
  src="https://placehold.co/200x400"
  />
</template>

Directive Options

NameTypeDescription
imageUrl(string, required)The URL of the image to display
animation(string, optional, default: 'fade')Animation type ('fade', 'blur', 'none').
imageAlt(string, optional)Alt text for the image.
withDownload(boolean, optional, default: true)Show the download button.
withClose(boolean, optional, default: true)Show the close button.
withFocusOnClose(boolean, optional, default: true)Automatically focus on the close button when the modal opens.
withCloseOnEscape(boolean, optional, default: true)Close the modal when the 'Escape' key is pressed.
closeOnClickOutside(boolean, optional, default: true)Close the modal when clicking outside the image.
maxHeight(string, optional, default: '80vh')Maximum height of the image container.
maxWidth(string, optional, default: '80vw')Maximum width of the image container.

Keywords

FAQs

Package last updated on 08 Mar 2024

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

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