Skip to content

Commit 755dd18

Browse files
committed
docs(checkbox): add indeterminate state
1 parent 4a89860 commit 755dd18

File tree

8 files changed

+99
-2
lines changed

8 files changed

+99
-2
lines changed

docs/api/checkbox.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ import Basic from '@site/static/usage/checkbox/basic/index.md';
3030

3131
## Indeterminate Checkboxes
3232

33-
TODO Playground
33+
import Indeterminate from '@site/static/usage/checkbox/indeterminate/index.md';
34+
35+
<Indeterminate />
3436

3537
## Theming
3638

src/components/global/Playground/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ export default function Playground({
169169
* load, so a loading screen is shown by default.
170170
* Once the source of the iframe loads we can
171171
* hide the loading screen and show the inner content.
172-
*
172+
*
173173
* We call this as a local function because useEffect
174174
* callbacks cannot return a Promise, as async functions do.
175175
*/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```html
2+
<ion-item>
3+
<ion-checkbox slot="start" [indeterminate]="true"></ion-checkbox>
4+
<ion-label>Indeterminate checkbox</ion-label>
5+
</ion-item>
6+
```
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Checkbox</title>
7+
<link rel="stylesheet" href="../../common.css" />
8+
<script src="../../common.js"></script>
9+
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@6/dist/ionic/ionic.esm.js"></script>
10+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@6/css/ionic.bundle.css" />
11+
</head>
12+
<body>
13+
<ion-app>
14+
<ion-content>
15+
<div class="container">
16+
<ion-item>
17+
<ion-checkbox slot="start" indeterminate="true"></ion-checkbox>
18+
<ion-label>Indeterminate checkbox</ion-label>
19+
</ion-item>
20+
</div>
21+
</ion-content>
22+
</ion-app>
23+
</body>
24+
</html>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Playground from '@site/src/components/global/Playground';
2+
3+
import javascript from './javascript.md';
4+
import react from './react.md';
5+
import vue from './vue.md';
6+
import angular from './angular.md';
7+
8+
<Playground
9+
code={{
10+
javascript,
11+
react,
12+
vue,
13+
angular
14+
}}
15+
src="usage/checkbox/indeterminate/demo.html"
16+
/>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```html
2+
<ion-item>
3+
<ion-checkbox slot="start" indeterminate="true"></ion-checkbox>
4+
<ion-label>Indeterminate checkbox</ion-label>
5+
</ion-item>
6+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
```tsx
2+
import React from 'react';
3+
import {
4+
IonCheckbox,
5+
IonItem,
6+
IonLabel
7+
} from '@ionic/react';
8+
9+
function Example() {
10+
return (
11+
<IonItem>
12+
<IonCheckbox slot="start" indeterminate={true}></IonCheckbox>
13+
<IonLabel>Indeterminate checkbox</IonLabel>
14+
</IonItem>
15+
);
16+
}
17+
export default Example;
18+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
```html
2+
<template>
3+
<ion-item>
4+
<ion-checkbox slot="start" :indeterminate="true"></ion-checkbox>
5+
<ion-label>Indeterminate checkbox</ion-label>
6+
</ion-item>
7+
</template>
8+
9+
<script lang="ts">
10+
import {
11+
IonCheckbox,
12+
IonItem,
13+
IonLabel
14+
} from '@ionic/vue';
15+
import { defineComponent } from 'vue';
16+
17+
export default defineComponent({
18+
components: {
19+
IonCheckbox,
20+
IonItem,
21+
IonLabel
22+
}
23+
});
24+
</script>
25+
```

0 commit comments

Comments
 (0)