yarn add @ebay/ui-core-react
import { EbayRadio } from '@ebay/ui-core-react/ebay-radio'
import "@ebay/skin/radio"
import '@ebay/skin/radio.css'
import { EbayLabel } from '@ebay/ui-core-react/ebay-field';
<EbayRadio value="1" id="radio-1">
<Ebaylabel>Choice 1</Ebaylabel>
</EbayRadio>
This component uses SVG icons, so you need to add the <EbaySvg/>
component at the end of your html.
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 |
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.