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 🙏

© 2026 – Pkg Stats / Ryan Hefner

radon-css

v1.0.0

Published

Radon is a lightweight version of Radium. It has no dependencies, does not require React, and is very very small. ("Fun" fact: Radon, the gas, is the product of Radium decay).

Downloads

11

Readme

Radon CSS. Miniature DIY Radium

Radon is a lightweight version of Radium. It has no dependencies, does not require React, and is very very small. ("Fun" fact: Radon, the gas, is the product of Radium decay).

Radium is a cool library for React which lets you use style objects in clever ways, inside of your react code. However Radium is really built for class based components, and is not particularly lightweight - it handles its own state, overrides the render method, and injects hooks onto your react elements to manage states like hover. Radon CSS (this package) attempts to take Radium's pattern, and apply it in the simplest way possible.

With Radon CSS, simply specify your Style object - as a set of top level keys, which represent your elements, each one containing a sub-level of states for that element. You'll get back a function which can bind to those elements, and in turn merge a set of states into one style object... it's better said with code:

const radon = require('radon-css');

const styles = radon({
  base: {
    margin: 10,
    padding: 10,
    background: '#ccc',
  },
  primary: {
    background: '#0074D9'
  },

  warning: {
    background: '#FF4136'
  }
})

// Call the function to get the base styles
expect(styles()).to.eql({ margin: 10, padding: 10, background: '#ccc' });

// Call with a state to get a merged style object
expect(styles('primary')).to.eql({ margin: 10, padding: 10, background: '#0074D9' });
expect(styles('warning')).to.eql({ margin: 10, padding: 10, background: '#FF4136' });

// Can call with multiple states, order matters!
expect(styles('primary', 'warning')).to.eql({ margin: 10, padding: 10, background: '#FF4136' });
expect(styles('warning', 'primary')).to.eql({ margin: 10, padding: 10, background: '#0074D9' });

// States could be an object of true/false keys!
expect(styles({ warning: false, primary: true })).to.eql({ margin: 10, padding: 10, background: '#0074D9' });
expect(styles({ warning: true })).to.eql({ margin: 10, padding: 10, background: '#FF4136' });

This is all Radon does, so if you want to add pseudo interactivity styles, which Radium does out of the box, then it is up to you to do so manually! It is relatively simple to do so:

import React, { Component } from 'react';
import radon from 'radon';
const MyButtonStyles = radon({
  base: {
    border: '2px solid #ccc',
  },
  hover: {
    border: '2px solid #aaa'
  },
  focus: {
    border: '2px solid #333'
  }
})
class MyButton extends Component {

  constructor() {
    super(arguments);
    this.state = { hover: false, focus: false }
  }

  render() {
    return (
      <div
        style={MyButtonStyles(this.state)}
        onMouseEnter={() => this.setState({hover: true})}
        onMouseLeave={() => this.setState({hover: false})}
        onFocus={() => this.setState({focus: true})}
        onBlur={() => this.setState({focus: false})}
      >
      My Element
      </div>
    )
  }

}