Please use the i3 (yambar-modules-i3(5)) module, as it is fully compatible with Sway
yambar-modules(5), yambar-modules-i3(5)
yambar-modules(5).