Is there a way to style Flowbite react components? Like, how do i make the navbar transparent.
<Navbar fluid={true} rounded={true}></Navbar>
Is there a way to style Flowbite react components? Like, how do i make the navbar transparent.
<Navbar fluid={true} rounded={true}></Navbar>
I've had this issue before. The issue here is that NavBar itself does not accept a className prop. You can see this inside the typescript definition here: Omit<PropsWithChildren<ComponentProps<'nav'>>, 'className'>
unless... wait... I just tried to find this piece of code in github and it was gone and className actually is accepted in the ts docs. As it turned out flowbite-react was just upgraded 7 days ago to v0.3:
https://github.com/themesberg/flowbite-react/commit/a7f839cc88e5c0beb1456d88f67b12d0b1b781cc
with the following commit message: enable classNames on components
All you have to do is upgrade the flowbite-react package
You can style the Navbar and other Flowbite React components using the className
prop.
For example, to make the navbar transparent, you can use the following TailwindCSS:
<Navbar fluid={true} rounded={true} className="bg-transparent"></Navbar>
See Navbar Source: https://github.com/themesberg/flowbite-react/blob/cdea61e56e89ee023e8a5daa4c1743692b8a3899/src/lib/components/Navbar/index.tsx#L18
TailwindCSS Background Color Docs: https://tailwindcss.com/docs/background-color
NOTE This is assuming you have setup TailwindCSS with Flowbite according this doc: https://flowbite.com/docs/getting-started/react/
Try using class
instead of className
. It worked for me.
Flowbite React Documentation : https://www.flowbite-react.com/docs/customize/theme