Button
Customizable button component that handles press events
(code example)
This component extends TouchableOpacity props.
This component support margin, background modifiers.
Usageβ
<Button label={'Press'} size={Button.sizes.medium} backgroundColor={Colors.red30}/>
APIβ
animateLayoutβ
should animate layout change. Note: For Android you must set 'setLayoutAnimationEnabledExperimental(true)' via RN's 'UIManager'
boolean
animateToβ
the direction of the animation ('left' and 'right' will effect the button's own alignment)
ButtonAnimationDirection
avoidInnerPaddingβ
avoid inner button padding
boolean
avoidMinWidthβ
avoid minimum width constraints
boolean
backgroundColorβ
Color of the button background
string
borderRadiusβ
Custom border radius.
number
colorβ
The Button text color (inherited from Text component)
string
disabledβ
Disable interactions for the component
boolean
disabledBackgroundColorβ
Color of the disabled button background
string
enableShadowβ
Control shadow visibility (iOS-only)
boolean
fullWidthβ
should the button act as a coast to coast button (no border radius)
boolean
getActiveBackgroundColorβ
callback for getting activeBackgroundColor (e.g. (calculatedBackgroundColor, prop) => {...}). Better set using ThemeManager
(backgroundColor: string, props: any) => string
hyperlinkβ
Button will look like a hyperlink
boolean
iconOnRightβ
Should the icon be right to the label
boolean
iconPropsβ
Icon image props
Partial<ImageProps>
iconSourceβ
Icon image source or a callback function that returns a source
ImageProps['source'] | Function
iconStyleβ
Icon image style
ImageStyle
labelβ
Text to show inside the button
string
labelPropsβ
Props that will be passed to the button's Text label.
TextProps
labelStyleβ
Additional styles for label text
TextStyle
linkβ
Button will look like a link
boolean
linkColorβ
label color for when it's displayed as link or hyperlink
string
onPressβ
Actions handler
(props: any) => void
outlineβ
Button will have outline style
boolean
outlineColorβ
The outline color
string
outlineWidthβ
The outline width
number
roundβ
should the button be a round button
boolean
sizeβ
Size of the button [large, medium, small, xSmall]
ButtonSize
supportRTLβ
whether the icon should flip horizontally on RTL locals
boolean