fun-dropdown

Dropdowns are menus that display over other content. They are usually opened by clicking a button, and the dropdown menu will appear under the button.

The dropdown component has no opinions about the actual menu, but a fun-dropdown-menu is recommended.

Note that the open property is one-way. Developers will need to listen to the funDismiss event and set open to false themselves. The funDismiss event is emitted when:

If your popover will contain other floating content such as dropdowns or tooltips you should add class relative to your body content, so that positioning works properly in Firefox and safari.

Examples

Specifications

Properties

PropertyAttributeRequiredDescriptionTypeDefault
alignalignfalseWhich edge of the trigger element to align the dropdown content to."end" | "start"'start'
backdropbackdropfalseUse a backdrop to capture clicks outside the popover rather than capturing clicks in the document.boolean
debugdebugfalseSet to true for extra console debug logging.boolean
offsetYoffset-yfalseAdd vertical spacing between the dropdown and the trigger element.number15
openopentrueIs the dropdown open.boolean
positionStrategyposition-strategyfalseUse to override the positioning strategy, which can be helpful in some conditions."absolute" | "fixed"'absolute'

Events

NameDescription
funDismissOccurs when the popover is dismissed.

Slots

NameDescription
contentThe element to show when the dropdown is open.
triggerThe element the trigger should be positioned under. Usually clicking this element should open the dropdown.

Parts

NameDescription
dropdown

Dependencies

Depends on

This documentation page generated from the source at fun-dropdown.tsx

Search Gunnel

Powered byAlgolia