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

Support Banner Component #13100

Closed
MastroLindus opened this issue Oct 4, 2018 · 8 comments
Closed

Support Banner Component #13100

MastroLindus opened this issue Oct 4, 2018 · 8 comments
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process docs Improvements or additions to the documentation new feature New feature or request

Comments

@MastroLindus
Copy link

MastroLindus commented Oct 4, 2018

Hi,

If I am not mistaken there's no current support for the banner component:

https://material.io/design/components/banners.html

If it is not supported, are you planning to do it?
If it is provided, could you point me to its documentation?

Thanks and keep up the fantastic work!

Capture d’écran 2019-10-31 à 19 02 49

Benchmark

@oliviertassinari oliviertassinari added the design: material This is about Material Design, please involve a visual or UX designer in the process label Oct 4, 2018
@AirborneEagle
Copy link

I just noticed this as well.
Until a Banner Component is supported, what would be the best "work around" ,
maybe just a Paper that moves in, and contains some actions?

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 5, 2018

what would be the best "work around" ,
maybe just a Paper that moves in, and contains some actions?

@AirborneEagle Here is an idea. I hope that helps:

import React from "react";
import Box from "@material-ui/core/Box";
import CssBaseline from "@material-ui/core/CssBaseline";
import Paper from "@material-ui/core/Paper";
import Stack from "@material-ui/core/Stack";
import Avatar from "@material-ui/core/Avatar";
import Divider from "@material-ui/core/Divider";
import SignalWifiOffIcon from "@material-ui/icons/SignalWifiOff";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";

export default function Banner() {
  return (
    <React.Fragment>
      <CssBaseline />
      <Paper elevation={0} sx={{ p: 2, pb: 1 }}>
        <Stack spacing={2} direction="row" alignItems="center">
          <Avatar sx={{ bgcolor: "primary.main" }}>
            <SignalWifiOffIcon />
          </Avatar>
          <Typography variant="body2">
            You have lost connection to the internet. This app is offline.
          </Typography>
        </Stack>
        <Box sx={{ display: "flex", justifyContent: "flex-end" }}>
          <Button color="primary">Turn on wifi</Button>
        </Box>
      </Paper>
      <Divider />
    </React.Fragment>
  );
}

Screenshot 2021-04-16 at 01 30 54

https://codesandbox.io/s/oj1mzjmk06

@mbrookes mbrookes added the new feature New feature or request label Oct 5, 2018
@alexplumb
Copy link

I had to implement this in one of my projects and couldn't really find anything that fit the material design spec, so I've published the components I made: https://github.com/alexplumb/material-ui-banner

@oliviertassinari

This comment has been minimized.

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Jun 10, 2020
@vicasas
Copy link
Member

vicasas commented Apr 6, 2021

Should an example be added in the docs? It is not clear to me.

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 15, 2021

@vicasas I have updated my original comment to use v5. As for the best next step, I don't know. It seems trivial to implement with the system. I would propose we close. I can't remember the last time I saw this component in use.

@vicasas
Copy link
Member

vicasas commented Apr 17, 2021

@oliviertassinari If it is part of material design, shouldn't we have it the same? Even though it can be done with other components, I feel that it should exist as a quick-use component.

Developers will not want to spend time styling according to material design, they will wait for a solution delivered by MUI. As for example in Vuetify https://next.vuetifyjs.com/en/components/banners/

@oliviertassinari
Copy link
Member

@vicasas There isn't any specific about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design: material This is about Material Design, please involve a visual or UX designer in the process docs Improvements or additions to the documentation new feature New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants