There is a wide variety of devices sold as soundbars.
Some have HDMI connections and internal amps.
Some have line-level analog connections and internal amps.
Some have speaker connections and no internal amps -- so you need a separate receiver for them.
And some have absurdly high prices for little content.
In other words, you have to shop carefully to get the type you need.
Note that soundbars with larger speakers usually will provide better sound than the ones with tiny speakers, but they'll also tend to cost more. Some have external "subwoofers" to improve the sound. I put the word "subwoofer" in quotes because they usually are nothing of the kind. They're frequently just separate woofers used to fill in the upper bass that the tiny speakers in the soundbar itself can't provide. Subwoofers typically have speakers larger than 8" in diameter plus their own builtin amplifier.