expo-router
Version:
Expo Router is a file-based router for React Native and web applications.
92 lines (91 loc) • 2.33 kB
TypeScript
import * as React from 'react';
import type { ColorValue, StyleProp, TextStyle, ViewStyle } from 'react-native';
import { type Route } from '../../native';
type Props = {
/**
* The route object which should be specified by the drawer item.
*/
route?: Route<string>;
/**
* The `href` to use for the anchor tag on web
*/
href?: string;
/**
* The label text of the item.
*/
label: string | ((props: {
focused: boolean;
color: ColorValue;
}) => React.ReactNode);
/**
* Icon to display for the `DrawerItem`.
*/
icon?: (props: {
focused: boolean;
size: number;
color: ColorValue;
}) => React.ReactNode;
/**
* Whether to highlight the drawer item as active.
*/
focused?: boolean;
/**
* Function to execute on press.
*/
onPress: () => void;
/**
* Color for the icon and label when the item is active.
*/
activeTintColor?: ColorValue;
/**
* Color for the icon and label when the item is inactive.
*/
inactiveTintColor?: ColorValue;
/**
* Background color for item when it's active.
*/
activeBackgroundColor?: ColorValue;
/**
* Background color for item when it's inactive.
*/
inactiveBackgroundColor?: ColorValue;
/**
* Color of the touchable effect on press.
* Only supported on Android.
*
* @platform android
*/
pressColor?: ColorValue;
/**
* Opacity of the touchable effect on press.
* Only supported on iOS.
*
* @platform ios
*/
pressOpacity?: number;
/**
* Style object for the label element.
*/
labelStyle?: StyleProp<TextStyle>;
/**
* Style object for the wrapper element.
*/
style?: StyleProp<ViewStyle>;
/**
* Whether label font should scale to respect Text Size accessibility settings.
*/
allowFontScaling?: boolean;
/**
* Accessibility label for drawer item.
*/
accessibilityLabel?: string;
/**
* ID to locate this drawer item in tests.
*/
testID?: string;
};
/**
* A component used to show an action item with an icon and a label in a navigation drawer.
*/
export declare function DrawerItem(props: Props): React.JSX.Element;
export {};