import * as React from "react"; import color from "color"; import type { StyleProp, ViewStyle, View, } from "react-native"; import { black } from "../theme/colors"; import IconButton from "../IconButton/IconButton"; type Props = React.ComponentPropsWithoutRef & { /** * Custom color for action icon. */ color?: string; /** * Name of the icon to show. */ icon: React.ReactElement; /** * Optional icon size. */ size?: number; /** * Whether the button is disabled. A disabled button is greyed out and `onPress` is not called on touch. */ disabled?: boolean; /** * Accessibility label for the button. This is read by the screen reader when the user taps the button. */ accessibilityLabel?: string; /** * Function to execute on press. */ onPress?: () => void; style?: StyleProp; // ref?: React.RefObject; ref?: React.RefObject; }; /** * A component used to display an action item in the appbar. *
*
* *
Android
*
*
* *
*
* *
iOS
*
*
* * ## Usage * ```js * import * as React from 'react'; * import Appbar from "react-native-simple-elements/components/Appbar"; * import { Platform } from 'react-native'; * * const MORE_ICON = Platform.OS === 'ios' ? 'dots-horizontal' : 'dots-vertical'; * * const MyComponent = () => ( * * * {}} /> * {}} /> * * ); * * export default MyComponent; * ``` */ const AppbarAction = ({ size = 24, color: iconColor = color(black).alpha(0.54).rgb().string(), icon, disabled, onPress, accessibilityLabel, ...rest }: Props) => ( ); AppbarAction.displayName = "Appbar.Action"; export default AppbarAction; // @component-docs ignore-next-line export { AppbarAction };