react-native-accordion-wrapper
Version:
A handy wrapper of accordion behavior for react native components
23 lines (22 loc) • 746 B
TypeScript
import React from 'react';
import { TextStyle, ViewStyle } from 'react-native';
declare type Configs = {
title: string;
isExpandable: boolean;
titleStyle?: TextStyle;
itemWrapperStyle?: ViewStyle;
headerStyle?: ViewStyle;
children?: React.ReactNode;
childrenWrapperStyle?: ViewStyle;
rightChevronIcon?: JSX.Element;
initialExpandedState?: boolean;
onPress?: () => void;
onExpandStateChange?: (isExpanded: boolean) => void;
};
declare type AccordionItemProps = Configs & {
customHeaderItem?: (configs: Configs & {
isExpanded: boolean;
}) => JSX.Element;
};
declare const AccordionItem: ({ customHeaderItem, ...configs }: AccordionItemProps) => JSX.Element;
export default AccordionItem;