Skip to content

docs(checkbox): add basic playground #2517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/api/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Checkboxes allow the selection of multiple options from a set of options. They a

## Basic

TODO Playground
import Basic from '@site/static/usage/checkbox/basic/index.md';

<Basic />

## Indeterminate Checkboxes

Expand Down
6 changes: 6 additions & 0 deletions static/usage/checkbox/basic/angular.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```html
<ion-item>
<ion-checkbox slot="start"></ion-checkbox>
<ion-label>I agree to the terms and conditions</ion-label>
</ion-item>
```
24 changes: 24 additions & 0 deletions static/usage/checkbox/basic/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Checkbox</title>
<link rel="stylesheet" href="../../common.css" />
<script src="../../common.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@6/dist/ionic/ionic.esm.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@6/css/ionic.bundle.css" />
</head>
<body>
<ion-app>
<ion-content>
<div class="container">
<ion-item>
<ion-checkbox slot="start"></ion-checkbox>
<ion-label>I agree to the terms and conditions</ion-label>
</ion-item>
</div>
</ion-content>
</ion-app>
</body>
</html>
16 changes: 16 additions & 0 deletions static/usage/checkbox/basic/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Playground from '@site/src/components/global/Playground';

import javascript from './javascript.md';
import react from './react.md';
import vue from './vue.md';
import angular from './angular.md';

<Playground
code={{
javascript,
react,
vue,
angular
}}
src="usage/checkbox/basic/demo.html"
/>
6 changes: 6 additions & 0 deletions static/usage/checkbox/basic/javascript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```html
<ion-item>
<ion-checkbox slot="start"></ion-checkbox>
<ion-label>I agree to the terms and conditions</ion-label>
</ion-item>
```
18 changes: 18 additions & 0 deletions static/usage/checkbox/basic/react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```tsx
import React from 'react';
import {
IonCheckbox,
IonItem,
IonLabel
} from '@ionic/react';

function Example() {
return (
<IonItem>
<IonCheckbox slot="start"></IonCheckbox>
<IonLabel>I agree to the terms and conditions</IonLabel>
</IonItem>
);
}
export default Example;
```
25 changes: 25 additions & 0 deletions static/usage/checkbox/basic/vue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
```html
<template>
<ion-item>
<ion-checkbox slot="start"></ion-checkbox>
<ion-label>I agree to the terms and conditions</ion-label>
</ion-item>
</template>

<script lang="ts">
import {
IonCheckbox,
IonItem,
IonLabel
} from '@ionic/vue';
import { defineComponent } from 'vue';

export default defineComponent({
components: {
IonCheckbox,
IonItem,
IonLabel
}
});
</script>
```