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

rb-buttons

v1.0.1

Published

react-basics button component

Downloads

2

Readme

Buttons - React Basics

A React Basics Buttons component. Stateless, fully optimized with css animations, highly customizable and Mobile support.

Installation

Into your project's root directory run the following command:

npm

npm i -P rb-buttons

Yarn

yarn add rb-buttons

This package only has 1 dependencies:

Example

Buttons is one of the components inside React Basics, so if you want test it, go https://edgravill.github.io/react-basics and see it working.

The website is under construction

Usage

Component constantly changes its width, so it's recommendable put inside div container to control its position.

import React from 'react';
import Button from 'rb-buttons';

const Index = ({
  fetching,
  sendComment,
}) => (
  <div>
    <textarea id="comment" />
    <div className="buttonContainer">
      <Button
        active={!fetching}
        loading={fetching}
        onClick={() => sendComment(document.getElementById('comment'))}
        text="Enviar"
      />
    </div>
  </div>
);

API

|Prop|Required|Type|Default|Description| |----|--------|----|-------|-----------| |active|false|boolean|true|Prop who determines if button catch click action.| |loaded|false|boolean|false|Prop who determines if loading finish.| |loadedStyle|false|Object|{}|Button style when "loaded" prop is true.| |loadedText|false|string|''|Text to display in button when "loaded" prop is true. Only works in 'filler' or 'text' loading type.| |loading|false|boolean or number|false|Prop who determines if loading animation start. If loading type is 'filler' this prop also take a number between 0 an 1 to handle loading %.| |loadingStyle|false|Object|{}|Button style when "loading" prop is true.| |loadingText|false|string|''|Text to display in button when "loading" prop is true. Only works in 'filler' or 'text' loading type.| |loadingType|false|Enum: 'spinner', 'textSpinner', 'filler', 'text'|'spinner'|Type of loading animation. See Loading Types description below.| |onClick|true|Function|undefined|Function to perform when user click the button.| |style|false|Object|{}|Style of the button when is normal.| |text|true|string|undefined|Default text to display in the button. If "loadedText" or "loadingText" props are undefined or empty this text will be displayed.|

loadingTypes

spinner

The buttom becomes in a spinner circle

textSpinner

The buttom keep its shape, but the text becomes in a spinner circle

filler

Alfa white layer fill the buttom

text

There is no animation, only changes the display text if is loading and when is loaded

Goals

  • [ ] Integration with icons (Under develop).
  • [ ] Slide icon for confirm or perform any action.

looking for more? - Do a pull request with your proposals ;)

Collaborators

  • Eduardo Grajales Villanueva @EdGraVill

If you want to collaborate with this or another exist or new component inside React Basics, first do a pull request and then email me: [email protected]

If you want pull request some changes, don't forget build it firt with the following command:

npm

npm run build

Yarn

yarn build

Once you're a collaborator don't forget 3 rules:

  1. Version are Mayor (If APIs are deleted or create new one) . Medium (If APIs changes without changing name) . Minimum (If do some hotfix, change Documentation or develop configurations). This is because all 1.x.x are compatible, but are incompatible with 2.x.x
  2. Build a great components and do the best documentation as you can.
  3. Share with your developer friends. It would be useful for them.

Don't forget join discussion on Slack

License

MIT License

Copyright (c) 2018 Eduardo Grajales Villanueva

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.