Crea un componente de un Botón con un diseño bonito
- User
Crea un componente de un Botón con un diseño bonito
- Assistant
Aquí tienes un código para integrar in botón desde react en javascript
javascript
import React from 'react'; import './Button.css';
const Button = ({text, onClick}) => { return ( {text} ); };
export default Button;
Aquí tienes uno para css:
css
.button { padding: 10px 20px; border-radius: 5px; border: none; background-color: blue; color: white; font-size: 16px; cursor: pointer; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0px 10px 20px rgba(0, 0, 0, 0.3); }
.button:active { transform: translateY(2px); box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3); }
Este componente se puede usar en otro componente de la siguiente manera:
javascript
import React, {useState} from 'react'; import Button from './Button';
const App = () => { const [count, setCount] = useState(0);
return ( <Button text="Click me" onClick={() => setCount(count + 1)} /> You've clicked the button {count} times. ); };
export default App;
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.