emilkowalski / sonner

An opinionated toast component for React.

Home Page:https://sonner.emilkowal.ski

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Positioning variable depending on breakpoint

DoctorSte opened this issue · comments

I want to set up my toast as 'top-right' on lg+ resolutions and 'bottom-centre' on all others.
Is there a way to do that through the Toaster options?

me too i need this?

these options have or not??

Not yet as far as I can tell. Even if positioning can be disabled so I can position it myself with Tailwind classes that would work. But of course a way to do that through props would be preferred.

You have window.innerWidth to detect width of your screen.

<Toaster position={window.innerWidth >= 1500 ? "top-center" : "top-left"} />

Let's use @aXenDeveloper for now.