-
-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidebar.Item does not show correct active background color #1354
Comments
Hey @wwills2 , currently the For this you can use Sidebar Theme in order to change the default bg color to your custom one. Below is a code snippet which can help you to change the bg-color of the active item. import type { CustomFlowbiteTheme } from "flowbite-react" // this is only required if you're using TypeScript in your React/Nextjs/Remix project
// if TypeScript then use below code snippet
const customSidebarTheme: CustomFlowbiteTheme['sidebar'] = {
// other Sidebar Theme Options based on themes link shared above,
item: {
active: "active:bg-green-500 dark:active:bg-green-500"
}
}
// use below if you're using jsx
const customSidebarTheme = {
// other Sidebar Theme Options based on themes link shared above,
item: {
active: "active:bg-green-500 dark:active:bg-green-500"
}
}
return (
<Sidebar theme={customSidebarTheme}>
<Sidebar.Item active={true}>
This is a test item
</Sidebar.Item>
</Sidebar>
) this way you can change the default bg color to the one which you required. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
The Sidebar.Item component does not display custom tailwind css active background color after mouse click has been released, and displays the default bg-gray-100.
example:
the background color of this item should be bg-green-500 because the active prop is true, but the displayed color is bg-gray-100. the bg-green-500 only shows when a mouse click is held on the item, and returns to gray as soon as the click is released
To Reproduce
Expected behavior
that the active color enumerated in the tailwind css classname should be displayed when the active prop is true regardless of whether or not there is an active mouse click event
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: