I use a 23" cut down to 21.5". It's the minimum width that will accomodate my levers/grip shifters/bar ends/ plus room for hands in normal shifting position.
Riser bars force you to go wider due to the bar bends, so add ~1.5-2.0" over "straight" bar minimum width.
Also be aware that many carbon bars can't be cut down, unlike aluminum bars, according to mfg.
Actually the cf can be cut down, except the cutting action tends to delaminate edges of the end of bar - so use a sharp hacksaw blade and be careful. I follow-up cut by putting a heaping tablespoon of mixed slow cure epoxy into bar, then cap bar end with duct tape, place in vise in vertical position overnight, sand dried epoxy for nice finish. Repeat other end. This prevents cf delamination and adds a little crush strength for bar end mounting.