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

vue-pure-modal

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-pure-modal

Pure & simple Modal component for Vue

  • 0.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue-pure-modal

Open Source Love license js-semistandard-style package version install size

👾 Pure & simple Vue Modal component. Basic a11y covered.

Installation

npm i vue-pure-modal

Demo

Checkout demo example on CodeSandbox.

Usage

As global component:

import PureModal from 'vue-pure-modal';
import Vue from 'vue';

Vue.use(PureModal);

Or import where you use it in your components:

import { PureModal } from 'vue-pure-modal';

...
components: {
  PureModal
}

Example

<pure-modal v-if="showModal" @close="showModal = false">
  <template v-slot:header>
    <b>Pure</b> Modal Title
  </template>
  <template v-slot:footer>
    <button @click="showModal = false">Hide me!</button>
  </template>
  Modal body here as a message.
</pure-modal>

You can specify additional options:

  • animate - to apply smooth open/close transition. true by default.
  • focusTrap - to trap tab focus inside modal while open. true by default.
  • describedByBody - to set modal a11y describedBy to modal body section. false by default.

To use basic style (its not really pretty sorry!) just import generated css:

import 'vue-pure-modal/dist/puremodal.css';

In case you want to use this basic style and overwrite some parts of it you can simply do so since it was written with BEM naming.

Example in scss:

.my-custom-class.puremodal .puremodal {
  &__body {
    font-size: 2rem;
  }
}

Or in regular css:

.my-modal.puremodal .puremodal__body {
  font-size: 2rem;
}

Changing backdrop modal throws is also easy:

.my-modal.puremodal.puremodal__drop {
  color: blue;
}

To overwrite default styles coming with modal be sure to add your custom css class to <pure-modal> component, like .my-modal in examples above.

License

MIT.

Keywords

FAQs

Package last updated on 31 Oct 2019

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