docs(stencil): add stencil usage to components (#21261)

This commit is contained in:
Brandy Carney
2020-05-12 20:35:48 -04:00
committed by GitHub
parent 703ef5c992
commit 687122127c
177 changed files with 11207 additions and 897 deletions

View File

@ -15,7 +15,7 @@ If the FAB button is not wrapped with `<ion-fab>`, it will scroll with the conte
<ion-content>
<!-- Fixed Floating Action Button that does not scroll with the content -->
<ion-fab>
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>
@ -45,7 +45,7 @@ import { IonContent, IonFab, IonFabButton } from '@ionic/react';
export const FabButtonExample: React.FC = () => (
<IonContent>
{/*-- Fixed Floating Action Button that does not scroll with the content --*/}
<IonFab>
<IonFab slot="fixed">
<IonFabButton>Button</IonFabButton>
</IonFab>
@ -66,6 +66,45 @@ export const FabButtonExample: React.FC = () => (
```
### Stencil
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'fab-button-example',
styleUrl: 'fab-button-example.css'
})
export class FabButtonExample {
render() {
return [
<ion-content>
{/* Fixed Floating Action Button that does not scroll with the content */}
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>
{/* Default Floating Action Button that scrolls with the content */}
<ion-fab-button>Default</ion-fab-button>
{/* Mini */}
<ion-fab-button size="small">Mini</ion-fab-button>
{/* Colors */}
<ion-fab-button color="primary">Primary</ion-fab-button>
<ion-fab-button color="secondary">Secondary</ion-fab-button>
<ion-fab-button color="danger">Danger</ion-fab-button>
<ion-fab-button color="light">Light</ion-fab-button>
<ion-fab-button color="dark">Dark</ion-fab-button>
</ion-content>
];
}
}
```
### Vue
```html
@ -73,7 +112,7 @@ export const FabButtonExample: React.FC = () => (
<ion-content>
<!-- Fixed Floating Action Button that does not scroll with the content -->
<ion-fab>
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>

View File

@ -2,7 +2,7 @@
<ion-content>
<!-- Fixed Floating Action Button that does not scroll with the content -->
<ion-fab>
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>

View File

@ -2,7 +2,7 @@
<ion-content>
<!-- Fixed Floating Action Button that does not scroll with the content -->
<ion-fab>
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>

View File

@ -5,7 +5,7 @@ import { IonContent, IonFab, IonFabButton } from '@ionic/react';
export const FabButtonExample: React.FC = () => (
<IonContent>
{/*-- Fixed Floating Action Button that does not scroll with the content --*/}
<IonFab>
<IonFab slot="fixed">
<IonFabButton>Button</IonFabButton>
</IonFab>

View File

@ -0,0 +1,35 @@
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'fab-button-example',
styleUrl: 'fab-button-example.css'
})
export class FabButtonExample {
render() {
return [
<ion-content>
{/* Fixed Floating Action Button that does not scroll with the content */}
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>
{/* Default Floating Action Button that scrolls with the content */}
<ion-fab-button>Default</ion-fab-button>
{/* Mini */}
<ion-fab-button size="small">Mini</ion-fab-button>
{/* Colors */}
<ion-fab-button color="primary">Primary</ion-fab-button>
<ion-fab-button color="secondary">Secondary</ion-fab-button>
<ion-fab-button color="danger">Danger</ion-fab-button>
<ion-fab-button color="light">Light</ion-fab-button>
<ion-fab-button color="dark">Dark</ion-fab-button>
</ion-content>
];
}
}
```

View File

@ -3,7 +3,7 @@
<ion-content>
<!-- Fixed Floating Action Button that does not scroll with the content -->
<ion-fab>
<ion-fab slot="fixed">
<ion-fab-button>Button</ion-fab-button>
</ion-fab>