Checkbox
A checkbox is an input control that allows a user to select one or more options from a number of choices.Neutral selected states
When the platform-dst-tokens-finesse feature flag is enabled, this component uses the new neutral treatment for selected states.
Installation
| Install | yarn add @atlaskit/checkbox |
|---|---|
| Source | Bitbucket.org, (opens new window) |
| npm | @atlaskit/checkbox, (opens new window) |
| Bundle | unpkg.com, (opens new window) |
Props
| Description | Additional information to be included in the |
|---|---|
| Type | { [x: string]: any; } |
| Description | Sets whether the checkbox begins as checked or unchecked. |
|---|---|
| Type | boolean |
| Description | The ID assigned to the input. |
|---|---|
| Type | string |
| Description | Sets whether the checkbox is checked or unchecked. |
|---|---|
| Type | boolean |
| Description | Sets whether the checkbox is disabled. Don’t use a disabled checkbox if it needs to remain in the tab order for assistive technologies. |
|---|---|
| Type | boolean |
| Description | Sets whether the checkbox is indeterminate. This only affects the style and does not modify the isChecked property. |
|---|---|
| Type | boolean |
| Description | Marks the field as invalid. Changes style of unchecked component. |
|---|---|
| Type | boolean |
| Description | Marks the field as required & changes the label style. |
|---|---|
| Type | boolean |
| Description | The label to be displayed to the right of the checkbox. The label is part of the clickable element to select the checkbox. |
|---|---|
| Type | string | number | ReactElement<any, string | JSXElementConstructor<any>> |
| Description | The name of the submitted field in a checkbox. |
|---|---|
| Type | string |
| Description | Function that is called whenever the state of the checkbox changes. It will
be called with an object containing the react synthetic event. Use |
|---|---|
| Type | (e: ChangeEvent<HTMLInputElement>, analyticsEvent: UIAnalyticsEvent) => void |
| Description | No description. |
|---|---|
| Type | ((instance: HTMLInputElement) => void) | RefObject<HTMLInputElement> |
| Description | A
|
|---|---|
| Type | string |
| Description | The value to be used in the checkbox input. This is the value that will be returned on form submission. |
|---|---|
| Type | string | number |
| Description | Bounded style API. Defining allowed styles through this prop will be supported for future component iterations. Any styles that are not allowed by this API will result in type and land blocking violations. |
|---|---|
| Type | false | (XCSSValue<"alignItems", DesignTokenStyles, ""> & {} & XCSSPseudo<"alignItems", never, never, DesignTokenStyles> & XCSSMediaQuery<...> & { ...; } & { ...; }) |