By Grauert-Fischer Theorem, a smooth family of compact complex manifold is locally trivial if and only if all the fibers are analytically isomorphic.

However, there exist smooth families $\pi \colon X \to B$ such that the fibres are *not* isomorphic, and so they are *not* locally trivial.

The easiest examples occur already for $\dim X =2$ and $\dim B =1$: they are the so-called *Kodaira fibrations*. In such fibrations, all the fibres are smooth curves but their complex structure varies. Moreover, $X$ is projective, hence Kaeler, and $B$ is a curve of genus at least $2$.

A reference is [Barth-Hulek-Peters-Van de Ven, *Compact Complex Surfaces*], Chapter V.

For the Grauert-Fischer theorem see the same book, Chapter I.