@prosperitainova/dumbo-react-native
Version:
Dumbo for React Native Library
48 lines • 2 kB
TypeScript
import React from 'react';
import { GestureResponderEvent, PressableProps, StyleProp, ViewStyle } from 'react-native';
import { TextBreakModes, TextTypes } from '../Text';
import { CarbonIcon } from '../../types/shared';
/** Props for MenuItem component */
export type MenuItemProps = {
/** Text to render */
text: string;
/** Break mode for text. Default is to wrap text */
textBreakMode?: TextBreakModes;
/** Indicate if item is disabled */
disabled?: boolean;
/** Text type to render (Standard is default. Normally only body 01 or 02 should be used) */
textType?: TextTypes;
/** Set to an icon from Carbon (size 20). */
icon?: CarbonIcon;
/** Color of the icon (default is primary text) */
iconColor?: string;
/** Indicate that divider should be rendered (does not apply to last item) */
divider?: boolean;
/** Indicates that menu item is final item (this is used internally) */
lastItem?: boolean;
/** onPress event */
onPress: (event: GestureResponderEvent) => void;
/** onLongPress event */
onLongPress?: (event: GestureResponderEvent) => void;
/** Indicate if keyboard should be dismissed onPress */
dismissKeyboardOnPress?: boolean;
/** Style to set on the item */
style?: StyleProp<ViewStyle>;
/** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */
componentProps?: PressableProps;
};
/**
* MenuItem component for rendering an item to live in a menu or similar styled items
*
* {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/Menu.tsx | Example code}
*/
export declare class MenuItem extends React.Component<MenuItemProps> {
private get styles();
private get textColor();
private get iconColor();
private get textStyle();
private onPress;
private getStateStyle;
render(): React.ReactNode;
}
//# sourceMappingURL=index.d.ts.map