You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1006 B

  1. import React, { HTMLAttributes, ReactNode } from "react";
  2. export interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
  3. fontClass?: string;
  4. desc?: ReactNode;
  5. isCenter?: boolean;
  6. }
  7. const Heading: React.FC<HeadingProps> = ({
  8. children,
  9. desc = "Discover the most outstanding articles in all topics of life. ",
  10. className = "mb-10 text-neutral-900 dark:text-neutral-50",
  11. isCenter = false,
  12. ...args
  13. }) => {
  14. return (
  15. <div className={`nc-Section-Heading relative ${className}`}>
  16. <div
  17. className={
  18. isCenter ? "text-center w-full max-w-2xl mx-auto mb-4" : "max-w-2xl"
  19. }
  20. >
  21. <h2 className={`text-3xl md:text-4xl font-semibold`} {...args}>
  22. {children || `Section Heading`}
  23. </h2>
  24. {desc && (
  25. <span className="block mt-2 md:mt-3 font-normal text-base sm:text-lg text-neutral-500 dark:text-neutral-400">
  26. {desc}
  27. </span>
  28. )}
  29. </div>
  30. </div>
  31. );
  32. };
  33. export default Heading;