button.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { Component, h } from '@stencil/core';
  2. @Component({
  3. tag: 'component-button',
  4. styleUrl: 'button.css'
  5. })
  6. export class Button {
  7. render() {
  8. return [
  9. <ion-header translucent={true}>
  10. <ion-toolbar>
  11. <ion-buttons slot="start">
  12. <ion-back-button defaultHref="/"></ion-back-button>
  13. </ion-buttons>
  14. <ion-title>Button</ion-title>
  15. </ion-toolbar>
  16. </ion-header>,
  17. <ion-content fullscreen={true}>
  18. <section>
  19. <ion-list-header>
  20. <ion-label>
  21. Small Size
  22. </ion-label>
  23. </ion-list-header>
  24. <ion-button size="small">Default</ion-button>
  25. <ion-button size="small" color="secondary">Secondary</ion-button>
  26. <ion-button size="small" color="tertiary">Tertiary</ion-button>
  27. </section>
  28. <section>
  29. <ion-list-header>
  30. <ion-label>
  31. Default Size
  32. </ion-label>
  33. </ion-list-header>
  34. <ion-button color="success">Success</ion-button>
  35. <ion-button color="warning">Warning</ion-button>
  36. <ion-button color="danger">Danger</ion-button>
  37. </section>
  38. <section>
  39. <ion-list-header>
  40. <ion-label>
  41. Large Size
  42. </ion-label>
  43. </ion-list-header>
  44. <ion-button size="large" color="light">Light</ion-button>
  45. <ion-button size="large" color="medium">Medium</ion-button>
  46. <ion-button size="large" color="dark">Dark</ion-button>
  47. </section>
  48. <section>
  49. <ion-list-header>
  50. <ion-label>
  51. Block Width
  52. </ion-label>
  53. </ion-list-header>
  54. <ion-button class="ion-text-wrap" expand="block">A block button</ion-button>
  55. </section>
  56. <section>
  57. <ion-list-header>
  58. <ion-label>
  59. Full Width
  60. </ion-label>
  61. </ion-list-header>
  62. <ion-button class="ion-text-wrap" expand="full" color="secondary">A full-width button</ion-button>
  63. </section>
  64. </ion-content>
  65. ];
  66. }
  67. }