UI Components
Molecules
Dropdown

Dropdown

Displays a set of actions/items to the user, usually used to show a menu of options.

Overview


Import

Import the component from @faststore/ui

import {
  Dropdown,
  DropdownItem,
  DropdownMenu,
  DropdownButton,
} from '@faststore/ui'

Import Styles

import '@faststore/ui/src/components/molecules/Dropdown/styles.scss'

Usage


Props

Dropdown

NameTypeDescriptionDefault
Coming Soon

DropdownItem

NameTypeDescriptionDefault
Coming Soon

DropdownMenu

NameTypeDescriptionDefault
Coming Soon

DropdownButton

NameTypeDescriptionDefault
Coming Soon

Design Tokens

Compound Components

DropdownItem

Local tokenDefault value/Global token linked
--fs-dropdown-item-min-height2.375rem
--fs-dropdown-item-paddingvar(--fs-spacing-1) var(--fs-spacing-2) var(--fs-spacing-1) var(--fs-spacing-1)
--fs-dropdown-item-text-sizevar(--fs-text-size-base)
--fs-dropdown-item-text-weightvar(--fs-text-weight-regular)
--fs-dropdown-item-color
var(--fs-color-link)
--fs-dropdown-item-bkg-color
var(--fs-color-tertiary-bkg-light)
--fs-dropdown-item-bkg-color-hover
var(--fs-color-primary-bkg-light)
--fs-dropdown-item-border-bottom-colorvar(--fs-border-color-light)
--fs-dropdown-item-icon-min-width1.125rem
--fs-dropdown-item-icon-margin-rightvar(--fs-spacing-0)
--fs-dropdown-item-icon-margin-topcalc(-1 * var(--fs-spacing-1))

DropdownMenu

Local tokenDefault value/Global token linked
--fs-dropdown-menu-bkg-color
var(--fs-color-tertiary-bkg)
--fs-dropdown-menu-border-radiusvar(--fs-border-radius)
--fs-dropdown-menu-box-shadowvar(--fs-shadow-hover)

Variants

Small

Local tokenDefault value/Global token linked
--fs-dropdown-item-small-min-height1.75rem
--fs-dropdown-item-small-paddingvar(--fs-spacing-0) var(--fs-spacing-2) var(--fs-spacing-0) var(--fs-spacing-1)
--fs-dropdown-item-small-text-sizevar(--fs-text-size-1)

Customization

For further customization, you can use the following data attributes:

DropdownItem

data-fs-dropdown-item

DropdownMenu

data-fs-dropdown-menu

data-fs-dropdown-overlay

data-fs-dropdown-menu

data-fs-dropdown-menu-size="small | regular"

DropdownButton

data-fs-dropdown-button

This component inherits Button CSS selectors and styles.


Accessibility

Keyboard Interactions


Key

Description

Enter

When focusing on DropdownButton,
the Dropdown menu opens and focuses the first DropdownItem

ArrowDown

When focusing on an item, moves focus to the next DropdownItem

ArrowUp

When focusing on an item, moves focus to the previous DropdownItem

Escape

Closes DropdownMenu and moves focus to DropdownButton

Home

When DropdownMenu is open, move focus to the first DropdownItem

End

When DropdownMenu is open, move focus to the last DropdownItem