UNPKG

@ui5/webcomponents-react

Version:

React Wrapper for UI5 Web Components and additional components

29 lines (28 loc) 1.53 kB
'use client'; import '@ui5/webcomponents/dist/RadioButton.js'; import { withWebComponent } from '../../internal/withWebComponent.js'; /** * The `RadioButton` component enables users to select a single option from a set of options. * When a `RadioButton` is selected by the user, the * `change` event is fired. * When a `RadioButton` that is within a group is selected, the one * that was previously selected gets automatically deselected. You can group radio buttons by using the `name` property. * * **Note:** If `RadioButton` is not part of a group, it can be selected once, but can not be deselected back. * * ### Keyboard Handling * * Once the `RadioButton` is on focus, it might be selected by pressing the Space and Enter keys. * * The Arrow Down/Arrow Up and Arrow Left/Arrow Right keys can be used to change selection between next/previous radio buttons in one group, * while TAB and SHIFT + TAB can be used to enter or leave the radio button group. * * **Note:** On entering radio button group, the focus goes to the currently selected radio button. * * * * __Note__: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/) */ const RadioButton = withWebComponent('ui5-radio-button', ['accessibleName', 'accessibleNameRef', 'name', 'text', 'value', 'valueState', 'wrappingType'], ['checked', 'disabled', 'readonly', 'required'], [], ['change']); RadioButton.displayName = 'RadioButton'; export { RadioButton };