interface AccordionProps {
    background?: "transparent" | "white";
    children:
        | string
        | number
        | bigint
        | boolean
        | ReactElement<any, string | JSXElementConstructor<any>>
        | Iterable<ReactNode, any, any>
        | ReactPortal
        | Promise<AwaitedReactNode>;
    className?: string;
    customAttribute?: {
        attribute: string;
        value: string | number;
    };
    defaultExpanded?: boolean;
    disabled?: boolean;
    expanded?: boolean;
    id: string;
    isLoading?: boolean;
    lang?: "sv" | "en";
    onChange?: ((expanded: undefined | boolean) => void);
    onClick?: (() => void);
}

Properties

background?: "transparent" | "white"

Background color for the AccordionSummary

children:
    | string
    | number
    | bigint
    | boolean
    | ReactElement<any, string | JSXElementConstructor<any>>
    | Iterable<ReactNode, any, any>
    | ReactPortal
    | Promise<AwaitedReactNode>

The content of the expansion panel. Provide one AccordionSummary element and one AccordionDetails element.

className?: string

Optional CSS class name.

customAttribute?: {
    attribute: string;
    value: string | number;
}

Used for tests. Clickable and requested subcomponents will be suffixed with "-[ComponentName]".

defaultExpanded?: boolean

Initially expanded on page load

disabled?: boolean

If true, the component is disabled.

expanded?: boolean

If you want to use the controlled version of Accordion

id: string

A unique ID for the accordion. Used internally for setting WAI-ARIA relationships

isLoading?: boolean

If true, a loading skeleton will be rendered instead of the component.

lang?: "sv" | "en"

Language used for internal translations.

onChange?: ((expanded: undefined | boolean) => void)

Callback when accordion is changed.

onClick?: (() => void)

Callback when Accordion is clicked.