Consider the following situation,
A batsman's bat breaks while hitting the ball after which a piece of the bat flies in the air, hits the stumps and the bails fall down.
Is this a dismissal by hit wicket?
Yes, the batsmen is out.
Refer first to Law 35 (Hit Wicket)
We need to check Law 28 to check the exact details of what constitutes 'Wicket put down'
That last line "or by any part of his bat becoming detached" covers the situation in the question. The batsmen is out.
Yes this is the dismissal by hit wicket:
So the batsman is given out in such cases.