HOW can you change background colour Navbar #835
|
UTTER frustration to do the simplest of tasks like changing a color!!!! Trying to change the background for Navbar component <Navbar Background is NOT being applied! |
Replies: 6 comments 5 replies
|
by default the navbar use the colors from the theme u could create a custom theme and define there a colors.background for ur entire theme now keep in mind that the 1st one is affected by the blur effect that affect the color thats been displayed <Navbar
css={{
bg: "$blue600"
}}
containerCss={{
bg: "$blue600"
}}
>or play with these props to see where u find a combination that suits ur needs <Navbar
disableBlur={true}
css={{
bg: "$blue600"
}}
containerCss={{
bg: "$blue600"
bgBlur: "none"
}}
>also u could go and open a bug report |
|
Hey @shanewmurphy my apologies, the project is still in BETA version, we are working on creating a better DX regarding directly custom styles changes but it is not an easy task, as @Xariwey mentioned NextUI currently aims to work correctly with the theme colour palette, here's the scale, on the other hand, the navbar doesn't have a "color" prop yet (we hope to add it soon) but here's an example with custom colours https://codesandbox.io/s/sandpack-project-forked-5ceumh?file=/App.js:554-577 I hope it helps you 🙌🏻 |
|
Hi .. I ended up here due to trying to change the background color of the NavBar. At the beginning it was quite frustrating (I have been using Semantic-UI for the past years with React). Since the original post here, a new version of NextUI is out and there is, rightly enough, a prop --- .color where you can set a color. It sort of works out of the box but not quite or at least not on its own. I learn't this by the long route so I hope this will help anyone who didn't catch how this component works the first time around. :) |
|
I don’t use NextUI anymore, use tailwind & headless UI
… On 20 Oct 2022, at 22:18, Xariwey ***@***.***> wrote:
by default the navbar use the colors from the theme u could create a custom theme and define there a colors.background for ur entire theme
now
as far as i can tell there are 2 background in the navbar
1 is the one thats is displayed normally -> acces by css
2 is when the collapse menu is oppened -> acces by containerCss
keep in mind that the 1st one is affected by the blur effect that affect the color thats been displayed
<Navbar
css={{
bg: "$blue600"
}}
containerCss={{
bg: "$blue600"
}}
>
or play with these props to see where u find a combination that suits ur needs
<Navbar
disableBlur={true}
css={{
bg: "$blue600"
}}
containerCss={{
bg: "$blue600"
bgBlur: "none"
}}
>
also u could go and open a bug report
—
Reply to this email directly, view it on GitHub <#835 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4GAG5UHRTQKL6BEQXMOFDWEGZK5ANCNFSM6AAAAAARKNAAFI>.
You are receiving this because you authored the thread.
|
|
@Alanm63 NextUI components have a button called For navbar: To change the slots class names you need to use the https://codesandbox.io/p/sandbox/sharp-pine-4gmqpz?file=%2FApp.jsx%3A1%2C1&utm_medium=sandpack The V2 API is designed to be as easy as possible to modify the styles. import React from "react";
import { Navbar } from "@nextui-org/react";
export default function App() {
return (
<Navbar
classNames={{
base: "bg-primary/20 shadow-lg",
}}
>
...
</Navbar>
);
} |

by default the navbar use the colors from the theme u could create a custom theme and define there a colors.background for ur entire theme
now
as far as i can tell there are 2 background in the navbar
1 is the one thats is displayed normally -> acces by css
2 is when the collapse menu is oppened -> acces by containerCss
keep in mind that the 1st one is affected by the blur effect that affect the color thats been displayed
or play with these props to see where u find a combination that suits ur needs