statisticsnorway / design-system

Statistics Norway's digital design system

Home Page:https://statisticsnorway.github.io/design-system/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Accordion props

alina-lapina opened this issue · comments

Suggestion

It could be nice to provide to Accordion header a fallback component (not a simple string) when the title is not fetched yet.

Background

In my project we use Accordion component this way:

<Accordion 
    header={isLoadingVersion 
        ? <Spinner/> 
        : `${origin?.title}`} 
    subHeader={origin.rank}
>

It's not allowed to provide components to the accordion header, it requires a string.
We have to show spinner, while the title downloads.