react-redux-snackbar icon indicating copy to clipboard operation
react-redux-snackbar copied to clipboard

Apply custom styles to the snackbar

Open steblin opened this issue 8 years ago • 4 comments

I'd like to set width and text-align. How can I do that?

steblin avatar Oct 11 '17 17:10 steblin

Took a look into the code and that's how we can do that.

const snackStyles = {
  snack: {
    width: '300px',
    textAlign: 'center',
  },
};

<Snackbar customStyles={snackStyles}/>

Customizable are: snack(div wrapper), label(span) and button.

Think this should be added to the documentation.

steblin avatar Oct 12 '17 14:10 steblin

Ah, sorry, yes I will add that to the documentation :)

wireforce avatar Oct 13 '17 08:10 wireforce

Can we add css classes? Need to make it more responsive and would be much easier to do via @media targeting those classes.

Edit: Yes! (dist/components/Snackbar.js, line 239)

          "div",
          {
            style: this.populateStyles("snack"),
            onTransitionEnd: this.transitionEndHandler,
            className: "react-redux-snackbar" // add this line here
          }...

Then you can target the snackbar via .react-redux-snackbar

T620 avatar Jan 10 '19 10:01 T620

Is it possible to overwrite transform: translate(-50%, 0px); and position the snackbar anywhere on the screen, I have been trying to put in in the bottom left corner of the screen, but I can't seem to get rid of the position in the middle.

Thank you

girlslearningcodeyul avatar Sep 24 '21 19:09 girlslearningcodeyul