Socket
Socket
Sign inDemoInstall

@paprika/radio

Package Overview
Dependencies
94
Maintainers
3
Versions
111
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @paprika/radio

Radio component displays a radio input and label text beside it. When clicked it selects the input and deselects any other radio input in its group


Version published
Weekly downloads
1.1K
decreased by-11.85%
Maintainers
3
Created
Weekly downloads
 

Readme

Source

@paprika/radio

Description

Radio component displays a radio input and label text beside it. When clicked it selects the input and deselects any other radio input in its group

Installation

yarn add @paprika/radio

or with npm:

npm install @paprika/radio

Props

Radio

PropTyperequireddefaultDescription
a11yTextstringfalsenullUsed for aria-label on the radio input
canDeselectboolfalsefalseDescribe if the radio started as selected or not
childrennodefalsenullUsed for label contents
isCheckedboolfalsefalse
isDisabledboolfalsefalseDescribe if the radio is disabled or not
defaultIsCheckedboolfalsefalseDescribe if the radio started as checked or not
namestringfalse""Name provided for accessibility
onClickcustomfalse() => {}onClick provided by parent Group component
size[ Radio.types.size.SMALL, Radio.types.size.MEDIUM, Radio.types.size.LARGE]falseRadio.types.size.MEDIUMSize provided by parent Group component
tabIndex[number,string]false0Value for tabindex attribute to override the default of 0.
valuestringfalse""Value applied to the input if needed.

Radio.Group

PropTyperequireddefaultDescription
canDeselectboolfalsefalseCan deselect any radio
childrennodefalsenullThe individual radio items.
isDisabledboolfalsefalseAre all radios disabled
onChangefunctrue-On change of radio selection.
size[ Radio.types.size.SMALL, Radio.types.size.MEDIUM, Radio.types.size.LARGE]falseRadio.types.size.MEDIUMThe size for all radio components.

Usage

import Radio from "@paprika/radio";

<Radio.Group
  onChange={activeIndex => {
    // get values from the data using index
  }}
>
  <Radio>Radio 1</Radio>
  <Radio>Radio 2</Radio>
  <Radio>Radio 3</Radio>
  <Radio>Radio 4</Radio>
</Radio.Group>;
  • Storybook Showcase
  • GitHub source code
  • Create GitHub issue
  • CHANGELOG

FAQs

Last updated on 22 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc