# Ribbon button component

<ribbon-button> has similar functions to XButton, but comparing to Xbutton, ribbon Button has a top-down structure of ICONS and text, and can be used as a Dropdown toggler.

# Code examples

  1. Simple ribbon-button example:

  2. Customize icon

  3. Disabled ribbon-button

  4. Click event handler

  5. Use controller to handle click event

  6. Use controller directive

  7. Nested dropdown component

# API

# Ribbon button properties

Properties Description Type
disabled ribbon-button disabled status boolean
isVisible ribbon-button visibility status boolean

# Methods

Method Description Version
setText(text: String): void Set ribbon-button text. It supports I18n entry. 8.2.0
setIconCls(cssClass: String): void Set icon's css-class of a ribbon-button 8.2.0
disable(): void Disable ribbon-button. The disabled ribbon-button will not respond to the click event 8.2.0
enable(): void Enable ribbon-button. The enabled ribbon-button will respond to the click event 8.2.0
show(): void Show the hidden ribbon-button 8.2.0
hide(): void Hide the ribbon-button 8.2.0
destroy(): void Destroy the ribbon-button component 8.2.0

# Events

Name Description Sample Version
click Click ribbon-button to trigger rbutton.on('click', () => {}) 8.2.0