1
0

skeleton_documentation.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. from nicegui import ui
  2. from . import doc
  3. @doc.demo(ui.skeleton)
  4. def skeleton():
  5. ui.skeleton().classes('w-full')
  6. @doc.demo('Styling and animation', '''
  7. The `square` and `bordered` parameters can be set to `True` to remove the border-radius and add a border to the skeleton.
  8. The `animation` parameter can be set to "pulse", "wave", "pulse-x", "pulse-y", "fade", "blink", or "none"
  9. to change the animation effect.
  10. The default value is "wave".
  11. ''')
  12. def custom_animations():
  13. ui.skeleton('QToolbar', square=True, bordered=True, animation='pulse-y') \
  14. .classes('w-full')
  15. @doc.demo('YouTube Skeleton', '''
  16. Here is an example skeleton for a YouTube video.
  17. ''')
  18. def youtube_skeleton():
  19. with ui.card().tight().classes('w-full'):
  20. ui.skeleton(square=True, animation='fade', height='150px', width='100%')
  21. with ui.card_section().classes('w-full'):
  22. ui.skeleton('text').classes('text-subtitle1')
  23. ui.skeleton('text').classes('text-subtitle1 w-1/2')
  24. ui.skeleton('text').classes('text-caption')