/**
 * Mixin for widgets with a boolean on/off state.
 *
 * @abstract
 * @class
 *
 * @constructor
 * @param {Object} [config] Configuration options
 * @cfg {boolean} [value=false] Initial value
 */
OO.ui.ToggleWidget = function OoUiToggleWidget( config ) {
	// Configuration initialization
	config = config || {};

	// Properties
	this.value = null;

	// Initialization
	this.$element.addClass( 'oo-ui-toggleWidget' );
	this.setValue( !!config.value );
};

/* Events */

/**
 * @event change
 * @param {boolean} value Changed value
 */

/* Methods */

/**
 * Get the value of the toggle.
 *
 * @return {boolean}
 */
OO.ui.ToggleWidget.prototype.getValue = function () {
	return this.value;
};

/**
 * Set the value of the toggle.
 *
 * @param {boolean} value New value
 * @fires change
 * @chainable
 */
OO.ui.ToggleWidget.prototype.setValue = function ( value ) {
	value = !!value;
	if ( this.value !== value ) {
		this.value = value;
		this.emit( 'change', value );
		this.$element.toggleClass( 'oo-ui-toggleWidget-on', value );
		this.$element.toggleClass( 'oo-ui-toggleWidget-off', !value );
		this.$element.attr( 'aria-checked', value.toString() );
	}
	return this;
};

@@ -4,17 +4,58 @@
 %0A * 
-Mixin for
+ToggleWidget is mixed into other classes to create
  wid
@@ -69,15 +69,8 @@
 th a
- boolea
 n on
@@ -81,16 +81,98 @@
  state.%0A
+ * Please see OO.ui.ToggleButtonWidget and OO.ui.ToggleSwitchWidget for examples.%0A
  *%0A * @a
@@ -294,21 +294,92 @@
 se%5D 
-Initial value
+The toggle%E2%80%99s initial on/off state.%0A *  By default, the toggle is in the 'off' state.
 %0A */
@@ -679,44 +679,157 @@
 e%0A *
- @param %7Bboolean%7D value Changed valu
+%0A * A change event is emitted when the on/off state of the toggle changes.%0A *%0A * @param %7Bboolean%7D value Value representing the new state of the toggl
 e%0A *
@@ -859,34 +859,44 @@
 * Get the value 
-of
+representing
  the toggle.%0A *%0A
@@ -882,32 +882,40 @@
 nting the toggle
+%E2%80%99s state
 .%0A *%0A * @return 
@@ -923,16 +923,47 @@
 boolean%7D
+ The on/off state of the toggle
 %0A */%0AOO.
@@ -1052,20 +1052,20 @@
 Set the 
-valu
+stat
 e of the
@@ -1071,16 +1071,52 @@
 e toggle
+: %60true%60 for 'on', %60false' for 'off'
 .%0A *%0A * 
@@ -1142,16 +1142,30 @@
 lue 
-New valu
+The state of the toggl
 e%0A *

Add description