This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8) .

Button

Button is a versatile, theme-aware button component built on top of react-native-gesture-handler's Pressable. It supports multiple visual variants, types, sizes, and optional leading/trailing icons. The component automatically handles RTL layout by swapping icon positions.

Usage

import { Button } from "stream-chat-react-native";

<Button
  variant="primary"
  type="solid"
  size="md"
  label="Send Message"
  onPress={() => console.log("pressed")}
/>;

With icons:

<Button
  variant="secondary"
  type="outline"
  size="lg"
  label="Attach"
  LeadingIcon={(props) => <AttachIcon {...props} />}
/>

Icon-only button:

<Button
  variant="primary"
  type="ghost"
  size="sm"
  iconOnly
  LeadingIcon={(props) => <SendIcon {...props} />}
/>

Props

Button extends PressableProps from react-native-gesture-handler, so all pressable props (like onPress, onLongPress, hitSlop, etc.) are supported.

variant (required)

The color variant of the button. Determines the color scheme applied to the button's background, text, and border.

TypeValues
string'primary' | 'secondary' | 'destructive'

type (required)

The visual style type of the button.

TypeValues
string'solid' | 'outline' | 'ghost' | 'liquidGlass'
TypeDescription
solidFilled background with accent color
outlineTransparent background with a visible border
ghostNo background or border; text/icon only
liquidGlassTranslucent glass-like background

size

The size of the button. Controls height, width (for icon-only), and horizontal padding.

TypeDefaultValues
string'md''sm' | 'md' | 'lg'

Size mapping:

SizeHeightIcon-only WidthHorizontal Padding
sm3232spacingSm
md4040spacingMd
lg4848spacingLg

label

The content displayed at the center of the button. Can be a string (rendered as styled Text) or a custom React node.

Type
ReactNode

LeadingIcon

A render function for the icon displayed on the leading side (left in LTR, right in RTL) of the button.

Type
(props: IconProps) => ReactNode

TrailingIcon

A render function for the icon displayed on the trailing side (right in LTR, left in RTL) of the button.

Type
(props: IconProps) => ReactNode

iconOnly

When true, the button renders only the leading icon without a label. Padding is removed and the button becomes a square based on the size prop.

TypeDefault
booleanfalse

selected

Whether the button is in a selected/active state. When true, the button uses the backgroundCoreSelected semantic token for its background.

TypeDefault
booleanfalse

disabled

Whether the button is disabled. Passed through to the underlying Pressable.

TypeDefault
booleanfalse

style

Additional style applied to the outer wrapper View.

Type
StyleProp<ViewStyle>