monday-ui-react-core
Version:
Official monday.com UI resources for application development in React.js
34 lines (29 loc) • 793 B
JSX
import React, { useRef, forwardRef } from "react";
import PropTypes from "prop-types";
import cx from "classnames";
import useMergeRefs from "../../hooks/useMergeRefs";
import "./ListTitle.scss";
const ListTitle = forwardRef(({ className, id, children }, ref) => {
const componentRef = useRef(null);
const mergedRef = useMergeRefs({ refs: [ref, componentRef] });
return (
<div aria-level="3" role="heading" ref={mergedRef} className={cx("list-title", className)} id={id}>
{children}
</div>
);
});
ListTitle.propTypes = {
/**
* class name to be add to the wrapper
*/
className: PropTypes.string,
/**
* id to be added to the wrapper
*/
id: PropTypes.string
};
ListTitle.defaultProps = {
className: "",
id: undefined
};
export default ListTitle;