Zum Hauptinhalt springen

PopoverButton

Diese neue Komponente wird als ungetestet markiert, da der vollständige Barrierefreiheitstest noch aussteht. Der vollständige Test kann bei neuen Komponenten und Funktionalitäten auch erst nach einem abgeschlossenen Release erfolgen.

Der PopoverButton ist eine Komponente, die einen Button mit einem zugehörigen Popover-Menü kombiniert. Das Popover wird durch Klicken auf den Button ein- und ausgeblendet. Die Beschriftung des Buttons kann über das _label-Attribut festgelegt werden. Die Position des Popovers lässt sich über _popover-align steuern, wobei das Popover wahlweise oberhalb, rechts, unterhalb oder links vom Button platziert werden kann.

Der PopoverButton eignet sich besonders für:

  • Zusätzliche Informationen
  • Kontextmenüs
  • Ausklappbare Bedienelemente

Konstruktion

Code

<kol-popover-button _label="Weitere Informationen" _icons="codicon codicon-info" _popover-align="right">
Weitere Informationen im Popover.
</kol-popover-button>

Beispiel

Weitere Informationen im Popover.

kol-popover-button

Properties

PropertyAttributeDescriptionTypeDefault
_accessKey_access-keyDefines which key combination can be used to trigger or focus the interactive element of the component.string | undefinedundefined
_ariaControls_aria-controlsDefines which elements are controlled by this component. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls)string | undefinedundefined
_ariaDescription_aria-descriptionDefines the value for the aria-description attribute.string | undefinedundefined
_ariaExpanded_aria-expandedDefines whether the interactive element of the component expanded something. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded)boolean | undefinedundefined
_ariaSelected_aria-selectedDefines whether the interactive element of the component is selected (e.g. role=tab). (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected)boolean | undefinedundefined
_customClass_custom-classDefines the custom class attribute if _variant="custom" is set.string | undefinedundefined
_disabled_disabledMakes the element not focusable and ignore all events.boolean | undefinedfalse
_hideLabel_hide-labelHides the caption by default and displays the caption text with a tooltip when the interactive element is focused or the mouse is over it.boolean | undefinedfalse
_icons_iconsDefines the icon classnames (e.g. _icons="fa-solid fa-user").KoliBriHorizontalIcons & KoliBriVerticalIcons | string | undefinedundefined
_id_idDefines the internal ID of the primary component element.string | undefinedundefined
_label (required)_labelDefines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to false to enable the expert slot.stringundefined
_name_nameDefines the technical name of an input field.string | undefinedundefined
_on--Defines the callback functions for button events.undefined | { onClick?: EventValueOrEventCallback<MouseEvent, StencilUnknown> | undefined; onMouseDown?: EventCallback<MouseEvent> | undefined; }undefined
_popoverAlign_popover-alignDefines where to show the Popover preferably: top, right, bottom or left."bottom" | "left" | "right" | "top" | undefined'bottom'
_role_roleDefines the role of the components primary element."button" | "link" | "tab" | "treeitem" | undefinedundefined
_shortKey_short-keyAdds a visual short key hint to the component.string | undefinedundefined
_tabIndex_tab-indexDefines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex)number | undefinedundefined
_tooltipAlign_tooltip-alignDefines where to show the Tooltip preferably: top, right, bottom or left."bottom" | "left" | "right" | "top" | undefined'top'
_type_typeDefines either the type of the component or of the components interactive element."button" | "reset" | "submit" | undefined'button'
_value_valueDefines the value that the button emits on click.boolean | null | number | object | string | undefinedundefined
_variant_variantDefines which variant should be used for presentation."custom" | "danger" | "ghost" | "normal" | "primary" | "secondary" | "tertiary" | undefined'normal'

Slots

SlotDescription
The popover content.

Beispiel ansehen

Live-Editor

Beispiele