@prosperitainova/dumbo-react-native
Version:
Dumbo for React Native Library
54 lines • 2.19 kB
TypeScript
import React, { Ref } from 'react';
import { GestureResponderEvent, PressableProps, StyleProp, TextStyle, View, ViewStyle } from 'react-native';
import type { CarbonIcon } from '../../types/shared';
import { TextBreakModes, TextTypes } from '../Text';
/** Props for Link component */
export type LinkProps = {
/** Text to render */
text: string;
/** Icon to load on the left of text (size 20) */
leftIcon?: CarbonIcon;
/** Icon to load on the right of text (size 20) */
rightIcon?: CarbonIcon;
/** Icon size (if different than 20) */
iconSize?: number;
/** Indicate if link is disabled */
disabled?: boolean;
/** Text type to render (Standard is default) */
textType?: TextTypes;
/** Break mode for text. Default is to wrap text */
textBreakMode?: TextBreakModes;
/** Indicate if back button usage should be used */
backButtonMode?: boolean;
/** onPress event */
onPress?: (event: GestureResponderEvent) => void;
/** onLongPress event */
onLongPress?: (event: GestureResponderEvent) => void;
/** Indicate if keyboard should be dismissed onPress */
dismissKeyboardOnPress?: boolean;
/** Indicate if links are rendered on dark mode */
forceDarkMode?: boolean;
/** Style to set on the item */
style?: StyleProp<ViewStyle>;
/** Style to set on the text */
textStyle?: StyleProp<TextStyle>;
/** Direct props to set on the React Native component (including iOS and Android specific props). Most use cases should not need this. */
componentProps?: PressableProps;
/** Ref property for parent */
forwardRef?: Ref<View>;
};
/**
* Link component for rendering a link
*
* To not have a link be pressable 100% of screen format parent or pass style appropriately. `alignSelf: 'flex-start'` is useful.
*
* {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/Link.tsx | Example code}
*/
export declare class Link extends React.Component<LinkProps> {
private get textIconColor();
private get styles();
private get textStyle();
private onPress;
render(): React.ReactNode;
}
//# sourceMappingURL=index.d.ts.map