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

vuetify-use-dialog

v0.6.11

Published

> Confirming user choice is a good thing to do, it should also be easy to do.

Downloads

3,970

Readme

vuetify-use-dialog

Confirming user choice is a good thing to do, it should also be easy to do.

A module that simplifies the creation of dialogs and snackbars in Vuetify.

Demo: StackBlitz

Installation

npm install vuetify-use-dialog

Usage

Install the plugin (after vuetify)

import { createApp } from 'vue'
import { createVuetify } from 'vuetify'
import VuetifyUseDialog from 'vuetify-use-dialog'

import App from './App.vue'

const app = createApp(App)
const vuetify = createVuetify()

app.use(vuetify)
app.use(VuetifyUseDialog)

app.mount('#app')

Call the useConfirm or useSnackbar composable anywhere:

<script setup lang="ts">
import { useConfirm, useSnackbar } from 'vuetify-use-dialog'

const createConfirm = useConfirm()
const createSnackbar = useSnackbar()

async function handleConfirm() {
  const isConfirmed = await createConfirm({ content: 'This action is permanent!' })

  if (!isConfirmed)
    return

  createSnackbar({ text: 'Confirmed' })
}
</script>

<template>
  <VBtn @click="handleConfirm">
    Confirm
  </VBtn>
</template>

Check this if you're using Options API.

Options

useConfirm

| Name | Type | Default | Description | | --------------------------------------- | ----------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | title | string | 'Are you sure?' | Dialog title. | | titleComponent | Component | | Custom title component. | | titleComponentProps | object | {} | Custom title component props. | | content | string | '' | Dialog content. | | contentComponent | Component | | Custom content component. | | contentComponentProps | object | {} | Custom content component props. | | confirmationText | string | 'Ok' | Confirmation button caption. | | cancellationText | string | 'Cancel' | Cancellation button caption. | | dialogProps | object | {} | VDialog props. | | cardProps | object | {} | VCard props. | | confirmationButtonProps | object | {} | VBtn props for the confirmation button. | | cancellationButtonProps | object | {} | VBtn props for the cancellation button. | | cardTitleProps | object | {} | VCardTitle props for the dialog title. | | cardTextProps | object | {} | VCardText props for the dialog content. | | confirmationKeyword | string | undefined | If provided the confirmation button will be disabled by default and an additional textfield will be rendered. The confirmation button will only be enabled when the contents of the textfield match the value of confirmationKeyword. | | confirmationKeywordTextFieldProps | object | {} | VTextField props for the confirmation keyword textfield. | | cardActionsProps | object | {} | VCardActions props. | | actionsContentComponent | Component | {} | Custom actions content component. |

useSnackbar

| Name | Type | Default | Description | | --------------------------------------- | ----------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | text | string | '' | Snackbar text. | | snackbarProps | object | {} | VSnackbar props. | | showCloseButton | boolean | true | Show the close button. | closeButtonText | string | 'Close' | Close button text | closeButtonProps | object | {} | VBtn props. |

Global options:

app.use(VuetifyUseDialog, {
  confirmDialog: {
    // useConfirm options
    title: 'Are you sure?'
  },
  snackbar: {
    // useSnackbar options
    snackbarProps: {
      timeout: 2000,
    }
  }
})

Looking for a stackable toast component? Check out Vuetify Sonner.

License

MIT