diff --git a/docs/api/checkbox.md b/docs/api/checkbox.md index 93e5fedeeed..5461036afba 100644 --- a/docs/api/checkbox.md +++ b/docs/api/checkbox.md @@ -1,11 +1,6 @@ --- title: "ion-checkbox" -hide_table_of_contents: true -demoUrl: "/docs/demos/api/checkbox/index.html" -demoSourceUrl: "https://github.com/ionic-team/ionic-docs/tree/main/static/demos/api/checkbox/index.html" --- -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; import Props from '@site/static/auto-generated/checkbox/props.md'; import Events from '@site/static/auto-generated/checkbox/events.md'; @@ -24,17 +19,20 @@ import APITOCInline from '@components/page/api/APITOCInline'; -

Contents

- +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 +TODO Playground -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. +## Indeterminate Checkboxes + +TODO Playground + +## Theming + +TODO Playground ## Interfaces @@ -61,269 +59,6 @@ interface CheckboxCustomEvent extends CustomEvent { -## Usage - - - - - -```html - - - - - - - - - - - - - - - - - - - - {{entry.val}} - - - -``` - -```typescript -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-page-home', - templateUrl: 'home.page.html', - styleUrls: ['home.page.scss'] -}) -export class HomePage { - public form = [ - { val: 'Pepperoni', isChecked: true }, - { val: 'Sausage', isChecked: false }, - { val: 'Mushroom', isChecked: false } - ]; -} -``` - - - - - - - -```html - - - - - - - - - - - - - - - - - - - - Pepperoni - - - - - Sausage - - - - - Mushrooms - - - -``` - - - - - - - -```tsx -import React, { useState } from 'react'; -import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonCheckbox, IonList, IonItem, IonLabel, IonItemDivider } from '@ionic/react'; - -const checkboxList = [ - { val: 'Pepperoni', isChecked: true }, - { val: 'Sausage', isChecked: false }, - { val: 'Mushroom', isChecked: false } -]; - -export const CheckboxExamples: React.FC = () => { - - const [checked, setChecked] = useState(false); - - return ( - - - - CheckboxExamples - - - - - Default Checkbox - - Checked: {JSON.stringify(checked)} - setChecked(e.detail.checked)} /> - - - Disabled Checkbox - - - Checkbox Colors - - - - - - - - Checkboxes in a List - - {checkboxList.map(({ val, isChecked }, i) => ( - - {val} - - - ))} - - - - ); -}; -``` - - - - - - -```tsx -import { Component, h } from '@stencil/core'; - -@Component({ - tag: 'checkbox-example', - styleUrl: 'checkbox-example.css' -}) -export class CheckboxExample { - private form = [ - { val: 'Pepperoni', isChecked: true }, - { val: 'Sausage', isChecked: false }, - { val: 'Mushroom', isChecked: false } - ]; - - render() { - return [ - // Default Checkbox - , - - // Disabled Checkbox - , - - // Checked Checkbox - , - - // Checkbox Colors - , - , - , - , - , - - // Checkboxes in a List - - {this.form.map(entry => - - {entry.val} - - - )} - - ]; - } -} -``` - - - - - - - -```html - - - -``` - - - - - ## Properties @@ -340,4 +75,4 @@ export default defineComponent({ ## Slots - \ No newline at end of file +