Skip to main content
Version: 0.2.0

TcbsButton

The TcbsButton component is a highly customizable button with icon support and theme integration.

Props

PropTypeDefaultDescription
titlestring-Button text
onPress(event: GestureResponderEvent) => voidRequiredCallback function when pressed
size'large' | 'medium' | 'small''large'Button size
variant'primary' | 'secondary' | 'no_border''primary'Button style variant
disabledbooleanfalseDisable button interaction
iconNamestring-Icon name from icon library
iconGroupstring'MaterialIcons'Icon library to use
iconPosition'top' | 'left' | 'right''top'Position of the icon
accessibilityLabelstring-Accessibility label
styleStyleProp<ViewStyle>-Additional styles
textStyleStyleProp<TextStyle>-Additional text styles

Examples

Basic Usage

<TcbsButton
title="Submit"
onPress={() => console.log('Pressed')}
/>

With Icon

<TcbsButton
title="Check"
iconName="check"
iconGroup="AntDesign"
iconPosition="left"
onPress={() => console.log('Pressed')}
/>

Different Sizes and Variants

<TcbsButton
title="Large"
size="large"
variant="primary"
onPress={() => console.log('Pressed')}
/>

<TcbsButton
title="Medium"
size="medium"
variant="secondary"
onPress={() => console.log('Pressed')}
/>

<TcbsButton
title="Small"
size="small"
variant="no_border"
onPress={() => console.log('Pressed')}
/>

Theme Integration

The button automatically adapts to the current theme:

  • Primary: Uses primary color from theme
  • Secondary: Uses border and text color from theme
  • No Border: Transparent background with themed text color