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

rabbit-simple-ui

v1.8.0

Published

A simple UI component library based on JavaScript

Downloads

43

Readme

English | 简体中文

RabbitUI

A simple UI component library based on JavaScrip

Contributor Covenant

Features

  • Use semantic custom elements for easy resolution

  • Elegant and simple, say goodbye to the huge and bloated dazzling structure

  • Does not rely on any third party framework, the underlying base is native JavaScript, import out of the box

  • Can be used in Vue, jQuery or other existing projects

  • Rich components and features to suit most site scenarios

  • Careful, beautiful UI

  • Documents that are minutiae

Install

  • With NPM, you'll need to use 'TypeScript' and write and use code in TS files. Make sure you understand it and can use it in general
npm install rabbit-simple-ui --save
  • Using a script tag for global use:

Import the file directly in the browser using the script and link tags, and use the global variable Rabbit.

<!--import the style-->
<link rel="stylesheet" href="dist/styles/rabbit.css">
<!--import RabbitUI -->
<script type="text/javascript" src="rabbit.min.js"></script>

Usage

With a CDN we can easily write an example using Rabbit UI:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>RabbitUI demo</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/rabbit-simple-ui/dist/styles/rabbit.css">
</head>
<body>
    <button type="button" class="rab-btn" onclick="show()">Hello Rabbit UI</button>
    <r-modal title="Welcome" id="exampleModal">
       <p>Welcome to RabbitUI</p>
    </r-modal>
</body>
<script src="https://cdn.jsdelivr.net/npm/rabbit-simple-ui/dist/rabbit.min.js"></script>
<script>
    // 初始化modal
    const modal = new Rabbit.Modal();
    show = function() {
        modal.config('#exampleModal').visible = true;  
    }
</script>
</html>

NPM environment

Use NPM to install, enjoy the convenience of the tool, work better with Webpack, and ES2015 is recommended.

import Alert from 'rabbit-simple-ui/src/components/alert';
import Tooltip from 'rabbit-simple-ui/src/components/alert';
import Collapse from 'rabbit-simple-ui/src/components/alert';

new Alert();   
new Tooltip();
new Collapse();  

Using css via import:

import 'rabbit-simple-ui/dist/styles/rabbit.css';

Import as needed

With the help of babel-plugin-import, you can load components on demand and reduce file size. First install and configure it in file '.babelrc ':

npm install babel-plugin-import --save-dev
// .babelrc
{
  "plugins": [["import", {
    "libraryName": "rabbit-simple-ui",
    "libraryDirectory": "src/components"
  }]]
}

Then import the components as needed to reduce the size:

import { Alert, Message } from 'rabbit-simple-ui';

Especially remind

-According to the need to still need to import the reference style that the main js or the root component import 'rabbit-simple-ui/dist/styles/rabbit.css';

Browser Support

Modern browsers and Internet Explorer 10+.

Related links

Contribute

If you wish to participate in contribution, welcome Pull Request or email contact [email protected], the contribution guide has not yet been produced

LICENSE

MIT