Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to create a button with react

import PropTypes from 'prop-types'

const Button = ({ color, text, onClick }) => {
    return (
    <button 
        onClick={onClick}
        style={{backgroundColor: color}} 
        className='btn'>
        {text}
    </button>
    )
}

Button.defaultrops = {
    color: 'steelblue'
}

Button.propTypes = {
    text: PropTypes.string,
    color:PropTypes.string,
    onClick: PropTypes.func,
}

export default Button
Comment

how to make button in react js

<div className='col '>
            <button type="button" className="btn">Buy a G-Raffe Now!</button>
            </div>
// css for button
.btn{
    padding-left: 35px;
    padding-right: 35px;
    border: 2px;
    font-family: zedya;
    font-size: 15px;
    color: black;
    background-color: #fcdc1f;
    font-weight: 700;
    font-style: italic;
    
}
.btn:hover{
    color: rgb(255, 255, 255);
    animation: normal;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to print the value of variable in javascript in html 
Javascript :: checkbox on click jquery 
Javascript :: js create element from string 
Javascript :: how to take a input video on browser using javascript and play it 
Javascript :: jquery closest 
Javascript :: (node:2736) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. 
Javascript :: how to get relative postiion mouse click on element 
Javascript :: javascript number methods 
Javascript :: (node:63208) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead 
Javascript :: jquery checkbox checked or not 
Javascript :: discordjs delete all messages in channel 
Javascript :: loop an array in javascript 
Javascript :: javascript fill array with range 
Javascript :: javascript get last item in array 
Javascript :: js get date from datetime 
Javascript :: http get request js 
Javascript :: make image circle css react 
Javascript :: node-json-db example 
Javascript :: js get part of array 
Javascript :: javascript fill array 
Javascript :: Custom jquery validation messages 
Javascript :: update angular to specific version 
Javascript :: how to return 5 records instead of 10 records in datatable in laravel 
Javascript :: how to check if a message has an attachment discord js 
Javascript :: apa itu this pada javascript 
Javascript :: create angular app with routing and scss 
Javascript :: Sort to reverse from an array in javascript 
Javascript :: require("history").createBrowserHistory` instead of `require("history/createBrowserHistory")` 
Javascript :: delete all node modules 
Javascript :: get date javascript format 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =