Because this library is being currently built for Electron and NW.js, the examples and demos on this site will only work properly in Chrome.
Button
Properties
Property | Type | Description |
---|---|---|
color | string | Sets the color of the button Property value null "blue". |
hidden | bool | Sets the visibility of a component. |
margin | string, number | Sets the outer margin of a component. E.G. "30px 20px" |
marginBottom | string, number | Sets the outer margin bottom of a component. |
marginLeft | string, number | Sets the outer margin left of a component. |
marginRight | string, number | Sets the outer margin right of a component. |
marginTop | string, number | Sets the outer margin top of a component. |
onClick | function | Callback function when the button is pressed. |
onEnter | function | Callback function when the the enter key is pressed. |
padding | string, number | Sets the padding inside a component. E.G. "30px 20px" |
paddingBottom | string, number | Sets the padding bottom inside a component. |
paddingLeft | string, number | Sets the padding left inside a component. |
paddingRight | string, number | Sets the padding right inside a component. |
paddingTop | string, number | Sets the padding top inside a component. |
size | string, number | Sets the font size of a component. |
type | string | Sets the type of the button Property value "button" "submit". Default value "button". |
Examples
import React, { Component } from 'react';
import { Button } from 'react-desktop/macOs';
export default class extends Component {
render() {
return (
<Button color="blue" onClick={() => console.log('Clicked!')}>
Press me!
</Button>
);
}
}