docs/public/3.0/appbar-action.html
A component used to display an action item in the appbar.
Android
iOS
import * as React from 'react';
import { Appbar } from 'react-native-paper';
import { Platform } from 'react-native';
const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical';
const MyComponent = () => (
<Appbar.Header>
<Appbar.Content title="Title" subtitle={'Subtitle'} />
<Appbar.Action icon="magnify" onPress={() => {}} />
<Appbar.Action icon={MORE_ICON} onPress={() => {}} />
</Appbar.Header>
);
export default MyComponent;
color
Type: string
Custom color for action icon.
icon (required)
Type: IconSource
Name of the icon to show.
size
Type: number
Default value: 24
Optional icon size.
disabled
Type: boolean
Whether the button is disabled. A disabled button is greyed out and onPress is not called on touch.
accessibilityLabel
Type: string
Accessibility label for the button. This is read by the screen reader when the user taps the button.
onPress
Type: () => void
Function to execute on press.
style
Type: StyleProp<ViewStyle>
ref
Type: React.RefObject<TouchableWithoutFeedback>