Logo

IconButton

An icon button is a button which displays only an icon without a label.

Default icon button
Contained icon button
Contained-tonal icon button
Outlined icon button

Usage

import * as React from 'react';
import { IconButton, MD3Colors } from 'react-native-paper';

const MyComponent = () => (
  <IconButton
    icon="camera"
    iconColor={MD3Colors.error50}
    size={20}
    onPress={() => console.log('Pressed')}
  />
);

export default MyComponent;

Props

Icon to display.

mode
Available in v5.x
Type: 'outlined' | 'contained' | 'contained-tonal'

Mode of the icon button. By default there is no specified mode - only pressable icon will be rendered.

iconColor
Renamed from 'color' to 'iconColor' in v5.x
Type: string

Color of the icon.

containerColor
Available in v5.x
Type: string

Background color of the icon container.

selected
Available in v5.x
Type: boolean
Default value: false

Whether icon button is selected. A selected button receives alternative combination of icon and container colors.

Type: number
Default value: 24

Size of the icon.

Type: boolean

Whether the button is disabled. A disabled button is greyed out and onPress is not called on touch.

Type: boolean
Default value: false

Whether an icon change is animated.

Type: string

Accessibility label for the button. This is read by the screen reader when the user taps the button.

Type: (e: GestureResponderEvent) => void

Function to execute on press.

Type: React.RefObject<TouchableWithoutFeedback>
...TouchableRipple propsEdit this page