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

@wedgekit/radio

v3.3.3

Published

## Purpose

Downloads

11

Readme

Radio

Purpose

A component which allows a user to pick a single option from a short list of options.

Usage

To use the radio component, a developer needs to import both RadioGroup and Radio from @wedgekit/radio

import { Radio, RadioGroup } from '@wedgekit/radio';

const Example = () => {
  const [value, setValue] = React.useState('');

  return (
    <RadioGroup
      onChange={(v) => setValue(v)}
      label="Go on, choose one!"
      name="starter"
      value={value}
    >
      <Radio value="charmander" label="Charmander" />
      <Radio value="squirtle" label="Squirtle" />
      <Radio value="bulbasaur" label="Bulbasaur" />
    </RadioGroup>
  );
};

render(<Example />);

Props

Radio

label

Type: String

Required: ✅

A string label to indicate what the radio input is for. Required on all Wedgekit inputs for A11y.

value

Type: string | number

Required: ✅

The value of the radio when used in a group

checked

Type: boolean

Required: ❌

Indicated whether or not the radio is checked

disabled

Type: boolean

Required: ❌

id

Type: string | number

Required: ❌

A unique identifier for the input to both associate the input with its label, as well as provide an identifier on the callback. If not provided, then one will be generated.

labelHidden

Type: boolean

Required: ❌

Boolean for indicating if the label should be visible or not

name

Type: String

Required: ❌

A name to associate that radio with a group

ref

Type: React.Ref

Required: ❌

The ref giving a user access to the underlying HTML button.

status

Type: 'default' | 'error' | 'success' | 'pending'

Required: ❌

Indicates form validation status for styling purposes

tabIndex

Type: number

Required: ❌

Property used to disjoint tabbability

onBlur

Type: (e: React.SyntheticEvent) => void

Required: ❌

Optional callback that is fired on a radio's selection

onChange

Type: (e: React.SyntheticEvent) => void

Required: ❌

Optional callback that is fired on a radio's selection

onFocus

Type: (e: React.SyntheticEvent) => void

Required: ❌

Optional callback that is fired on a radio's selection

RadioGroup

children

Type: React.ReactElement[]

Required: ✅

label

Type: String

Required: ✅

A string label for the radio group

name

Type: String

Required: ✅

A string name for the entire group of radios that allows native radio group behavior

value

Type: string | number

Required: ✅

Value of the selected radio

onChange

Type: (selectedValue: string | number) => void

Required: ✅

className

Type: string

Required: ❌

This is exposed but is only here so that styled-components will be able to style components correctly. Please do not use this unless you really know what you are doing.

disabled

Type: boolean

Required: ❌

Optional prop to disabled the entire group

info

Type: { title: string, content?: string, link? { url: string, label: string } }

Required: ❌

Optional information to populate an info popup

labelHidden

Type: boolean

Required: ❌

Boolean for indicating if the label should be visible or not

ref

Type: React.Ref

Required: ❌

The ref giving a user access to the underlying HTML button.

required

Type: boolean

Required: ❌

A boolean denoting whether a selection within the group is required

status

Type: 'default' | 'error' | 'success' | 'pending'

Required: ❌

Indicates form validation status for styling purposes

tabIndex

Type: number

Required: ❌

Property used to disjoint tabbability

onBlur

Type: (e: React.SyntheticEvent) => void

Required: ❌

onFocus

Type: (e: React.SyntheticEvent) => void

Required: ❌