Open
Description
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Steps to reproduce
- create a basic accordion component
- create a component custom theme
- attach the custom theme to the accordion component
Current behavior
custom component theme doesn't change the accordion component styles
Expected behavior
custom component theme applies style changes to the accordion component
Context
What are you trying to accomplish? Small theme customization.
Does this only happen on a specific browser, screen size, or operating system? (Chrome/Safari, MacOS)
Example
import {
Accordion as AccordionComponent,
DeepPartial,
FlowbiteAccordionTheme,
} from "flowbite-react"
import { FC } from "react"
import { AccordionProps } from "./types"
const customTheme: DeepPartial<FlowbiteAccordionTheme> = {
title: {
base: "bg-blue-200 hover:bg-blue-100 hover:last-type:rounded-b-lg",
open: {
off: "",
on: "hover:last-type:rounded-b-0",
},
},
}
export const Accordion: FC<AccordionProps> = ({ panels, alwaysOpen }) => (
<AccordionComponent alwaysOpen={alwaysOpen} collapseAll theme={customTheme}>
{panels.map((el) => (
<AccordionComponent.Panel key={el.id}>
<AccordionComponent.Title>
{el.icon && <span className={`${customTheme.icon}`}>{el.icon}</span>}
{el.title}
</AccordionComponent.Title>
<AccordionComponent.Content>{el.content}</AccordionComponent.Content>
</AccordionComponent.Panel>
))}
</AccordionComponent>
)

