Loading
×Sorry to interrupt
CSS Error
Aura Component

Input Checkbox

  • Deprecated as of API version 47.0. We recommend migrating to Lightning Web Components and using the lightning-input component.

    Descriptor

    ui:inputCheckbox

    Targets

    Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out / Visualforce, Standalone Lightning App

Example Options

Using ui:inputCheckbox

Selected:

false

The following checkbox uses a component attribute to bind its value.

True

Code

<aura:component> <aura:attribute name="myBool" type="Boolean" default="true"/> <ui:inputCheckbox aura:id="checkbox" label="Select?" change="{!c.onCheck}"/> <p>Selected:</p> <p><ui:outputText class="result" aura:id="checkResult" value="false" /></p> <p>The following checkbox uses a component attribute to bind its value.</p> <ui:outputCheckbox aura:id="output" value="{!v.myBool}"/> </aura:component>
Component
Controller
Example
Documentation
Specification