@gaddario98/react-native-core
Version:
```bash npm install @gaddario98/native ```
90 lines (86 loc) • 2.43 kB
TypeScript
import { HrefObject } from 'expo-router';
import React from 'react';
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
interface TabItemConfig {
name: string;
tabBarIcon?: (props: {
focused: boolean;
color: string;
size: number;
}) => React.ReactNode;
title?: string;
initialParams?: Record<string, any>;
href?: string | HrefObject;
badge?: number | string;
badgeColor?: string;
badgeTextColor?: string;
accessibilityLabel?: string;
}
type TabBarVariant = "auto" | "top" | "bottom";
type BarShadow = {
color?: string;
opacity?: number;
radius?: number;
offset?: {
height: number;
width: number;
};
elevation?: number;
};
type BarBorder = {
width?: number;
color?: string;
topOnly?: boolean;
};
interface TabLayoutProps {
tabs: Array<TabItemConfig>;
ns?: string;
initialRouteName?: string;
translateTitles?: boolean;
onTabChange?: (prev: string | undefined, next: string) => void;
bar?: {
height?: number;
position?: "absolute" | "relative";
margin?: {
bottom?: number;
horizontal?: number;
};
padding?: {
top?: number;
bottom?: number;
horizontal?: number;
};
rounded?: boolean | number;
radius?: number | {
topLeft?: number;
topRight?: number;
bottomLeft?: number;
bottomRight?: number;
};
colors?: {
background?: string;
activeTint?: string;
inactiveTint?: string;
border?: string;
shadow?: string;
surface?: string;
secondary?: string;
onSecondary?: string;
};
shadow?: boolean | BarShadow;
border?: boolean | BarBorder;
glass?: boolean | {
alpha?: number;
};
compact?: boolean;
useSafeAreaInset?: boolean;
style?: StyleProp<ViewStyle>;
itemStyle?: StyleProp<ViewStyle>;
labelStyle?: StyleProp<TextStyle>;
glowItemStyle?: StyleProp<ViewStyle>;
};
}
declare const _default: React.NamedExoticComponent<TabLayoutProps>;
declare const useActiveTab: <T extends string>() => T;
export { _default as TabLayout, useActiveTab };
export type { TabBarVariant, TabItemConfig, TabLayoutProps };