import React from "react"; interface Props { style?: string; type: "button" | "submit" | "reset"; title?: string; icon?: React.ReactNode; onClick: () => void; } // Button component could accept text, icons and/or styles as props // style and onClick props are mandatory export const Button = ({ style, type, title, icon, onClick }: Props) => { return ( <button className={style} type={type} onClick={onClick}> <span>{icon}</span> {title} </button> ); };
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter