@ui5/webcomponents-react
Version:
React Wrapper for UI5 Web Components and additional components
20 lines (19 loc) • 1.23 kB
JavaScript
'use client';
import { withWebComponent } from '@ui5/webcomponents-react-base';
/**
* The `ToggleButton` component is an enhanced `Button`
* that can be toggled between pressed and normal states.
* Users can use the `ToggleButton` as a switch to turn a setting on or off.
* It can also be used to represent an independent choice similar to a check box.
*
* Clicking or tapping on a `ToggleButton` changes its state to `pressed`. The button returns to
* its initial state when the user clicks or taps on it again.
* By applying additional custom CSS-styling classes, apps can give a different style to any `ToggleButton`.
*
*
*
* __Note:__ This is a UI5 Web Component! [ToggleButton UI5 Web Component Documentation](https://ui5.github.io/webcomponents/components/ToggleButton) | [Repository](https://github.com/UI5/webcomponents)
*/
const ToggleButton = withWebComponent('ui5-toggle-button', ['accessibilityAttributes', 'accessibleDescription', 'accessibleName', 'accessibleNameRef', 'accessibleRole', 'design', 'endIcon', 'form', 'icon', 'loadingDelay', 'tooltip', 'type'], ['disabled', 'loading', 'pressed', 'submits'], ['badge'], ['click']);
ToggleButton.displayName = 'ToggleButton';
export { ToggleButton };