API Reference > ui-core > Inputs > Toggle Toggle<SS> Class Toggle React component to show an "on" or "off state Extends PureComponent<ToggleProps, ToggleState> Methods Name Description constructor(props: ToggleProps): Toggle componentDidMount(): void componentDidUpdate(prevProps: ToggleProps): void render(): Element Inherited methods Name Inherited from Description UNSAFE_componentWillMount(): void Optional DeprecatedLifecycle Called immediately before mounting occurs, and before Component#render. UNSAFE_componentWillReceiveProps(nextProps: Readonly<ToggleProps>, nextContext: any): void Optional DeprecatedLifecycle Called when the component may be receiving new props. UNSAFE_componentWillUpdate(nextProps: Readonly<ToggleProps>, nextState: Readonly<ToggleState>, nextContext: any): void Optional DeprecatedLifecycle Called immediately before rendering when new props or state is received. componentDidCatch(error: Error, errorInfo: ErrorInfo): void Optional ComponentLifecycle Catches exceptions generated in descendant components. componentWillMount(): void Optional DeprecatedLifecycle Called immediately before mounting occurs, and before Component#render. componentWillReceiveProps(nextProps: Readonly<ToggleProps>, nextContext: any): void Optional DeprecatedLifecycle Called when the component may be receiving new props. componentWillUnmount(): void Optional ComponentLifecycle Called immediately before a component is destroyed. componentWillUpdate(nextProps: Readonly<ToggleProps>, nextState: Readonly<ToggleState>, nextContext: any): void Optional DeprecatedLifecycle Called immediately before rendering when new props or state is received. getSnapshotBeforeUpdate(prevProps: Readonly<ToggleProps>, prevState: Readonly<ToggleState>): SS | null Optional NewLifecycle Runs before React applies the result of render to the document, and shouldComponentUpdate(nextProps: Readonly<ToggleProps>, nextState: Readonly<ToggleState>, nextContext: any): boolean Optional ComponentLifecycle Called to determine whether the change in props and state should trigger a re-render. Object Literals Name Description defaultProps Static Defined in ui/core/src/ui-core/toggle/Toggle.tsx Line 59 Last Updated: 13 June, 2024