shimmer-elements.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Derived from vercel/ai-elements (skills/ai-elements/scripts/shimmer-elements.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">As paragraph (default)</p>
  13. <Shimmer as="p">This is rendered as a paragraph</Shimmer>
  14. </div>
  15. <div className="text-center">
  16. <p className="mb-3 text-muted-foreground text-sm">As heading</p>
  17. <Shimmer as="h2" className="font-bold text-2xl">
  18. Large Heading with Shimmer
  19. </Shimmer>
  20. </div>
  21. <div className="text-center">
  22. <p className="mb-3 text-muted-foreground text-sm">As span (inline)</p>
  23. <div>
  24. Processing your request{" "}
  25. <Shimmer as="span" className="inline">
  26. with AI magic
  27. </Shimmer>
  28. ...
  29. </div>
  30. </div>
  31. <div className="text-center">
  32. <p className="mb-3 text-muted-foreground text-sm">As div with custom styling</p>
  33. <Shimmer as="div" className="font-semibold text-lg">
  34. Custom styled shimmer text
  35. </Shimmer>
  36. </div>
  37. </div>
  38. );
  39. export default Example;