question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AppBar does not fill the top of the screen

See original GitHub issue

Problem description

The AppBar has small padding on left, right and top. Please check the image included and the code. And also, I don’t have any other CSS imported.

mui-issue

Minimal working code that reproduces the issue

import React from 'react';
import ReactDOM from 'react-dom';
import registerServiceWorker from './registerServiceWorker';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import tapEventPlugin from 'react-tap-event-plugin';
import AppBar from 'material-ui/AppBar';
import App from './components';
import { blueA200, orange900 } from 'material-ui/styles/colors'
const MLAppBar = (props) => (
    <AppBar
        title="MUI Sandbox"
        style={{backgroundColor: orange900 }}
    >
    </AppBar>
);
tapEventPlugin();
ReactDOM.render(<MuiThemeProvider><MLAppBar/></MuiThemeProvider>, document.getElementById('root'));
registerServiceWorker();

Versions

  • Material-UI: 0.18.5
  • React: 15.6.1
  • Browser: Chrome Version 59.0.3071.115 (Official Build) (64-bit)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

26reactions
oldocommented, Jan 27, 2019

If it helps anyone else, I was having this issue and it’s because I just copied the little snippet from the docs for AppBar component, including position="static". I removed this (so default fixed position was now used) and the little margin disappeared.

So previously was:

<AppBar position="static" color="default">

And I just changed to

<AppBar color="default">
16reactions
leedstyhcommented, Jul 6, 2017

Try adding margin:0px to body

Read more comments on GitHub >

github_iconTop Results From Across the Web

AppBar does not fill the top of the screen · Issue #7349 - GitHub
Problem description The AppBar has small padding on left, right and top. Please check the image included and the code.
Read more >
How to make an AppBar Component fill all div's width and 10 ...
This problem is caused by the browser. Every browser has its own default user agent stylesheet, you can see it in your dev-tooling....
Read more >
AppBar API - Material UI - MUI
API reference docs for the React AppBar component. Learn about the props, CSS, and other APIs of this exported module.
Read more >
Top app bar – Material Design 3
Top app bars display information and actions at the top of a screen, such as the page headline and shortcuts to actions like...
Read more >
Flutter TabBar: A complete tutorial with examples
TabBar enables you to improve the UX of your Flutter app by organizing content with tabs for users to tap and scroll through....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found