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

@trendmicro/react-buttons

v1.3.1

Published

Trend Micro Components: React Buttons

Downloads

14,624

Readme

react-buttons build status Coverage Status

NPM

React Buttons component.

Demo: https://trendmicro-frontend.github.io/react-buttons

Installation

  1. Install the latest version of react and react-buttons:
npm install --save react @trendmicro/react-buttons
  1. At this point you can import @trendmicro/react-buttons and its styles in your application as follows:
import { Button, ButtonGroup, ButtonToolbar } from '@trendmicro/react-buttons';

// Be sure to include styles at some point, probably during your bootstraping
import '@trendmicro/react-buttons/dist/react-buttons.css';

Recommended Setup

Create a Buttons component inside your common components directory:

components/
  Buttons/
    index.js

components/Buttons/index.js

import '@trendmicro/react-buttons/dist/react-buttons.css';

export { Button, ButtonGroup, ButtonToolbar } from '@trendmicro/react-buttons';

Then, import Button component in your code:

import { Button } from './components/Buttons';

Usage

Button Styles

<Button btnStyle="default">Default</Button>
<Button btnStyle="primary">Primary</Button>
<Button btnStyle="emphasis">Emphasis</Button>
<Button btnStyle="danger">Danger (Alias of Emphasis)</Button>
<Button btnStyle="flat">Flat</Button>
<Button btnStyle="border">Border (Alias of Flat)</Button>
<Button btnStyle="link">Link</Button>

Button Sizes

<Button btnSize="lg">Large</Button>
<Button btnSize="large">Large</Button>
<Button btnSize="md">Medium</Button>
<Button btnSize="medium">Medium</Button>
<Button btnSize="sm">Small</Button>
<Button btnSize="small">Small</Button>
<Button btnSize="xs">Extra Small</Button>
<Button btnSize="extra-small">Extra Small</Button>

Button States

<Button>Normal</Button>
<Button hover>Hover</Button>
<Button active>Active</Button>
<Button focus>Focus</Button>
<Button disabled>Disabled</Button>

Block Buttons (Full-width Buttons)

<Button block>Block Button</Button>

Button Groups

Default button group

<ButtonGroup>
    <Button active>Left</Button>
    <Button>Middle</Button>
    <Button>Right</Button>
</ButtonGroup>
<ButtonGroup>
    <Button compact><i className="fa fa-pencil" /></Button>
    <Button compact><i className="fa fa-mail-reply" /></Button>
</ButtonGroup>

Flat button group

<ButtonGroup btnStyle="flat" btnSize="md">
    <Button active>Left</Button>
    <Button>Middle</Button>
    <Button>Right</Button>
</ButtonGroup>
<ButtonGroup btnStyle="flat" btnSize="md">
    <Button compact><i className="fa fa-pie-chart" /></Button>
    <Button compact><i className="fa fa-line-chart" /></Button>
    <Button compact><i className="fa fa-table" /></Button>
</ButtonGroup>

Vertical button group

<ButtonGroup vertical>
    <Button>Top</Button>
    <Button>Middle</Button>
    <Button>Bottom</Button>
</ButtonGroup>

Button Toolbar

<ButtonToolbar>
    <ButtonGroup>
        <Button>Button Group 1</Button>
        <Button>Button Group 1</Button>
    </ButtonGroup>
    <ButtonGroup>
        <Button>Button Group 2</Button>
        <Button>Button Group 2</Button>
    </ButtonGroup>
</ButtonToolbar>

Button (w/ Icon)

Static (default)

<Button>
    <i className="fa fa-download" />
    Download
</Button>
<Button btnStyle="primary">
    <i className="fa fa-plus" />
    Add Account
</Button>

Progressing

<Button disabled>
    <i className="fa fa-circle-o-notch fa-spin" />
    Uploading
</Button>
<Button btnStyle="primary" disabled>
    <i className="fa fa-circle-o-notch fa-spin" />
    Uploading
</Button>

Static (flat)

<Button btnStyle="flat">
    <i className="fa fa-pencil fa-fw" />
    Edit
</Button>
<Button btnStyle="flat">
    <i className="fa fa-trash-o fa-fw" />
    Delete
</Button btnStyle="flat">
<Button>
    <i className="fa fa-book fa-fw" />
    Library
</Button>

Compact

<Button compact>
    <i className="fa fa-comment" />
</Button>
<Button btnStyle="primary" compact>
    <i className="fa fa-plus" />
</Button>
<Button btnStyle="emphasis" compact>
    <i className="fa fa-search" />
</Button>
<Button btnStyle="flat" compact>
    <i className="fa fa-cog" />
</Button>

API

Properties

Button

Name | Type | Default | Description :--- | :--- | :------ | :---------- componentClass | Function or String | 'button' | type | One of:'button''reset''submit' | 'button' | btnSize | One of:'lg''md''sm''xs''large''medium''small''extra-small' | 'md' | btnStyle | One of:'default''primary''danger''emphasis''border''flat''link' | 'default' | active | Boolean | false | hover | Boolean | false | focus | Boolean | flase | disabled | Boolean | flase | block | Boolean | false | compact | Boolean | false |

ButtonGroup

Name | Type | Default | Description :--- | :--- | :------ | :---------- btnSize | One of:'lg''md''sm''xs''large''medium''small''extra-small' | | btnStyle | One of:'default''primary''danger''emphasis''border''flat''link' | | vertical | Boolean | false |

ButtonToolbar

Name | Type | Default | Description :--- | :--- | :------ | :----------

License

MIT