Skip to content

MenuItem

Overview

MenuItem is an item in the PhetMenu.

@author Michael Kauzmann (PhET Interactive Simulations)

import { MenuItem } from 'scenerystack/sun';

Constructor

Instance Methods

dispose()

Instance Properties

present : boolean

(readonly)

if this MenuItem will be shown in the menu. Some items are just created to maintain a consistent PhET-iO API for all sim runtimes, see https://github.com/phetsims/phet-io/issues/1457

separatorBefore : boolean

(readonly)

if there should be a horizontal separator between this MenuItem and the one above it

import type { MenuItemOptions } from 'scenerystack/sun';
  • separatorBefore?: boolean
    if there should be a horizontal separator between this MenuItem and the one immediately previous
  • checkedProperty?: TProperty<boolean> | null
    if provided add a checkmark next to the MenuItem text whenever this Property is true.
  • textFill?: TPaint
  • & VoicingOptions & NodeOptions

Source Code

See the source for MenuItem.ts in the sun repository.