🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@leafygreen-ui/radio-group

Package Overview
Dependencies
Maintainers
0
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/radio-group

leafyGreen UI Kit RadioGroup

latest
Source
npmnpm
Version
13.0.11
Version published
Weekly downloads
48K
42.79%
Maintainers
0
Weekly downloads
 
Created
Source

Radio Group

npm (scoped)

View on MongoDB.design

Installation

PNPM

pnpm add @leafygreen-ui/radio-group

Yarn

yarn add @leafygreen-ui/radio-group

NPM

npm install @leafygreen-ui/radio-group

Example

import { Radio, RadioGroup } from '@leafygreen-ui/radio-group';

<RadioGroup
  className="my-radio-group"
  variant="default"
  onChange={event => console.log('hi')}
  value="option-1"
  name="name-of-input-group"
>
  <Radio className="my-radio" value="option-1">
    Label Text Goes Here
  </Radio>
</RadioGroup>;

Properties

PropTypeDescriptionDefault
darkModebooleanDetermines whether or not the component appears in dark modefalse
namestringSets the name of the input group
valuestring, numberSets the radio that will appear checked on page load, also makes the component a controlled component
classNamestringAdds a className to the root element.''
onChangefunctionThe event handler function for the 'onchange' event. Receives the associated event object as the first argument.() => {}
childrennodeCan be any node; however, any <Radio /> components, will be treated as belonging to the <RadioGroup /> compound component, and will receive internal state from <RadioGroup />
size'xsmall', 'small', 'default'Sets the size for the Radios. Use of xsmall should be limited to only Chartsdefault

Any other properties will be spread on the root element.

Radio

Example

<Radio className="my-radio" value="option-1" disabled={true}>
  Label Text Goes Here
</Radio>

Properties

PropTypeDescriptionDefault
value (Required)string, numberEvery <Radio /> needs a value prop.
classNamestringAdds a className to the label''
disabledbooleanIndicates whether or not the radio can be clicked by a userfalse
childrennodeText that appears adjacent to the radio input; label text.
defaultbooleanIf <RadioGroup /> is uncontrolled, the default property makes this Radio checked on the initial render.
checkedbooleanDetermines if <Radio /> will appear checkedfalse
...native input attributesAny other props will be spread on the root input element

FAQs

Package last updated on 24 Nov 2025

Did you know?

Socket

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