Mastermindzh / react-cookie-consent

A small, simple and customizable cookie consent bar for use in React applications.
https://mastermindzh.github.io/react-cookie-consent/
MIT License
598 stars 84 forks source link

[Question] Design? #100

Closed Mistik closed 3 years ago

Mistik commented 3 years ago

Hi

Im trying to make my button for cookie consent appear in the bottom right corner, how can I do this?

Here is an example of what I mean image

Mastermindzh commented 3 years ago

Hey @Mistik

You can overwrite the style in code like so:

<CookieConsent
            style={{
              alignItems: "baseline",
              background: "#353535",
              color: "white",
              display: "block",
              left: "initial",
              right: "0",
              position: "absolute",
              width: "300px",
              zIndex: "999",
              margin: "20px"
            }}
          >

This will make the bar display as a sort of toastr in the bottom right: image

I also made a StackBlitz :smile:

You can change more css to get the look you desire, good luck!