That's a somewhat common problem that is usually caused by an intermittent connection at the back of the instrument cluster. If that's what is causing yours, and I would be it it is, it is fairly easily fixed. You can sometimes confirm this is the cause of that problem by seeing if the instruments come back on after a good sharp whack to the top of the cluster with the flat of your hand.
There are two multi-pin connectors on the backside of the instrument cluster and their design isn't exactly bulletproof. The usual fix is to remove the instrument cluster (an easy 5-10 minute job) and then very slightly/gently tweak (bend) each of the male contact pins so they fit more tightly & then reconnect the connectors.
A forum community dedicated to Jeep Wrangler owners and enthusiasts. Come join the discussion about reviews, performance, trail riding, gear, suspension, tires, classifieds, troubleshooting, maintenance, for all JL, JT, JK, TJ, YJ, and CJ models!