Version: v6On this pageion-toggleshadowToggles are switches that change the state of a single option. They can be switched on or off by pressing or swiping them. Toggles can also be checked programmatically by setting the checked property.Basic UsageAngularJavaScriptReactVueiOSMDOn / Off LabelsToggles can enable on/off labels by setting the enableOnOffLabels property. This is important for accessibility as it makes it easier to differentiate between a checked and unchecked toggle.AngularJavaScriptReactVueiOSMDThemingColorsAngularJavaScriptReactVueiOSMDCSS Custom PropertiesCSS custom properties can be combined with standard CSS to target different parts of a toggle. We can modify the width and height of the toggle directly to change the size of the track, while using the --handle-width and --handle-height custom properties to customize the handle size.AngularJavaScriptReactVueiOSMDCSS Shadow PartsWe can further customize toggle by targeting specific shadow parts that are exposed. Any CSS property on these parts can be styled and they can also be combined with CSS custom properties.AngularJavaScriptReactVueiOSMDInterfacesToggleChangeEventDetailinterface ToggleChangeEventDetail<T = any> { value: T; checked: boolean;}ToggleCustomEventWhile not required, this interface can be used in place of the CustomEvent interface for stronger typing with Ionic events emitted from this component.interface ToggleCustomEvent<T = any> extends CustomEvent { detail: ToggleChangeEventDetail<T>; target: HTMLIonToggleElement;}PropertiescheckedDescriptiontrueの場合、トグルが選択されます。AttributecheckedTypebooleanDefaultfalsecolorDescriptionThe color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming.AttributecolorType"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefinedDefaultundefineddisabledDescriptiontrueの場合、ユーザーはトグルを操作することができません。AttributedisabledTypebooleanDefaultfalseenableOnOffLabelsDescriptionトグル内のオン/オフアクセシビリティスイッチラベルを有効にします。Attributeenable-on-off-labelsTypeboolean | undefinedDefaultconfig.get('toggleOnOffLabels')modeDescriptionmodeは、どのプラットフォームのスタイルを使用するかを決定します。AttributemodeType"ios" | "md"DefaultundefinednameDescriptionフォームデータとともに送信されるコントロールの名前。AttributenameTypestringDefaultthis.inputIdvalueDescriptionThe value of the toggle does not mean if it's checked or not, use the checked property for that.The value of a toggle is analogous to the value of a <input type="checkbox">, it's only used when the toggle participates in a native <form>.AttributevalueTypenull | string | undefinedDefault'on'EventsNameDescriptionionBlurトグルのフォーカスが外れたときに発行されます。ionChangevalueプロパティが変更されたときに発行されます。ionFocusトグルにフォーカスが当たったときに発行されます。MethodsNo public methods available for this component.CSS Shadow PartsNameDescriptionhandleチェックした状態を変更するために使用するトグルハンドル(つまみ)です。trackトグルの背景トラックです。CSS Custom PropertiesNameDescription--backgroundトグルの背景--background-checkedチェックしたときのトグルの背景--border-radiusトグルトラックのボーダー半径--handle-backgroundトグルハンドルの背景--handle-background-checkedチェックしたときのトグルハンドルの背景--handle-border-radiusトグルハンドルのボーダー半径--handle-box-shadowトグルハンドルのボックスシャドウ--handle-heightトグルハンドルの高さ--handle-max-heightトグルハンドルの最大の高さ--handle-spacingトグルハンドル周辺の横方向の間隔--handle-transitionトグルハンドルの変遷--handle-widthトグルハンドルの幅SlotsNo slots available for this component.