Skip to content
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

Can't customize style for "title" in AppBar #1547

Closed
mwildehahn opened this issue Aug 29, 2015 · 4 comments
Closed

Can't customize style for "title" in AppBar #1547

mwildehahn opened this issue Aug 29, 2015 · 4 comments
Labels
component: app bar This is the name of the generic UI component, not the React module! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.

Comments

@mwildehahn
Copy link

No description provided.

@shaurya947
Copy link
Contributor

@mhahn if you see L121 of app-bar.jsx, if title is a React node (instead of a simple string), it is simply rendered inside a div.

So you could create your title as a React node, style it however you like, and then pass it as a prop. Here's a small example (using JSX syntax):

//in your render method

let myStyle = {
    backgroundColor: "red",
};

let fancyTitle = (
      <span style={myStyle}>
        My Title Text
      </span>
    );

...

<AppBar
    title={fancyTitle}
    iconClassNameRight="muidocs-icon-navigation-expand-more" />

@oliviertassinari
Copy link
Member

This is almost a duplicate of #1645.

@shaurya947
Copy link
Contributor

Thanks @oliviertassinari!

@mwildehahn
Copy link
Author

Oh I missed that, thanks!
On Tue, Sep 22, 2015 at 2:31 PM Shaurya Arora [email protected]
wrote:

Thanks @oliviertassinari https://github.com/oliviertassinari!


Reply to this email directly or view it on GitHub
#1547 (comment)
.

@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 25, 2022
@zannager zannager added component: app bar This is the name of the generic UI component, not the React module! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: app bar This is the name of the generic UI component, not the React module! package: styles Specific to @mui/styles. Legacy package, @material-ui/styled-engine is taking over in v5.
Projects
None yet
Development

No branches or pull requests

4 participants