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-ratchet

v0.5.0

Published

Ratchet, rebuilt for React

Downloads

4

Readme

react-ratchet

React components for the Ratchet UI Library

Used to build Hacker News Mobile:

Hacker News Mobile

Documentation

Title

@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var Title = require('react-ratchet').Title;
class MyTitle extends React.Component {
  render() {
    return <Title>Hello World!</Title>
  }
}

NavBar

@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var NavBar = require('react-ratchet').NavBar;
class MyNavBar extends React.Component {
  render() {
    return (
        <NavBar>
            <Title>Hello World!</Title>
        </NavBar>
    );
  }
}

NavButton

@prop [right] {Boolean} The side of the nav the button will be displayed
@prop [href] {String} If defined creates an anchor, else defaults to a button
@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var NavButton = require('react-ratchet').NavButton;
class MyNavButton extends React.Component {
  render() {
    return (
        <NavButton right href='./next'>
            Next
        </NavButton>
    );
  }
}

TableView

@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var TableView = require('react-ratchet').TableView;
var TableViewCell = require('react-ratchet').TableViewCell;
class MyTableView extends React.Component {
  render() {
    return (
        <TableView>
            <TableViewCell>My</TableViewCell>
            <TableViewCell>React</TableViewCell>
            <TableViewCell>Ratchet</TableViewCell>
            <TableViewCell>Table</TableViewCell>
        </TableView>
    );
  }
}

TableViewCell

@prop [divider] {Boolean} Renders a divider cell
@prop [navigateRight] {Boolean} Right-wards chevron 
@prop [navigateLeft] {Boolean} Left-wards chevron
@prop [href] {String} Assigns the given href to the child anchor
@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var TableViewCell = require('react-ratchet').TableViewCell;
class MyTableViewCell extends React.Component {
  render() {
    return <TableViewCell>Hello World!</TableViewCell>
  }
}

Button

@prop [block] {Boolean} A block button
@prop [outlined] {Boolean} An outlined button
@prop [rStyle] {String} One of the btn-* CSS classes
@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var Button = require('react-ratchet').Button;
class MyButton extends React.Component {
  render() {
    return <Button block rStyle='positive'>Hello World!</Button>
  }
}

Badge

@prop [inverted] {Boolean} An inverted badge
@prop [rStyle] {String} One of the badge-* CSS classes
@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var Badge = require('react-ratchet').Badge;
class MyBadge extends React.Component {
  render() {
    return <Badge rStyle='primary' inverted>42</Badge>
  }
}

Icon

@prop [...] {Boolean} Any defined boolean prop will be taken for the icon name
@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var Icon = require('react-ratchet').Icon;
class MyIcon extends React.Component {
  render() {
    return <Icon star-filled />
  }
}

Toggle

@prop [active] {Boolean} Set the toggle to active
@prop [onToggle] {Function} Called when the toggle is toggled, with the new 
active state as the only argument
@prop [className] {String} Merges with the Ratchet predefined CSS classes

Example:

var Toggle = require('react-ratchet').Toggle;
class MyToggle extends React.Component {
  constructor(props) {
    super(props)
    this.state = {active: false}
  }

  render() {
    return (
      <Toggle
        active={this.state.active}
        onToggle={(active) => this.setState({active})}
      />
    )
  }
}