Button

Buttons allow users to take actions, and make choices, with a single tap.

Usage

import { Button } from '@smartacteam/react-native-ui';
<Button variant="secondary">{children}</Button> 
// OR 
<Button variant="secondary" label="Button" />

Basics

Buttons should follow these principles:

  • Identifiable - Buttons should indicate that they can trigger an action.
  • Findable - Buttons should be easy to find among other elements.
  • Clear - Button’s action and state should be clear.

Example

Preview

Props

NameTypeRequiredDescription
childrenReact.ReactNodeNoContent rendered inside the button.
labelstringNoShortcut text label (alternative to children).
formreset or submitNoButton action type, used in Form
leftIconIconNameNoThe icon prop must be one of icons
rightIconIconNameNoThe icon prop must be one of icons
textStyleTextStyleNoCustom style for the label text.
variant'primary' | 'secondary' | 'confirmation' | 'warning' | 'destructive' | 'ghost'NoVisual style of the button.
size_*booleanNoSize variants like size_sm, size_md, size_lg, etc., based on SizeScale.
label_*BaseSmacTextStylingNoText style overrides for the label, e.g. label_fontSize, label_fontWeight.
(…)(Inherited)Props from BaseSmacStyling, TouchableOpacityProps.

ℹ️ Use size_* for button sizing and label_* to fine-tune label text styles.
See BaseSmacStyling and React Native TouchableOpacity Props for inherited options.