react-native-screens
Version:
Native navigation primitives for your React Native app.
83 lines (69 loc) • 2.25 kB
text/typescript
'use client';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import type { ColorValue, ViewProps } from 'react-native';
import type {
DirectEventHandler,
Float,
WithDefault,
} from 'react-native/Libraries/Types/CodegenTypes';
// TODO: Report issue on RN repo, that nesting color value inside a struct does not work.
// Generated code is ok, but the value is not passed down correctly - whatever color is set
// host component receives RGBA(0, 0, 0, 0) anyway.
// type TabBarAppearance = {
// backgroundColor?: ColorValue;
// };
export type NativeFocusChangeEvent = {
tabKey: string;
};
export type BlurEffect =
| 'none'
| 'extraLight'
| 'light'
| 'dark'
| 'regular'
| 'prominent'
| 'systemUltraThinMaterial'
| 'systemThinMaterial'
| 'systemMaterial'
| 'systemThickMaterial'
| 'systemChromeMaterial'
| 'systemUltraThinMaterialLight'
| 'systemThinMaterialLight'
| 'systemMaterialLight'
| 'systemThickMaterialLight'
| 'systemChromeMaterialLight'
| 'systemUltraThinMaterialDark'
| 'systemThinMaterialDark'
| 'systemMaterialDark'
| 'systemThickMaterialDark'
| 'systemChromeMaterialDark';
export interface NativeProps extends ViewProps {
// Events
onNativeFocusChange?: DirectEventHandler<NativeFocusChangeEvent>;
// Appearance
// tabBarAppearance?: TabBarAppearance; // Does not work due to codegen issue.
tabBarBackgroundColor?: ColorValue;
tabBarBlurEffect?: WithDefault<BlurEffect, 'none'>;
tabBarTintColor?: ColorValue;
tabBarItemTitleFontFamily?: string;
tabBarItemTitleFontSize?: Float;
tabBarItemTitleFontWeight?: string;
tabBarItemTitleFontStyle?: string;
tabBarItemTitleFontColor?: ColorValue;
tabBarItemTitlePositionAdjustment?: {
horizontal?: Float;
vertical?: Float;
};
tabBarItemIconColor?: ColorValue;
tabBarItemBadgeBackgroundColor?: ColorValue;
// Android
tabBarItemTitleFontColorActive?: ColorValue;
tabBarItemIconColorActive?: ColorValue;
tabBarItemTitleFontSizeActive?: Float;
// Control
// Experimental support
controlNavigationStateInJS?: WithDefault<boolean, false>;
}
export default codegenNativeComponent<NativeProps>('RNSBottomTabs', {
interfaceOnly: true,
});