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

react-threede-buttons

v1.0.0

Published

A customisable React component for 3D buttons

Downloads

4

Readme

< ThreeButtons />

MIT airbnb

<ThreeButtons /> is a customisable React component that renders animated 3D buttons

alt

Installation

$ npm install React-Three-Buttons

Components

import { ThreeButton, LoaderButton, SocialButton } from 'react-threebuttons';

Styles

sass

@import '/node_modules/react-threebuttons/dist/styles.css'

js

import 'react-threebuttons/dist/styles.css'

Usage

<ThreeButton text="press" type="press" size="large" styles={My_style_object} />
<SocialButton type="instagram" size="large" styles={My_style_object} />
<LoaderButton text="progress" size="large" styles={My_style_object} />

Or with a pre made theme

import { ThreeButton, LoaderButton, SocialButton, Theme } from 'threebuttons';
<Theme theme="blue-light">
  <ThreeButton text="press" type="press" size="large" />
  <ThreeButton text="visible text" type="slide" slideText="hidden text" size="large" />
  <ThreeButton text="hover me" type="hover" size="large" />
  <ThreeButton text="click me" type="click" size="large" />
  <LoaderButton text="progress" size="large" />
  <LoaderButton text="async progress"type="async" async={{uri: 'https://yrgo.github.io/api/movies/mean-girls.json', callback, errorCallback, parseJson: true}}  size="large"/>
</Theme>

Props

ThreeButton

| Attributes | Type | Default | Description | Options | ------------- |:-------------:| -----: | :---------- | :---------- | Text | string | button | The text to be displayed on the button | null | slideText | String | null | text behind the slide type button | null | Type | string | Press | The animation of the button | press, slide, 3d, click | Size | String | Medium | The size of the button | small, medium, large | Styles | Object | see below | the custom styles of the button | backgroundColor, padding, fontSize, border | Icon | String | null | A icon from fontAwesome | fontAwesome | handleClick | function | null | callback to fire when clicked | null | disabled | boolean | false | disable all click events and greyscales the button | true, false | ripple | boolean | true | ripple effect when clicked | true, false

Default styles

{
    backgroundColor: 'rgb(31, 65, 167)',
    padding: 16,
    fontSize: '',
    border: 'defaults to backgroundColor',
}

SocialButton

| Attributes | Type | Default | Description | Options | ------------- |:-------------:| -----: | :---------- | :---------- | Text | string | facebook | The text to be displayed on the button | null | Type | string | facebook | The type of social media | facebook, facebook-dark, instagram, linkedin, twitter, github, reddit, mail, google-plus, pinterest, youtube | Size | String | Medium | The size of the button | small, medium, large | Click | String | press | The animation of the button | press, 3d | Link | String | '' | anchor link of the button | null | Styles | Object | see below | the custom styles of the button |padding, fontSize,

Default styles

{
   padding: 16,
   fontSize: '',
}

LoaderButton

| Attributes | Type | Default | Description | Options | ------------- |:-------------:| -----: | :---------- | :---------- | Text | string | Button | The text to be displayed on the button | null | Type | string | sync | type of loader | sync, async | Size | String | Medium | The size of the button | small, medium, large | Styles | Object | see below | the custom styles of the button | backgroundColor, padding, fontSize, border | loadingLabel | String | hang on | text while loading | null | loadedLabel | String | success | text when loaded| null | Duration | String | '1000ms' | The loading time | null | Styles | Object | see below | the custom styles of the button |padding, fontSize, backgroundColor, border | callback | function | () => {} | callback to fire when completed load | null | async | object | undefined | config for the async call | se below | disabled | boolean | false | disable all click events and greyscales the button | true, false

async example

const myAsyncConfig = {
    uri: 'https://mysite/api/data.json',
    callback: (jsonData) => (console.log(jsonData)),
    errorCallback: (err) => {console.log(err)},
    parseJson: true,
}
<LoaderButton type="async" text="my async loader" async={myAsyncConfig}

Default styles

{
    backgroundColor: 'rgb(31, 65, 167)',
    padding: 16,
    fontSize: '',
    border: 'defaults to backgroundColor',
}

Author

Andreas Nordh

You get a button! You get a button! Everybody gets a button

</ ThreeButtons>