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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-html-elements

v1.0.6

Published

A standalone, dependency-free React component library for customizable buttons, toggles, radios, checkboxes, dropdowns, and input fields.

Readme

react-html-elements

A standalone, dependency-free React component library for beautiful, customizable UI controls. Style every component with your own CSS or inline styles - no external libraries required!

✨ Features

  • Button: Multiple variants, fully customizable
  • Toggle Switch: Accessible, color and style support
  • Radio Button: Custom design, flexible styling
  • Checkbox: Modern, themeable
  • Dropdown: Custom select, easy to style
  • Input Field: All input types, style as you wish
  • No dependencies: Only React and your CSS

Note: All JavaScript, CSS, and type declaration files are now available at the package root after install. Import as shown below.

🚀 Installation

npm install react-html-elements

🖼️ SnapShot

react-html-elements


🛠 Usage

Import only what you need:

import { Button, ToggleSwitch, RadioButton, Checkbox, Dropdown, InputField } from 'react-html-elements';

And import the CSS for each component:

import 'react-html-elements/dist/button.css';
import 'react-html-elements/dist/toggle-switch.css';
// ...etc

TypeScript types are also available automatically.


🎨 Dynamic Styling

  • Pass any CSS property via the style prop to any component.
  • Use CSS variables (e.g., --rb-btn-color, --rb-toggle-color) for theme colors.
  • Add your own classes with the className prop for even more control.

🧑‍💻 Sample App Usage

import React, { useState } from 'react';
import { Button, ToggleSwitch, RadioButton, Checkbox, Dropdown, InputField } from 'react-html-elements';
import 'react-html-elements/dist/button.css';
import 'react-html-elements/dist/toggle-switch.css';
import 'react-html-elements/dist/radio-button.css';
import 'react-html-elements/dist/checkbox.css';
import 'react-html-elements/dist/dropdown.css';
import 'react-html-elements/dist/input-field.css';

const options = [
  { label: 'Option 1', value: '1' },
  { label: 'Option 2', value: '2' },
  { label: 'Option 3', value: '3' },
];

function App() {
  const [toggle, setToggle] = useState(false);
  const [radio, setRadio] = useState('1');
  const [checked, setChecked] = useState(false);
  const [dropdown, setDropdown] = useState('');
  const [input, setInput] = useState('');

  return (
    <div style={{ padding: 32 }}>
      <h2>react-html-elements Demo</h2>
      <Button style={{ backgroundColor: '#28a745', color: '#fff', borderRadius: 8 }}>
        Success Button
      </Button>
      <br /><br />
      <ToggleSwitch
        checked={toggle}
        onChange={e => setToggle(e.target.checked)}
        style={{ '--rb-toggle-color': '#ff9800' }}
      />
      <br /><br />
      <RadioButton
        checked={radio === '1'}
        onChange={() => setRadio('1')}
        name="group"
        value="1"
        label="Option 1"
        style={{ '--rb-radio-color': '#e91e63' }}
      />
      <RadioButton
        checked={radio === '2'}
        onChange={() => setRadio('2')}
        name="group"
        value="2"
        label="Option 2"
        style={{ '--rb-radio-color': '#e91e63' }}
      />
      <br /><br />
      <Checkbox
        checked={checked}
        onChange={e => setChecked(e.target.checked)}
        label="Accept terms"
        style={{ '--rb-checkbox-color': '#673ab7' }}
      />
      <br /><br />
      <Dropdown
        options={options}
        value={dropdown}
        onChange={e => setDropdown(e.target.value)}
        placeholder="Select..."
        style={{ '--rb-dropdown-color': '#009688' }}
      />
      <br /><br />
      <InputField
        type="text"
        value={input}
        onChange={e => setInput(e.target.value)}
        placeholder="Type here..."
        style={{ '--rb-input-color': '#3f51b5' }}
      />
    </div>
  );
}

export default App;

🤝 Contributing

Pull requests and issues welcome! Please open an issue to discuss your idea before submitting a PR.


📄 License

MIT


👤 Author

Akshay Bhalala
[email protected]


🏷️ Keywords

react, react-component, button, buttons, ui, ui-kit, toggle, switch, checkbox, radio, dropdown, input, custom-css, no-dependencies, typescript, accessible, themeable, styled, form, select, input-field, npm-package