The 23-year-old is the Bluebirds first signing since they secured their promotion to the Premier League for next season.
Manager Neil Warnock said: "Josh is a player I've watched for a number of years now and he's always excited me when he runs with the ball.
"I think he's at the right age now with his best still to come. He can play an instrumental part in helping us to stay in the Premier League and I know he's looking forward to the challenge.
"He's been my number one target since the end of last season."