npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cube-vue-modal

v1.0.9

Published

A simple, basic, highly customizable and mobile friendly modal component for Vue.

Downloads

117

Readme

cube-vue-modal

A simple, basic, highly customizable and mobile friendly modal component for Vue.

Key features

  • Easy to use
  • Simple HTML structure
  • CSS customizable
  • Large content support — addresses the well-known Safari over-scroll chaining issue on iOS

Usage

Install

yarn add cube-vue-modal

Exemple

Template

<div id="App">
  <p>Click the button below to open the modal.</p>
  <button :disabled="open" @click="open = true">Open</button>
  <Modal v-model="open">
    <header>
      <h1 class="modal-title">Title</h1>
    </header>
    <main>
      <p>This is a content.</p>
    </main>
    <footer>
      <button @click="open = false">Close</button>
    </footer>
  </Modal>
</div>

Script

import Modal from 'cube-vue-modal'

export default {
  components: {
    Modal
  },
  data() {
    return {
      open: false
    }
  }
}

SCSS

///
/// Import your own variables
///
@import 'assets/scss/variables';

///
/// Import modal style and animations
///
@import '~cube-vue-modal/src/scss';
/// Or ↴
@import '~cube-vue-modal/src/scss/variables';
@import '~cube-vue-modal/src/scss/modal';
@import '~cube-vue-modal/src/scss/animations';

Props

| Name | Required | Type | Default | Description | | ---------- | -------- | -------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | value | false | Boolean | false | The open state of the modal. | | transition | false | String | 'animate' | The name of the transition to use for opening and closing. | | target | false | String, Object | document.body | The querySelector or the Element to append the modal to. |

Events

| Name | Description | | ------ | -------------------------------------------------- | | input | The open state of the modal has changed. | | open | The modal is opened. | | opened | The modal is opened and the animation is finished. | | close | The modal is closed. | | closed | The modal is closed and the animation is finished. |

Methods

| Name | Async | Description | | ------ | ----- | -------------------------------------------------------------- | | open | true | Opens the modal and resolves after the animation is finished. | | close | true | Closes the modal and resolves after the animation is finished. | | toggle | true | Switches between the open and close methods. |

HTML structure and classes

<div class="modal">
  <div class="modal-backdrop"></div>
  <div class="modal-dialog" role="dialog">
    <button class="modal-dialog-close"></button>
    <div class="modal-dialog-container">
      <slot />
    </div>
  </div>
</div>

Development Setup

# Project setup
yarn install

# Compiles and hot-reloads for demo web site development
yarn run serve

# Compiles and minifies for production
yarn run build

# Lints and fixes files
yarn run lint

# Run the unit tests
yarn run test:unit