vue-sweetalert-icons

A super simple Vue wrapper for the beautiful animated SweetAlert status icons
55,113 59
Install
npm install vue-sweetalert-icons
Latest Version:5.0.0
Vue:3
Older releases:2
License:ISC
Last Updated:Sep 25, 2023
Links: GitHub  ·  npm
Maintainer: jorgenvatle

Animated SweetAlert Icons for Vue

A clean and simple Vue wrapper for SweetAlert's fantastic status icons. This wrapper is intended for users who are interested in just the icons. For the standard SweetAlert modal with all of its bells and whistles, you should probably use Vue-SweetAlert 2

Install

Vue v3

npm install vue-sweetalert-icons

Vue v2

npm install vue-sweetalert-icons@4

Import

import SweetAlertIcons from 'vue-sweetalert-icons';

// For Vue v3, you also need to import styles explicitly:
import 'vue-sweetalert-icons/dist/style.css'

Vue.use(SweetAlertIcons);

If you're using Nuxt, you might need additional steps (read more)

Use

<template>
    <!-- Icon can be one of: "success", "warning", "info", "error" and "loading" -->
    <sweetalert-icon icon="success" />

    <!-- Optionally, you can customize colors for all icons! 🎨 -->
    <sweetalert-icon icon="warning" color="#6a737d"/>
</template>

Alternative Usage

If you'd rather not use the package globally, you can import SweetalertIcon for use with a single vue component/instance instead:

<template>
    <sweetalert-icon icon="success"></sweetalert-icon>
</template>

<script>
    import SweetalertIcon from 'vue-sweetalert-icons';
    
    // For Vue v3, make sure you've imported the styles somewhere in your app as well.
    // import 'vue-sweetalert-icons/dist/style.css'
    
    export default {
        components: { SweetalertIcon },
    }
</script>

Usage with Nuxt 2

Due to an issue with the way styles are injected into Nuxt, please wrap <sweetalert-icon /> around <no-ssr> tags. If you're using Nuxt 3, this step is no longer necessary.

<no-ssr>
    <sweetalert-icon icon="info" />
</no-ssr>

Credits

License

ISC

Related Packages

vue-skycons

Skycons components in VueJS

23,766 11
@animated-color-icons/lucide-vue

Animated Lucide icons for Vue — CSS-only hover animations with two-tone color su...

2,108 303
animated-icons-vue

402+ animated SVG icons for Vue 3, with hover and programmatic animations

409 2
@vue-hero-icons/outline

A set of free MIT-licensed high-quality SVG icons as Vue functional components.

246,298 101
@nuxt-hero-icons/outline

A set of free MIT-licensed high-quality SVG icons as Vue functional components.

5,626 4

Version History

Version Released License
5.0.0 ISC
4.3.1 ISC
4.3.0 ISC
4.2.0 ISC
4.1.0 ISC
Pre-releases (2)
Version Released License
4.0.0-rc2 ISC
4.0.0-rc1 ISC