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 🙏

© 2026 – Pkg Stats / Ryan Hefner

flour-modal

v0.2.0

Published

An all purpose modal plugin for Vue 3. Easy to use and customise, with a modern but minimalist design, and zero dependencies. And you can use your own components alongside it!

Readme

FlourModal

An all purpose modal plugin for Vue 3. Easy to use and customise, with a modern but minimalist design, and zero dependencies. And you can use your own components alongside it!

NPM Downloads npm-version license

Installation

npm install flour-modal

Usage

Import it in your component

import { fModal } from "flour-modal";
import "flour-modal/styles.css";

With Composition API

const modal = fModal();

const openModal = () => {
    modal.open({
        title: 'Awesome!',
        message: 'You have successfully installed the FlourModal plugin. Please press OK to continue.',
        defaultCTALabel: 'Got it!',
    });
};

<template>
    <button type="button" @click="openModal"> Open modal </button>
</template>

With Options API

export default defineComponent({
    methods: {
        openModal() {
            fModal().open({
                title: 'Awesome!',
                message: 'You have successfully installed the FlourModal plugin. Please press OK to continue.',
                defaultCTALabel: 'Got it!'
            });
        },
    },
});

Using your own component within the modal

You'll likely want to display one of your components as a modal. Simply pass it as the child prop and that's it! If your component already has its own CTA and you don't need the default one, just set the defaultCTA prop as false.

import YourComponent from "@/components/YourComponent.vue";
import { fModal } from "flour-modal";
import "flour-modal/styles.css";

const modal = fModal();

modal.open({
    title: 'Use your own component',
    child: YourComponent,
    defaultCTA: false,
});

How do I close the modal?

Clicking the default CTA button or outside of the modal or pressing the Escape key will close the modal.

If you're using your own component and need to close the modal from it, FlourModal provides its own internal method called closeModal which you can simply inject like so and then just call it wherever you need.

import { inject } from "vue";

const close = inject('closeModal');

Available props

Name | Type | Optional | Default :--|-----------|----------|-- title | String | Yes | - message | String | Yes | - child | Component | Yes | - defaultCTA | boolean | Yes | true defaultCTALabel | String | Yes | OK intent | String | Yes | default

Making the modal available globally

If you're going to use modals in many different places then it might be worth it to make the modal available globally:

import { createApp } from 'vue';
import FlourModal from "flour-modal";
import "flour-modal/styles.css";

const app = createApp(App);

app.use(FlourModal);
app.mount('#app');

This will make a global $flourModal property available inside any component template which you can use like this:

<template>
  <button
      @click="$flourModal.open({
          title: 'Awesome!',
          message: 'You have successfully installed the FlourModal plugin. Please press OK to continue.',
      })"
  > Open modal </button>
</template>

NOTE: If you're using the Options API and you want to use this outside of the component template then you'll have to reference it as this.$flourModal; With the Compositon API, you'll have to inject it like so: const $flourModal = inject('$flourModal');