Skip to content

StickyToggleButtonModel

Overview

Model for a toggle button that sticks when pushed down and pops up when pushed a second time. Unlike other general sun models, 'sticky' implies a specific type of user-interface component, a button that is either popped up or pressed down.

@author Sam Reid (PhET Interactive Simulations) @author John Blanco (PhET Interactive Simulations)

Class StickyToggleButtonModel

import { StickyToggleButtonModel } from 'scenerystack/sun';

Constructor

new StickyToggleButtonModel( valueUp : T, valueDown : T, valueProperty : TProperty<T>, providedOptions? : StickyToggleButtonModelOptions )

Instance Methods

dispose()

Instance Properties

valueProperty : TProperty<T>

(readonly)

valueUp : T

(readonly)

valueDown : T

(readonly)

Type StickyToggleButtonModelOptions

import type { StickyToggleButtonModelOptions } from 'scenerystack/sun';

ButtonModelOptions

Source Code

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