2-3 yr gigs in 2025 is completely OK, we're not in the 80's and people are not expected to work many years for an employer, especially in the modern workplace where the "normal" way to get a promotion is job hopping.
FWIW I have several shorter gigs in my resume. A combination of me being still young and not evaluating things correctly, and employers not being honest about working conditions. I even once stayed at one job for less than 2 months, but to be honest I have left that one out of my CV.
One more thing: I've been on the hiring side a few times and I have observed that candidates with very long gigs (5+ years in the same job) are often seen negatively (Why did they stay in the same job for 6 years? Do they lack ambition? Don't they like a new challenge? Etc.)