Preloader - 图1

Preloader / Spinner Svelte Component

Preloader / Spinner Svelte component represents Preloader element.

Preloader Components

There are following components included:

  • Preloader

Preloader Properties

PropTypeDescription
<Preloader> properties
sizestring
number
Size of the preloader in px

Examples

  1. <Page>
  2. <Navbar title="Preloader" />
  3. <Block>
  4. <p>How about an activity indicator? Framework7 has a nice one. The F7 Preloader is made with SVG and animated with CSS so it can be easily resized.</p>
  5. </Block>
  6. <BlockTitle>Default</BlockTitle>
  7. <Block strong class="row demo-preloaders align-items-stretch text-align-center">
  8. <Col>
  9. <Preloader></Preloader>
  10. </Col>
  11. <Col style="background: #000">
  12. <Preloader color="white"></Preloader>
  13. </Col>
  14. <Col>
  15. <Preloader size={42}></Preloader>
  16. </Col>
  17. <Col style="background: #000">
  18. <Preloader size={42} color="white"></Preloader>
  19. </Col>
  20. </Block>
  21. <BlockTitle>Color Preloaders</BlockTitle>
  22. <Block strong class="row text-align-center">
  23. <Col>
  24. <Preloader color="red"></Preloader>
  25. </Col>
  26. <Col>
  27. <Preloader color="green"></Preloader>
  28. </Col>
  29. <Col>
  30. <Preloader color="orange"></Preloader>
  31. </Col>
  32. <Col>
  33. <Preloader color="blue"></Preloader>
  34. </Col>
  35. </Block>
  36. <BlockTitle>Multi-color (MD-theme only)</BlockTitle>
  37. <Block strong class="text-align-center">
  38. <Preloader color="multi"></Preloader>
  39. </Block>
  40. <BlockTitle>Preloader Modals</BlockTitle>
  41. <Block strong>
  42. <p>With <b>f7.preloader.show()</b> you can show small overlay with preloader indicator.</p>
  43. <p>
  44. <Button fill onClick={openIndicator}>Open Small Indicator</Button>
  45. </p>
  46. <p>With <b>f7.dialog.preloader()</b> you can show dialog modal with preloader indicator.</p>
  47. <p>
  48. <Button fill onClick={openDialog}>Open Dialog Preloader</Button>
  49. </p>
  50. <p>With <b>f7.dialog.preloader('My text...')</b> you can show dialog preloader modal with custom title.</p>
  51. <p>
  52. <Button fill onClick={openCustomDialog}>Open Dialog Preloader</Button>
  53. </p>
  54. </Block>
  55. </Page>
  56. <style>
  57. :global(.demo-preloaders .col) {
  58. line-height: 42px;
  59. }
  60. </style>
  61. <script>
  62. import {f7, Page, Navbar, Block, BlockTitle, Col, Preloader, Button} from 'framework7-svelte';
  63. function openIndicator() {
  64. f7.preloader.show();
  65. setTimeout(() => {
  66. f7.preloader.hide();
  67. }, 2000);
  68. }
  69. function openDialog() {
  70. f7.dialog.preloader();
  71. setTimeout(() => {
  72. f7.dialog.close();
  73. }, 2000);
  74. }
  75. function openCustomDialog() {
  76. f7.dialog.preloader('My text...');
  77. setTimeout(() => {
  78. f7.dialog.close();
  79. }, 2000);
  80. }
  81. </script>

← Popup

Progressbar →