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

simple-alerts

v0.3.10

Published

A simple vue alert component

Downloads

152

Readme

Simple-Alerts

Simple-Alerts is a Vue alert component library that allows you to easily display customizable alerts in your Vue applications.

Installation

To install Simple-Alerts, you can use npm or yarn:

npm install simple-alerts

Usage

AlertComponent

The AlertComponent is the main component provided by the Simple-Alerts library. It allows you to display alerts with customizable properties.

Props

  • title (String): The title of the alert.
  • message (String): The message to be displayed in the alert.
  • show (AlertComponent.vue:55:9-71:10) (Boolean): Controls the visibility of the alert.
  • custom (Boolean): Indicates whether custom properties should be applied.
  • customProperties (Object): An object containing custom properties for the alert.

Examples

Import vue component and css

How-to-use

Gif: SimpleAlert Video: SimpleAlert.webm

Customize options

data-options

Customize css

data-options (1)

Full code as text exempple

<template>
  <AlertComponent
    :show="show"
    title="Title"
    message="Test text"
    :custom="true"
    :customProperties="alert"
  />
</template>

<script>
import AlertComponent from 'simple-alerts';

export default {
  name: 'App',
  components: {
    AlertComponent
  },
  data() {
    return {
      show: true,
      alert: {
        autoClose: true,
        timer: 1000,
        backgroundColor: 'red',
        textColor: 'white',
        closeButton: false,
        closeButtonText: 'Close',
        customCssClass: 'alert-custom-css-class'
      }
    }
  }
}
</script>

Customization

You can customize the styles of the alerts by modifying the CSS classes defined in the AlertComponent.vue file.

CSS Classes

  • main-alert: Styles the main container of the alert.
  • inner-alert: Styles the inner content of the alert.
  • show: Controls the appearance of the alert when shown.
  • hide: Controls the appearance of the alert when hidden.
  • close-button: Styles the close button of the alert.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Update 0.1.9 changelogs

Add a confirm option

  • Now we can send a confirmatio poup-up just setting some props as we see below comfirm

Also the feedbacks of buttons interactions are true and false:

  • CANCEL = FALSE
  • COMFIRM = TRUE

Update 0.2.0 changelogs

BUGFIX

  • Now the text color passsed by props on customProperties.textColor its set as !important and in the right place

Option to reposition custom close button

  • Now we can put the close button from right-top to the bottom close button

Default vue installation doc

Project setup

npm install

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build

Lints and fixes files

npm run lint

Releases

0.1.9

https://github.com/SoderJuliano/SimpleAlertsVue/releases/tag/0.1.9

0.3.9

  • Now you can import a direct js file fire the alert with no needed insert the SimpleAlert component into your html code;
    • Import as import { showAlert } from 'simple-alerts/dist/showAlert.js'
    • run as ``` showAlert("hello word") ````

Customize configuration

See Configuration Reference.

For deploy new versions

  • npm version patch // for bug fixes
  • npm version minor // for simple new features
  • npm version major // for features that do not have compatibility whith previous code

Deploy on npm

  • npm login
  • manually update version or build may update itself
  • npm run build:npm
  • npm publish