MCPcopy Index your code
hub / github.com/UI5/webcomponents / Button

Class Button

packages/main/src/Button.ts:109–773  ·  view source on GitHub ↗

* @class * * ### Overview * * The `ui5-button` component represents a simple push button. * It enables users to trigger actions by clicking or tapping the `ui5-button`, or by pressing * certain keyboard keys, such as Enter. * * ### Usage * * For the `ui5-button` UI, you can define text, ic

Source from the content-addressed store, hash-verified

107 * @public
108 */
109@customElement({
110 tag: "ui5-button",
111 formAssociated: true,
112 languageAware: true,
113 renderer: jsxRenderer,
114 template: ButtonTemplate,
115 styles: buttonCss,
116 shadowRootOptions: { delegatesFocus: true },
117})
118/**
119 * Fired when the component is activated either with a mouse/tap or by using the Enter or Space key.
120 *
121 * **Note:** The event will not be fired if the `disabled` property is set to `true`.
122 *
123 * @since 2.10.0
124 * @public
125 * @param {Event} originalEvent Returns original event that comes from user's **click** interaction
126 * @param {boolean} altKey Returns whether the "ALT" key was pressed when the event was triggered.
127 * @param {boolean} ctrlKey Returns whether the "CTRL" key was pressed when the event was triggered.
128 * @param {boolean} metaKey Returns whether the "META" key was pressed when the event was triggered.
129 * @param {boolean} shiftKey Returns whether the "SHIFT" key was pressed when the event was triggered.
130 */
131@event("click", {
132 bubbles: true,
133 cancelable: true,
134})
135/**
136 * Fired whenever the active state of the component changes.
137 * @private
138 */
139@event("active-state-change", {
140 bubbles: true,
141 cancelable: true,
142})
143class Button extends UI5Element implements IButton {
144 eventDetails!: {
145 "click": ButtonClickEventDetail,
146 "active-state-change": void,
147 };
148
149 /**
150 * Defines the component design.
151 * @default "Default"
152 * @public
153 */
154 @property()
155 design: `${ButtonDesign}` = "Default";
156
157 /**
158 * Defines whether the component is disabled.
159 * A disabled component can't be pressed or
160 * focused, and it is not in the tab chain.
161 * @default false
162 * @public
163 */
164 @property({ type: Boolean })
165 disabled = false;
166

Callers

nothing calls this directly

Calls 5

customElementFunction · 0.85
propertyFunction · 0.85
i18nFunction · 0.85
eventFunction · 0.50
slotFunction · 0.50

Tested by

no test coverage detected