easeul

Base UITransitions

Menu

Base UI folds dropdown and menubar surfaces into one Menu component.

Every value the manifest allows on this host, single presets and the pairs that compose. The first is what this component ships with. Both stages are the same component, so anything that changes between them is the attribute.

withoutno attribute
with easefuldata-motion="scale-fade"
host writes

data-ending-style, data-side

easeful matches

[data-motion~="scale-fade"][data-ending-style]

what runs

transition: opacity, scale 150ms

you write

<Menu.Popup data-motion="scale-fade" />

Where the attribute goes

The parts this demo composes, and the value each one carries. Everything inside an animated part is that part's content, so the tree stops there.

  1. Menu.Root
  2. Menu.Trigger
  3. Menu.Portal
  4. Menu.Positioner
  5. Menu.Popupdata-motion="scale-fade"

Source

"use client"

import { Menu } from "@base-ui/react/menu"
import type { DemoProps } from "@/components/demos/props"

export function BaseUiMenu({ motion }: DemoProps) {
  return (
    <Menu.Root>
      <Menu.Trigger className="btn">Open menu</Menu.Trigger>
      <Menu.Portal>
        <Menu.Positioner sideOffset={10} collisionPadding={16}>
          <Menu.Popup className="menu" data-motion={motion}>
            <Menu.Item className="menu__item">Rename</Menu.Item>
            <Menu.Item className="menu__item">Duplicate</Menu.Item>
            <Menu.Item className="menu__item">Archive</Menu.Item>
          </Menu.Popup>
        </Menu.Positioner>
      </Menu.Portal>
    </Menu.Root>
  )
}
The whole file, read from disk at build time. Both copies above render from it, and the motion prop is the only difference between them.