CycleButtonΒΆ

/libs/granite/ui/components/coral/foundation/cyclebutton

A component that show the current active item. Only one item can be active at the same time. When clicked, the next item of the active is activated. If the last item is clicked, then the first item is activated.

It has the following content structure:

granite:CycleButton
  1. granite:commonAttrs
  2. granite:renderCondition
  3. granite:container
displayModestring
  1. icon
  1. icon
  2. text
  3. icontext

The display mode of the cycle button:

icon
Icon display mode
text
Text display mode
icontext
Icon and text display mode
variantstring
  1. actionBar

The variant of the cycle button.

Each item has the following structure:

granite:CycleButtonItem
  1. granite:commonAttrs
  2. granite:renderCondition
selectedboolean

true to pre-select this item, false otherwise.

textstring
i18n

The text of the item.

text_commentI18nstring

I18n comment for the text of the item.

iconstring

The icon of the item.

Example:

+ mycyclebutton
  - sling:resourceType = "granite/ui/components/coral/foundation/cyclebutton"
    + items
      + button1
        - text = "Button1"
      + button2
        - text = "Button2"
        - text_commentI18n = "Button2 description"
        - selected = true
    + actions
      + action1
        - text = "Action1"
      + action2
        - text = "Action2"