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

@reliability-design/react

v1.0.2

Published

React wrappers for Reliability Design web components

Readme

@reliability-design/react

React wrapper components for Reliability Design web components.

Installation

npm install @reliability-design/react

Usage

Basic Example

import { Button, Textfield, Card } from '@reliability-design/react';

function App() {
  return (
    <Card>
      <Textfield label="Username" placeholder="Enter your name" />
      <Button variant="primary">Submit</Button>
    </Card>
  );
}

Form Controls with State

React wrapper components provide event handlers that work seamlessly with React state:

import { useState } from 'react';
import { Textfield, Checkbox, Select, Switch, Slider } from '@reliability-design/react';

function FormExample() {
  const [username, setUsername] = useState('');
  const [accepted, setAccepted] = useState(false);
  const [country, setCountry] = useState('');
  const [enabled, setEnabled] = useState(false);
  const [volume, setVolume] = useState(50);

  return (
    <>
      <Textfield 
        value={username}
        onInputChange={(e) => setUsername(e.value)}
        label="Username"
      />
      
      <Checkbox
        status={accepted ? 'checked' : 'unchecked'}
        onChange={(e) => setAccepted(e.status === 'checked')}
        label="Accept Terms"
      />
      
      <Select
        selected={country}
        onChange={(e) => setCountry(e.value)}
        label="Country"
      />
      
      <Switch
        checked={enabled}
        onChange={(e) => setEnabled(e.checked)}
      />
      
      <Slider
        value={volume}
        onInput={(e) => setVolume(e.value)}
        min={0}
        max={100}
      />
    </>
  );
}

Event-Driven Components

import { useState } from 'react';
import { Tab, Accordion, Toast } from '@reliability-design/react';

function EventExample() {
  const [activeTab, setActiveTab] = useState(0);
  const [expanded, setExpanded] = useState(false);

  return (
    <>
      <Tab 
        selected={activeTab} 
        onTabChange={(e) => setActiveTab(e.index)}
      >
        <div slot="tab">Tab 1</div>
        <div slot="panel">Panel 1</div>
      </Tab>

      <Accordion
        expanded={expanded}
        onToggle={(e) => setExpanded(e.expanded)}
      >
        <div slot="header">Click to expand</div>
        <div slot="content">Hidden content</div>
      </Accordion>

      <Toast
        message="Operation successful"
        onDismissed={() => console.log('Toast dismissed')}
        onAction={() => console.log('Action clicked')}
      />
    </>
  );
}

Accessing Web Component Instance

Use React refs to access the underlying web component:

import { useRef } from 'react';
import { Textfield } from '@reliability-design/react';

function RefExample() {
  const textfieldRef = useRef<HTMLElement>(null);

  const focusInput = () => {
    textfieldRef.current?.focus();
  };

  return (
    <>
      <Textfield ref={textfieldRef} label="Focus me" />
      <button onClick={focusInput}>Focus Input</button>
    </>
  );
}

Component Categories

Form Controls (6)

  • <Textfield /> - Text input with onInputChange event
  • <Select /> - Select dropdown with onChange event
  • <Checkbox /> - Checkbox with onChange event
  • <Radio /> - Radio button with onChange event
  • <Switch /> - Toggle switch with onChange event
  • <Slider /> - Range slider with onInput event

Event-Driven Components (7)

  • <Tab /> - Tab navigation with onTabChange
  • <Menu /> - Menu with onMenuItemClick
  • <Accordion /> - Expandable sections with onToggle
  • <Chip /> - Removable chips with onRemoved
  • <Toast /> - Toast notifications with onDismissed, onAction
  • <Snackbar /> - Snackbar messages with onDismissed, onAction
  • <Stepper /> - Step wizard with onStepChange

Passive Components (13)

  • <Button /> - Button
  • <Avatar /> - User avatar
  • <Badge /> - Notification badge
  • <Card /> - Card container
  • <CardMedia /> - Card media
  • <Container /> - Layout container
  • <Divider /> - Visual divider
  • <Layout /> - Flexbox layout
  • <Progress /> - Progress indicator
  • <Breadcrumb /> - Breadcrumb navigation
  • <Alert /> - Alert messages
  • <SegmentedButton /> - Segmented button group
  • <Tooltip /> - Tooltip overlay

Creating Custom Wrappers

You can create your own React wrappers for custom web components:

import { createComponent } from '@reliability-design/react';

interface MyComponentProps {
  value?: string;
  onChange?: (detail: { value: string }) => void;
}

export const MyComponent = createComponent<MyComponentProps>({
  tagName: 'my-custom-element',
  events: {
    onChange: 'custom-change-event',
  },
});

Architecture

This package provides React wrapper components that:

  • Forward all props as attributes/properties to web components
  • Map CustomEvents to React event handlers
  • Support ref forwarding to access underlying web component instances
  • Automatically register web components on import
  • Work with React 16.8+ (hooks support required)

TypeScript Support

All components are fully typed with TypeScript definitions for props and event handlers.

License

MIT