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

@@ -0,0 +1,26 @@
```tsx
import { Component, h } from '@stencil/core';
@Component({
tag: 'icon-example',
styleUrl: 'icon-example.css'
})
export class IconExample {
render() {
return [
// uses "star" icon for both modes
<ion-icon name="star"></ion-icon>,
// explicitly set the icon for each mode
<ion-icon ios="home" md="star"></ion-icon>,
// use a custom svg icon
<ion-icon src="/path/to/external/file.svg"></ion-icon>,
// set the icon size
<ion-icon size="small" name="heart"></ion-icon>,
<ion-icon size="large" name="heart"></ion-icon>
];
}
}
```