DropdownButton (ui/dropdown/button)
@ckeditor/ckeditor5-ui/src/dropdown/button/dropdownbutton
The dropdown button interface.
Filtering
Properties
-
inherited observable
ariaLabel : string | undefined
module:ui/dropdown/button/dropdownbutton~DropdownButton#ariaLabel
(Optional) The ARIA property reflected by the
aria-label
DOM attribute used by assistive technologies. -
inherited observable
ariaLabelledBy : string | undefined
module:ui/dropdown/button/dropdownbutton~DropdownButton#ariaLabelledBy
(Optional) The ARIA property reflected by the
aria-ariaLabelledBy
DOM attribute used by assistive technologies. -
children : ViewCollection<View<HTMLElement>>
module:ui/dropdown/button/dropdownbutton~DropdownButton#children
-
inherited observable
class : undefined | string
module:ui/dropdown/button/dropdownbutton~DropdownButton#class
(Optional) The additional CSS class set on the button.
-
inherited observable
icon : undefined | string
module:ui/dropdown/button/dropdownbutton~DropdownButton#icon
(Optional) An XML content of the icon. When defined, an
iconView
should be added to the button.The user must provide the entire XML string, not just the path. See the UI library guide for details.
-
inherited observable
isEnabled : boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isEnabled
Controls whether the button view is enabled, i.e. it can be clicked and execute an action.
To change the "on" state of the button, use
isOn
instead.Defaults to
true
-
Controls whether the button view is "on". It makes sense when a feature it represents is currently active, e.g. a bold button is "on" when the selection is in the bold text.
To disable the button, use
isEnabled
instead.Defaults to
true
-
inherited observable
isToggleable : boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isToggleable
Controls whether the button view is a toggle button (two–state) for assistive technologies.
Defaults to
false
-
inherited observable
isVisible : boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#isVisible
Controls whether the button view is visible. Visible by default, buttons are hidden using a CSS class.
Defaults to
true
-
inherited observable
keystroke : undefined | string
module:ui/dropdown/button/dropdownbutton~DropdownButton#keystroke
(Optional) The keystroke associated with the button, i.e. CTRL+B, in the string format compatible with
keyboard
.Note: Use
withKeystroke
if you want to display the keystroke information next to the label. -
inherited observable
label : undefined | string
module:ui/dropdown/button/dropdownbutton~DropdownButton#label
-
inherited observable
labelStyle : undefined | string
module:ui/dropdown/button/dropdownbutton~DropdownButton#labelStyle
(Optional) The value of the
style
attribute of the label. -
inherited observable
role : string | undefined
module:ui/dropdown/button/dropdownbutton~DropdownButton#role
(Optional) The property reflected by the
role
DOM attribute to be used by assistive technologies. -
inherited observable
tabindex : number
module:ui/dropdown/button/dropdownbutton~DropdownButton#tabindex
(Optional) Controls the
tabindex
HTML attribute of the button. By default, the button is focusable but does not included in the Tab order.Defaults to
-1
-
inherited observable
tooltip : string | boolean | ( string, undefined | string ) => string
module:ui/dropdown/button/dropdownbutton~DropdownButton#tooltip
(Optional) Tooltip of the button, i.e. displayed when hovering the button with the mouse cursor.
- If defined as a
Boolean
(e.g.true
), then combination oflabel
andkeystroke
will be set as a tooltip. - If defined as a
String
, tooltip will equal the exact text of thatString
. - If defined as a
Function
,label
andkeystroke
will be passed to that function, which is to return a string with the tooltip text.
const view = new ButtonView( locale ); view.tooltip = ( label, keystroke ) => `A tooltip for ${ label } and ${ keystroke }.`
Defaults to
false
- If defined as a
-
inherited observable
tooltipPosition : 'e' | 's' | 'n' | 'w' | 'sw' | 'se'
module:ui/dropdown/button/dropdownbutton~DropdownButton#tooltipPosition
(Optional) The position of the tooltip. See
TooltipManager
to learn more about the tooltip system.Note: It makes sense only when the
tooltip
attribute is defined.Defaults to
's'
-
inherited observable
type : 'button' | 'menu' | 'reset' | 'submit'
module:ui/dropdown/button/dropdownbutton~DropdownButton#type
-
inherited observable
withKeystroke : boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#withKeystroke
-
inherited observable
withText : boolean
module:ui/dropdown/button/dropdownbutton~DropdownButton#withText
(Optional) Controls whether the label of the button is hidden (e.g. an icon–only button).
Defaults to
false
Events
-
inherited
change:ariaLabel( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:ariaLabel
Fired when the
ariaLabel
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
ariaLabel
).value : string
New value of the
ariaLabel
property with given key ornull
, if operation should remove property.oldValue : string
Old value of the
ariaLabel
property with given key ornull
, if property was not set before.
-
inherited
change:ariaLabelledBy( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:ariaLabelledBy
Fired when the
ariaLabelledBy
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
ariaLabelledBy
).value : string
New value of the
ariaLabelledBy
property with given key ornull
, if operation should remove property.oldValue : string
Old value of the
ariaLabelledBy
property with given key ornull
, if property was not set before.
-
inherited
change:class( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:class
Fired when the
class
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
class
).value : undefined | string
New value of the
class
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
class
property with given key ornull
, if property was not set before.
-
inherited
change:icon( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:icon
Fired when the
icon
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
icon
).value : undefined | string
New value of the
icon
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
icon
property with given key ornull
, if property was not set before.
-
inherited
change:isEnabled( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isEnabled
Fired when the
isEnabled
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isEnabled
).value : boolean
New value of the
isEnabled
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isEnabled
property with given key ornull
, if property was not set before.
-
inherited
change:isOn( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isOn
Fired when the
isOn
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isOn
).value : boolean
New value of the
isOn
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isOn
property with given key ornull
, if property was not set before.
-
inherited
change:isToggleable( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isToggleable
Fired when the
isToggleable
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isToggleable
).value : boolean
New value of the
isToggleable
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isToggleable
property with given key ornull
, if property was not set before.
-
inherited
change:isVisible( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:isVisible
Fired when the
isVisible
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isVisible
).value : boolean
New value of the
isVisible
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isVisible
property with given key ornull
, if property was not set before.
-
inherited
change:keystroke( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:keystroke
Fired when the
keystroke
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
keystroke
).value : undefined | string
New value of the
keystroke
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
keystroke
property with given key ornull
, if property was not set before.
-
inherited
change:label( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:label
Fired when the
label
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
label
).value : undefined | string
New value of the
label
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
label
property with given key ornull
, if property was not set before.
-
inherited
change:labelStyle( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:labelStyle
Fired when the
labelStyle
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
labelStyle
).value : undefined | string
New value of the
labelStyle
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
labelStyle
property with given key ornull
, if property was not set before.
-
inherited
change:role( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:role
Fired when the
role
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
role
).value : string
New value of the
role
property with given key ornull
, if operation should remove property.oldValue : string
Old value of the
role
property with given key ornull
, if property was not set before.
-
inherited
change:tabindex( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:tabindex
Fired when the
tabindex
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
tabindex
).value : number
New value of the
tabindex
property with given key ornull
, if operation should remove property.oldValue : number
Old value of the
tabindex
property with given key ornull
, if property was not set before.
-
inherited
change:tooltip( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:tooltip
Fired when the
tooltip
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
tooltip
).value : string | boolean | ( string, undefined | string ) => string
New value of the
tooltip
property with given key ornull
, if operation should remove property.oldValue : string | boolean | ( string, undefined | string ) => string
Old value of the
tooltip
property with given key ornull
, if property was not set before.
-
inherited
change:tooltipPosition( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:tooltipPosition
Fired when the
tooltipPosition
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
tooltipPosition
).value : 'e' | 's' | 'n' | 'w' | 'sw' | 'se'
New value of the
tooltipPosition
property with given key ornull
, if operation should remove property.oldValue : 'e' | 's' | 'n' | 'w' | 'sw' | 'se'
Old value of the
tooltipPosition
property with given key ornull
, if property was not set before.
-
inherited
change:type( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:type
Fired when the
type
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
type
).value : 'button' | 'menu' | 'reset' | 'submit'
New value of the
type
property with given key ornull
, if operation should remove property.oldValue : 'button' | 'menu' | 'reset' | 'submit'
Old value of the
type
property with given key ornull
, if property was not set before.
-
inherited
change:withKeystroke( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:withKeystroke
Fired when the
withKeystroke
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
withKeystroke
).value : boolean
New value of the
withKeystroke
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
withKeystroke
property with given key ornull
, if property was not set before.
-
inherited
change:withText( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:change:withText
Fired when the
withText
property changed value.Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
withText
).value : boolean
New value of the
withText
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
withText
property with given key ornull
, if property was not set before.
-
open( eventInfo )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:open
Fired when the dropdown should be opened. It will not be fired when the button is disabled.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
-
inherited
set:ariaLabel( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:ariaLabel
Fired when the
ariaLabel
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
ariaLabel
).value : string
New value of the
ariaLabel
property with given key ornull
, if operation should remove property.oldValue : string
Old value of the
ariaLabel
property with given key ornull
, if property was not set before.
-
inherited
set:ariaLabelledBy( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:ariaLabelledBy
Fired when the
ariaLabelledBy
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
ariaLabelledBy
).value : string
New value of the
ariaLabelledBy
property with given key ornull
, if operation should remove property.oldValue : string
Old value of the
ariaLabelledBy
property with given key ornull
, if property was not set before.
-
inherited
set:class( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:class
Fired when the
class
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
class
).value : undefined | string
New value of the
class
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
class
property with given key ornull
, if property was not set before.
-
inherited
set:icon( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:icon
Fired when the
icon
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
icon
).value : undefined | string
New value of the
icon
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
icon
property with given key ornull
, if property was not set before.
-
inherited
set:isEnabled( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:isEnabled
Fired when the
isEnabled
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isEnabled
).value : boolean
New value of the
isEnabled
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isEnabled
property with given key ornull
, if property was not set before.
-
inherited
set:isOn( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:isOn
Fired when the
isOn
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isOn
).value : boolean
New value of the
isOn
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isOn
property with given key ornull
, if property was not set before.
-
inherited
set:isToggleable( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:isToggleable
Fired when the
isToggleable
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isToggleable
).value : boolean
New value of the
isToggleable
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isToggleable
property with given key ornull
, if property was not set before.
-
inherited
set:isVisible( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:isVisible
Fired when the
isVisible
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
isVisible
).value : boolean
New value of the
isVisible
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
isVisible
property with given key ornull
, if property was not set before.
-
inherited
set:keystroke( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:keystroke
Fired when the
keystroke
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
keystroke
).value : undefined | string
New value of the
keystroke
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
keystroke
property with given key ornull
, if property was not set before.
-
inherited
set:label( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:label
Fired when the
label
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
label
).value : undefined | string
New value of the
label
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
label
property with given key ornull
, if property was not set before.
-
inherited
set:labelStyle( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:labelStyle
Fired when the
labelStyle
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
labelStyle
).value : undefined | string
New value of the
labelStyle
property with given key ornull
, if operation should remove property.oldValue : undefined | string
Old value of the
labelStyle
property with given key ornull
, if property was not set before.
-
inherited
set:role( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:role
Fired when the
role
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
role
).value : string
New value of the
role
property with given key ornull
, if operation should remove property.oldValue : string
Old value of the
role
property with given key ornull
, if property was not set before.
-
inherited
set:tabindex( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:tabindex
Fired when the
tabindex
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
tabindex
).value : number
New value of the
tabindex
property with given key ornull
, if operation should remove property.oldValue : number
Old value of the
tabindex
property with given key ornull
, if property was not set before.
-
inherited
set:tooltip( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:tooltip
Fired when the
tooltip
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
tooltip
).value : string | boolean | ( string, undefined | string ) => string
New value of the
tooltip
property with given key ornull
, if operation should remove property.oldValue : string | boolean | ( string, undefined | string ) => string
Old value of the
tooltip
property with given key ornull
, if property was not set before.
-
inherited
set:tooltipPosition( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:tooltipPosition
Fired when the
tooltipPosition
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
tooltipPosition
).value : 'e' | 's' | 'n' | 'w' | 'sw' | 'se'
New value of the
tooltipPosition
property with given key ornull
, if operation should remove property.oldValue : 'e' | 's' | 'n' | 'w' | 'sw' | 'se'
Old value of the
tooltipPosition
property with given key ornull
, if property was not set before.
-
inherited
set:type( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:type
Fired when the
type
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
type
).value : 'button' | 'menu' | 'reset' | 'submit'
New value of the
type
property with given key ornull
, if operation should remove property.oldValue : 'button' | 'menu' | 'reset' | 'submit'
Old value of the
type
property with given key ornull
, if property was not set before.
-
inherited
set:withKeystroke( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:withKeystroke
Fired when the
withKeystroke
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
withKeystroke
).value : boolean
New value of the
withKeystroke
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
withKeystroke
property with given key ornull
, if property was not set before.
-
inherited
set:withText( eventInfo, name, value, oldValue )
module:ui/dropdown/button/dropdownbutton~DropdownButton#event:set:withText
Fired when the
withText
property is going to be set but is not set yet (before thechange
event is fired).Parameters
eventInfo : EventInfo
An object containing information about the fired event.
name : string
Name of the changed property (
withText
).value : boolean
New value of the
withText
property with given key ornull
, if operation should remove property.oldValue : boolean
Old value of the
withText
property with given key ornull
, if property was not set before.
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.