Skip to main content

ButtonBase

ButtonBase is a generic component that provides a foundation for building all sorts of buttons. It can be used as a standalone component, or as the base for other button-like components.

Derived components:

Import

import { ButtonBase } from '@nomada-sh/react-native-eyecandy';

Example

Props

Pressable Props

Inherits Pressable Props.


style

These styles will be applied to the container view.

Type
View Style

pressableStyle

These styles will be applied to the pressable view.

Type
View Style

styles

This styles are applied before pressableStyle and style.

Type
object

Properties

NameTypeRequiredDescription
containerView StyleNoThese styles will be applied to the container view.
pressableView StyleNoThese styles will be applied to the pressable view.

color

This defines the background and foreground colors of the button. The color will change based on the theme (dark or light) if set to 'default'.

TypeDefault
'default' or 'primary' or 'secondary''default'

inverse

If true, inverts the background and foreground colors set with the color prop.

TypeDefault
booleanfalse

variant

This defines the variant, or look, of the component to use.

Possible values:

  • 'default' adds squared corners to the button.
  • 'rounded' adds rounded corners to the button.
  • 'squared' adds squared corners to the button.
TypeDefault
'default' or 'rounded' or 'squared''default'

fullWidth

If set to true, the button will expand to fill the width of its container.

TypeDefault
booleantrue

height

This defines the height of the button.

TypeDefault
number56

transparent

If true, the background color set with the color prop will be transparent.

TypeDefault
booleanfalse

outlined

If true, adds a border of the same color as the foreground color set with the color prop.

TypeDefault
booleanfalse

loading

If true, shows a loading spinner on top of button content.

TypeDefault
booleanfalse

hideDisabledOverlay

If true, the disabled overlay will not be shown on the button when disabled.

TypeDefault
booleanfalse

disableHapticFeedback

If true, the button will not trigger a haptic feedback on press.

TypeDefault
booleanfalse

marginTop

Type
number

marginBottom

Type
number