shimmer-duration.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Derived from vercel/ai-elements (skills/ai-elements/scripts/shimmer-duration.tsx).
  3. * Copyright 2023 Vercel, Inc. Licensed under Apache-2.0.
  4. * Modified by ZCode: local integration, formatting and adaptations.
  5. * See THIRD-PARTY-NOTICES.md in the repository root for license and provenance.
  6. */
  7. "use client";
  8. import { Shimmer } from "@/components/ai-elements/shimmer";
  9. const Example = () => (
  10. <div className="flex flex-col gap-6 p-8">
  11. <div className="text-center">
  12. <p className="mb-3 text-muted-foreground text-sm">Fast (1 second)</p>
  13. <Shimmer duration={1}>Loading quickly...</Shimmer>
  14. </div>
  15. <div className="text-center">
  16. <p className="mb-3 text-muted-foreground text-sm">Default (2 seconds)</p>
  17. <Shimmer duration={2}>Loading at normal speed...</Shimmer>
  18. </div>
  19. <div className="text-center">
  20. <p className="mb-3 text-muted-foreground text-sm">Slow (4 seconds)</p>
  21. <Shimmer duration={4}>Loading slowly...</Shimmer>
  22. </div>
  23. <div className="text-center">
  24. <p className="mb-3 text-muted-foreground text-sm">Very Slow (6 seconds)</p>
  25. <Shimmer duration={6}>Loading very slowly...</Shimmer>
  26. </div>
  27. </div>
  28. );
  29. export default Example;