Aria-pressed vs role="switch"

I have been reading about these a lot and I can determine the difference between these two.

mdn says aria-pressed is supposed to be used for toggle "x" context, while switch is for specifically on and off semantic but these feel the same to me.

<button aria-pressed='true'>pause</button>

Vs

<button aria-checked='true' role='switch'>pause</button>


I'm not sure what the difference is here. I know aria pressed allows an intermediate state but if we only need on/off toggle do these both do the same thing?
Was this page helpful?