Button
Buttons trigger an action in a web page. It allows the developer to handle an action on user interaction.

Usage
The button text can be changed, and it uses a onclick prop which is handled internally.
npm i react-hartan
import { Button } from "react-hartan"
function App() {
return (
<>
<Button></Button>
</>
)
}
export default App
Customization With Props
buttonText
-> Accepts a node/string type, sent by the user which is shown as the button name.onClickFunction
-> Accepts a function, written by the user, which handles the logic when the button is clicked.id
-> The id prop is similar to the id attribute in HTML. It allows to provide overall component id.userButtonStyle
-> Custom styling prop that accepts the classes written by the user, which defines the custom styling for the button component.
import { Button } from "react-hartan"
function App() {
return (
<>
<Button></Button>
</>
)
}
export default App
Component Code
This is the code for the Button component.
Last updated