UNPKG

@prosperitainova/dumbo-react-native

Version:
44 lines 1.54 kB
import React from 'react'; import { ViewProps, StyleProp, ViewStyle } from 'react-native'; /** Item to pass to Tabs */ export type TabItem = { /** Text to render */ text: string; /** Indicate if item is disabled */ disabled?: boolean; /** Any additional data needed to store for the callback */ data?: unknown; }; /** Props for Tabs component */ export type TabsProps = { /** Items to render in the tabs */ items: TabItem[]; /** Callback when switcher is changed */ onChange?: (index: number, item: TabItem) => void; /** Selected index */ selectedIndex?: number; /** Indicate if scroll mode should be used (when several tabs that will not fit this should be true) */ scrollMode?: 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?: ViewProps; }; /** * Tabs component for rendering tabs on the page * * {@link https://github.com/carbon-design-system/carbon-react-native/blob/main/example/src/Views/Tabs.tsx | Example code} */ export declare class Tabs extends React.Component<TabsProps> { state: { currentIndex: number; }; private get styles(); private changeItem; private getStateStyle; private getTab; componentDidUpdate(previousProps: TabsProps): void; componentDidMount(): void; render(): React.ReactNode; } //# sourceMappingURL=index.d.ts.map