Skip to main content

Button

Button is the common widget for click action. And we have FWButton and CWButton derived from it.
We usually use FWButton and CWButton instead of Button directly.

  • props
PropertyDescriptionTypeDefault
actiononly used in Form to tell form it will trigger onFinishsubmit-
containerStylecustomize the style of button containerany-
textStylecustomize the style of text in buttonany-
textshowing text in buttonstring-
childrenyou can customze the inner content instead of providing textReactNode-
onClickwhen button click, what to dovoid-
disabledwhether button is disabledboolean-
capitalizewhether show uppercases of textboolean-
<Button 
text={'Base Button'}
containerStyle={{ width: 300, height: 50, borderwidth: 1, borederColor: '#ccc', backgroundColor: '#f00', borderRadius: 20 }}
textStyle={{ color: '#fff' }}
onClick={() => {SimpleToast.show('Submit')}}
/>

button

FWButton

Full Width Button

<Button.FWButton
style={{ width: 300, marginTop: 12 }}
text={'Submit'}
onClick={() => {SimpleToast.show('Submit')}}
/>
<Button.FWButton
style={{ width: 300, marginTop: 12 }}
text={'Submit'}
type={'secondary'}
onClick={() => {SimpleToast.show('Submit')}}
/>
<Button.FWButton
style={{ width: 300, marginTop: 12 }}
text={'Submit'}
disabled
onClick={() => {SimpleToast.show('Submit')}}
/>

fwbutton

CWButton

Custom Width Button

<Button.CWButton
style={{ marginHorizontal: 32, marginTop: 12 }}
text={'Submit'}
onClick={() => {SimpleToast.show('Submit')}}
/>
<Button.CWButton
style={{ marginHorizontal: 32, marginTop: 12 }}
text={'Submit'}
type={'secondary'}
onClick={() => {SimpleToast.show('Submit')}}
/>
<Button.CWButton
style={{ marginHorizontal: 32, marginTop: 12 }}
text={'Submit'}
disabled
onClick={() => {SimpleToast.show('Submit')}}
/>

cwbutton