react-onsenui
Version:
Onsen UI - React Components for Hybrid Cordova/PhoneGap Apps with Material Design and iOS UI components
75 lines (67 loc) • 1.56 kB
JSX
import PropTypes from 'prop-types';
import 'onsenui/esm/elements/ons-toolbar-button';
import onsCustomElement from '../onsCustomElement';
/**
* @original ons-toolbar-button
* @category page
* @tutorial react/Reference/page
* @description
* [en]
* Button component for the Toolbar. Using this component gives a nice default style.
*
*
* [/en]
* [ja][/ja]
* @example
* <Page
renderToolbar = { () =>
<Toolbar>
<div className='left'><BackButton>Back</BackButton></div>
<div className='center'>Input</div>
<div className='right'>
<ToolbarButton onClick={this.add} >Add</ToolbarButton>
</div>
</Toolbar>
}>
Page Content
</Page>
*/
const ToolbarButton = onsCustomElement('ons-toolbar-button');
ToolbarButton.propTypes = {
/**
* @name modifier
* @type string
* @required false
* @description
* [en]The appearance of the button.[/en]
* [ja][/ja]
*/
modifier: PropTypes.string,
/**
* @name disabled
* @type bool
* @description
* [en]
* Indicates whether the button is disabled.
* [/en]
* [ja][/ja]
*/
disabled: PropTypes.bool,
/**
* @name icon
* @type string
* @description
* [en]Creates an `Icon` component with this string.[/en]
* [ja][/ja]
*/
icon: PropTypes.string,
/**
* @name onClick
* @type function
* @description
* [en]This function will be called when the button is clicked.[/en]
* [ja][/ja]
*/
onClick: PropTypes.func
};
export default ToolbarButton;