@spark-web/accordion
Version:
--- title: Accordion storybookPath: data-display-accordion--single isExperimentalPackage: true ---
20 lines (19 loc) • 1.29 kB
TypeScript
import type { AccordionItemProps as RadixAccordionItemProps, AccordionMultipleProps, AccordionSingleProps } from '@radix-ui/react-accordion';
import type { BrighteTheme } from '@spark-web/theme';
import type { DataAttributeMap } from '@spark-web/utils/internal';
import type { RefAttributes } from 'react';
export declare type AccordionItemProps = Pick<RadixAccordionItemProps, 'children' | 'value'> & {
/** Sets data attributes on the component. */
data?: DataAttributeMap;
/** The html element to render the accordion item heading as. */
headingElement?: 'h2' | 'h3' | 'h4';
/** The heading of the accordion item. */
label: string;
/** The size of the heading. '1' is largest and '4' is smallest. */
level?: '1' | '2' | '3' | '4';
/** background colour of the component. */
background?: keyof BrighteTheme['color']['background'];
};
export declare function AccordionItem({ headingElement, background, children, data, label, level, value, }: AccordionItemProps): JSX.Element;
export declare type AccordionProps = (Omit<AccordionSingleProps, 'asChild'> & RefAttributes<HTMLDivElement>) | (Omit<AccordionMultipleProps, 'asChild'> & RefAttributes<HTMLDivElement>);
export declare function Accordion({ children, ...rest }: AccordionProps): JSX.Element;