GithubHelp home page GithubHelp logo

marcroelans / ui-notification Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 347 KB

📫 Simple ui-notification vanilla js component.

Home Page: https://neulandagentur.github.io/ui-notification/

License: MIT License

HTML 13.20% JavaScript 7.50% CSS 79.30%

ui-notification's Introduction


Ui-Notification is a simple vanilla js component for simple messages in the browser.

Install / Import

via npm

Install the package

npm i ui-notification --save
import { init as UiNotifcationInit } from 'ui-notification';

via script

Download the file ui-notification.js in the js/dist/ folder and place it into your html file.

...
<body>

  ...
  <script src="ui-notification.js"></script>
  <script>
    // use here
  </script>

</body>

API

To create a notifcation component you just need to call the init function. There are three arguments. Title and subtitle needs to be passes into the function. The third one is an optional argument. Here you can pass your options. It returns the created prototype inheritance.

init(title <String>, subtitle <String>, config <Object>)

Here is an example with every available option with its default value.

  init(
    'Hello World',
    'This is a cool component',
    {
      root: document.querySelector('body'), // can be any html element
      shadow: false, // true | false
      closable: true, // true | falsses
      duration: null, // Number > 0 | null
      shouldDestroy: true, // true | false
    }
  );

ui-notification's People

Contributors

janmarkuslanger avatar kraemer64 avatar alexprediger avatar naitszox avatar marcroelans avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.