Socket
Socket
Sign inDemoInstall

@socialgouv/dsfr-toaster-nuxt-module

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socialgouv/dsfr-toaster-nuxt-module

Module Nuxt Dsfr Toaster


Version published
Weekly downloads
62
increased by195.24%
Maintainers
2
Weekly downloads
 
Created
Source

Module Nuxt Dsfr Toaster

npm version npm downloads License Nuxt

Module Nuxt Dsfr Toaster pour afficher des alertes.

Features

  • Duration : Permet de limiter dans le temps l'alerte
  • Accessibilité : Ajout du role alert sur les success et error
  • Dsfr : Utilisation du DsfrAlert

Rendu

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add @socialgouv/dsfr-toaster-nuxt-module

Surchage de la configuration

That's it! You can now use Module Nuxt Dsfr Toaster in your Nuxt app ✨

Utilisation

Créer une balise <DsfrToaster /> dans un layout puis appeler useToaster n'importe où.

const toaster = useToaster();
onMounted(() => {
  toaster.info({
    description: "Va disparaître",
    duration: 2500,
  });
  toaster.info({
    title: "title",
    description: "Small",
    small: true,
  });
  toaster.info({
    title: "title",
    description: "Not small",
    small: false,
  });
  toaster.warning({ description: "warning", closeable: false });
  toaster.success({ title: "Opération réussie", description: "success" });
  toaster.error({
    title: "Une erreur est survenue lors de la saubegarde",
    description: "Veuillez considérer un nouvel échantillon",
  });

  toaster.success({
    // Passe la description via en slot
    slots: {
      default: {
        component: DsfrBadge,
        attrs: { label: "Alerte avec un badge" },
      },
    },
  });
  toaster.success("youyou"); // Passe une description uniquement
});

Contribution

Local development
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

FAQs

Package last updated on 30 Apr 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