ion-checkbox
Checkboxes allow the selection of multiple options from a set of options. They appear as checked (ticked) when activated. Clicking on a checkbox will toggle the checked property. They can also be checked programmatically by setting the checked property.
Basic Usage
Indeterminate Checkboxes
Theming
CSS Custom Properties
Interfaces
CheckboxChangeEventDetail
interface CheckboxChangeEventDetail<T = any> {
  value: T;
  checked: boolean;
}
CheckboxCustomEvent
While not required, this interface can be used in place of the CustomEvent interface for stronger typing with Ionic events emitted from this component.
interface CheckboxCustomEvent<T = any> extends CustomEvent {
  detail: CheckboxChangeEventDetail<T>;
  target: HTMLIonCheckboxElement;
}
Properties
checked
| Description | trueの場合、チェックボックスが選択される。 | 
| Attribute | checked | 
| Type | boolean | 
| Default | false | 
color
| Description | アプリケーションのカラーパレットから使用する色を指定します。デフォルトのオプションは以下の通りです。 "primary","secondary","tertiary","success","warning","danger","light","medium", と"dark"です.色に関する詳しい情報は theming を参照してください。 | 
| Attribute | color | 
| Type | "danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined | 
| Default | undefined | 
disabled
| Description | trueの場合、ユーザはチェックボックスと対話することができません。 | 
| Attribute | disabled | 
| Type | boolean | 
| Default | false | 
indeterminate
| Description | trueの場合、チェックボックスは視覚的に不定形と表示されます。 | 
| Attribute | indeterminate | 
| Type | boolean | 
| Default | false | 
mode
| Description | modeは、どのプラットフォームのスタイルを使用するかを決定します。 | 
| Attribute | mode | 
| Type | "ios" | "md" | 
| Default | undefined | 
name
| Description | フォームデータとともに送信されるコントロールの名前。 | 
| Attribute | name | 
| Type | string | 
| Default | this.inputId | 
value
| Description | チェックボックスの値は、チェックされているかどうかを意味するものではなく、 checkedプロパティを使用します。  チェックボックスの値は<input type="checkbox">の値に似ており、チェックボックスがネイティブの<form>に参加する場合にのみ使用されます。 | 
| Attribute | value | 
| Type | any | 
| Default | 'on' | 
Events
| Name | Description | 
|---|---|
| ionBlur | チェックボックスのフォーカスが外れたときに発行されます。 | 
| ionChange | チェックされたプロパティが変更されたときに発行されます。 | 
| ionFocus | チェックボックスにフォーカスが当たったときに発行されます。 | 
Methods
No public methods available for this component.
CSS Shadow Parts
| Name | Description | 
|---|---|
| container | チェックボックスマークのコンテナです。 | 
| mark | チェックされた状態を示すために使用されるチェックマークです。 | 
CSS Custom Properties
| Name | Description | 
|---|---|
| --background | チェックボックスアイコンの背景 | 
| --background-checked | チェックしたときのチェックボックスアイコンの背景 | 
| --border-color | チェックボックスアイコンのボーダーカラー | 
| --border-color-checked | チェックボックスのアイコンがチェックされたときのボーダーカラー | 
| --border-radius | チェックボックスアイコンの境界半径 | 
| --border-style | チェックボックスアイコンのボーダースタイル | 
| --border-width | チェックボックスアイコンのボーダー幅 | 
| --checkmark-color | チェックボックスのチェックマークがチェックされたときの色 | 
| --checkmark-width | チェックボックス・チェックマークのストローク幅 | 
| --size | チェックボックスのアイコンの大きさ | 
| --transition | チェックボックスアイコンの遷移 | 
Slots
No slots available for this component.