Dropdown Menu

A floating menu triggered by user interaction, usually attached to a button or input field.

Usage

import { Dropdown } from "@smartacteam/react-native-ui";
<Dropdown.Root>
  <Button variant="ghost" onPress={() => setMenuOpen(!menuOpen)} leftIcon="ellipsis-vertical" size_md />
  <Dropdown.Menu open={menuOpen} hideMenu={() => setMenuOpen(false)}>
    <Button variant="ghost" leftIcon="list-restart" label="Restart" />
    <Button variant="ghost" leftIcon="list-restart" label="Restart" />
    <Button variant="ghost" leftIcon="list-restart" label="Restart" />
  </Dropdown.Menu>
</Dropdown.Root>

Example

Preview

Props

NameTypeRequiredDescription
childrenReact.ReactNodeYesTypically a trigger element (like a Button) and the Dropdown.Menu.
(…)(Inherited)Props from BaseSmacStyling, ViewProps.

NameTypeRequiredDescription
childrenReact.ReactNodeNoThe content inside the dropdown (typically a list of Button or menu options).
openbooleanNoControls the visibility of the dropdown menu.
hideMenu() => voidNoFunction to call when dismissing the menu (e.g. backdrop press).
(…)(Inherited)Props from BaseSmacStyling, ViewProps.