California will require presidential candidates to hand over their tax returns in order to appear on the state’s primary-election ballot, setting up a likely legal conflict with President Trump over his continued refusal to disclose any tax documents.

Under a law signed Tuesday by Gov. Gavin Newsom, candidates must turn over five years of tax returns at least 98 days before the March 3 primary. The state would then release a redacted version of the documents.

“These...