component-library-react
Version:
A library of ready to use components for React
24 lines (20 loc) • 447 B
JSX
import { useRef } from "react";
export default function Card({
name = "card",
children,
behavior = () => {},
style = {
border: "1px solid",
borderRadius: "7.5px",
boxShadow: "0 2px 5px 0 grey",
},
}) {
const cardRef = useRef(null);
/** func exposes the returned DOM element for further customization */
behavior(cardRef);
return (
<div id={name} ref={cardRef} style={style}>
{children}
</div>
);
}