useDirection
Read the current text direction.
useDirection returns the current reading direction. Use it when your own
component needs to branch on direction — flipping a chevron, choosing an offset
sign, or mirroring a custom layout.
Usage
Return value
Returns 'ltr' \| 'rtl'. The value comes from the nearest
DirectionProvider, defaulting to 'ltr' when
there is none.
Prefer CSS logical properties (ps/pe, ms/me, start/end) for styling — they mirror automatically without a
hook. Reach for useDirection only when the decision happens in JavaScript. See RTL.