Skip to contents

Create a Dropdown component

Usage

calcite_dropdown(...)

Arguments

...

named attributes passed to htmltools::tag()

Value

an object of class calcite_component which is a subclass of shiny.tag

Details

Properties

The following properties are provided by this component:

NameAttributeDescriptionValuesReflects to Attribute
closeOnSelectDisabledclose-on-select-disabledWhen true, the component will remain open after a selection is made. If the selectionMode of the selected calcite-dropdown-item's containing calcite-dropdown-group is "none", the component will always close.booleanTRUE
disableddisabledWhen true, interaction is prevented and the component is displayed with lower opacity.booleanTRUE
flipPlacementsNASpecifies the component's fallback calcite-dropdown-item placement when it's initial or specified placement has insufficient space available.Check API referenceFALSE
maxItemsmax-itemsSpecifies the maximum number of calcite-dropdown-items to display before showing a scroller. Value must be greater than 0, and does not include groupTitle's from calcite-dropdown-group.numberTRUE
openopenWhen true, displays and positions the component.booleanTRUE
overlayPositioningoverlay-positioningDetermines the type of positioning to use for the overlaid content. Using "absolute" will work for most cases. The component will be positioned inside of overflowing parent containers and will affect the container's layout. "fixed" should be used to escape an overflowing parent container, or when the reference element's position CSS property is "fixed"."absolute" | "fixed"TRUE
placementplacementDetermines where the component will be positioned relative to the container element."bottom" | "bottom-end" | "bottom-start" | "top" | "top-end" | "top-start"TRUE
scalescaleSpecifies the size of the component."l" | "m" | "s"TRUE
selectedItemsNASpecifies the component's selected items.Check API referenceFALSE
typetypeSpecifies the action to open the component from the container element."click" | "hover"TRUE
widthwidthSpecifies the width of the component."l" | "m" | "s"TRUE
widthScalewidth-scaleSpecifies the width of the component."l" | "m" | "s"TRUE

Events

The following events are observed by shiny:

EventDescription
calciteDropdownBeforeCloseFires when the component is requested to be closed and before the closing transition begins.
calciteDropdownBeforeOpenFires when the component is added to the DOM but not rendered, and before the opening transition begins.
calciteDropdownCloseFires when the component is closed and animation is complete.
calciteDropdownOpenFires when the component is open and animation is complete.
calciteDropdownSelectFires when a calcite-dropdown-item's selection changes.

Slots

The following slots are provided by this component:

SlotDescription
Default (unnamed)A slot for adding calcite-dropdown-group elements. Every calcite-dropdown-item must have a parent calcite-dropdown-group, even if the groupTitle property is not set.
triggerA slot for the element that triggers the calcite-dropdown.

Examples

calcite_dropdown()
#> <calcite-dropdown></calcite-dropdown>