Skip to content

Latest commit

 

History

History

ebay-radio

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

EbayRadio

Demo

Storybook

Install

yarn add @ebay/ui-core-react

Usage

Import JS

import { EbayRadio } from '@ebay/ui-core-react/ebay-radio'

Import LESS from SKIN

import "@ebay/skin/radio"

or SCSS/CSS

import '@ebay/skin/radio.css'

EbayRadio with EbayLabel

import { EbayLabel } from '@ebay/ui-core-react/ebay-field';

<EbayRadio value="1" id="radio-1">
    <Ebaylabel>Choice 1</Ebaylabel>
</EbayRadio>

Icons

This component uses SVG icons, so you need to add the <EbaySvg/> component at the end of your html.

Attributes

Name Type Description
disabled boolean Disabled when true
value string The value of radio button component. For the radio checked/unchecked state, please use checked props.
checked boolean Set the radio button state to checked/unchecked. Use this for controlled component.
defaultChecked boolean Set the radio button initial state to checked/unchecked. Use this for uncontrolled component.
size string No

Callbacks

Name Data Description
onChange (ChangeEvent, { value }) Callback fired when selected radio button is changed
onFocus (FocusEvent, { value }) Callback fired when radio button is focused
onKeydown (KeyboardEvent, { value }) Callback fired when key is down

Note: For this component, className/style are applied to the container, while all other HTML attributes are applied to the input.