UNPKG

meu-botao

Version:

Um botão customizável com Tailwind CSS

26 lines (22 loc) 547 B
// src/Button.js import React from "react"; import PropTypes from "prop-types"; import "./index.css"; const Button = ({ label, onClick, type = "button", className = "" }) => { return ( <button className={`px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 ${className}`} onClick={onClick} type={type} > {label} </button> ); }; Button.propTypes = { label: PropTypes.string.isRequired, onClick: PropTypes.func, type: PropTypes.string, className: PropTypes.string, }; export default Button;