Skip to content

ToggleButtonModel

Overview

Model for a toggle button that changes value on each "up" event when the button is released.

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

Class ToggleButtonModel

import { ToggleButtonModel } from 'scenerystack/sun';

Constructor

new ToggleButtonModel( valueOff : T, valueOn : T, property : TProperty<T>, providedOptions? : ToggleButtonModelOptions )

Instance Methods

dispose()

Instance Properties

valueProperty : TProperty<T>

(readonly)

valueOff : T

(readonly)

valueOn : T

(readonly)

Type ToggleButtonModelOptions

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

ButtonModelOptions

Source Code

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