President Trump is showing it’s possible to preside over a period of peace and prosperity, and still be notably unpopular.

Over the past several months, Trump has opened even more of a wedge between the largely benign material conditions in the country and his own political standing, which is precarious and appears to be sliding backward. This isn’t how it’s supposed to work.

Republican politicos believed, reasonably enough, that last year’s tax cuts would stoke growth and create a good-news backdrop for Republicans in the midterms. The substantive part of this theory has worked swimmingly, with headlines just over the past week about middle-class incomes increasing over $61,000 for the first time, blue-collar jobs growing at their fastest clip in 30 years and small-business confidence reaching an all-time high.

The only flaw in their theory is that the drumbeat of good news has coincided, lately, with a drop in Trump’s numbers. In much of the recent polling, he’s dipped back under 40 percent after a steady, monthslong run of being at about 43 percent in the RealClearPolitics polling average.

He hasn’t done this with any spectacular misstep. What Trump has done, predictably, week after week, is mess up the easy stuff.

It’s not hard — through gritted teeth and insincerely, if necessary — to say the appropriate things about an American hero upon his passing.

It’s not hard to limit your tweets on the morning of September 11, for just a few hours, to the topic of the anniversary of the attacks and leave commentary on a recorded cable TV show for some other time.

It’s not hard to avoid attacking your own attorney general in public, repeatedly and in an escalating fashion meant to inflict the greatest possible humiliation.

It’s not hard to avoid throwing around the word “TREASON” loosely or to muse about changing the libel laws to exact legislative retribution on your critics.

Granted, it’s harder to build a cohesive White House team, but it ought to be easy to exclude volatile C-list stars from your old reality show and generate enough coherence to stem nonstop self-serving, backbiting leaks (let alone attacks on you in anonymous op-eds).

Any president grapples with the fact that he can’t control events; Trump grapples with the fact that he can’t control himself. He has dispensed with, to paraphrase Burke, the decent drapery of the American presidency, the norms devoted to investing the holder of the office — whether he deserves it or not — with a certain majesty.

Trump just lets it all hang out. This is gratifying to his core supporters, even as it creates a wearisome cycle of ceaseless controversies.

It’s not as though any one thing — the Stormy Daniels affair, the Cohen plea deal and the Manafort conviction, the security-clearance controversy, the Omarosa book, the anonymous op-ed, the Woodward book — is as consequential as it’s portrayed in any given news cycle, but one damn thing after another adds up.

Trump has an amazing ability, through the force of his personality and his instinct for the mediagenic provocations, to blot out the sun. He wouldn’t be president without this quality. It’s just that, given the positive state of the country, less blotting and more sun are called for.

Some caveats: Presidential popularity means something different in the age of Trump. He won election in 2016 with a favorable rating below 40 percent in many polls, so a return to that level may be less debilitating for him than for prior presidents.

Also notable is that he is confronted with an inflamed opposition, an extremely hostile press corps and a wide-ranging, aggressive special-counsel investigation.

While the economy is a positive, the tax-cut package is in the rearview mirror and not a highly emotive issue, so it makes sense for Trump to inject other topics — immigration, anthem protests, etc. — into the campaign.

Finally, although it seems that Democratic voters will be highly motivated to vote against any Republican this year, it’s still possible garden-variety Republicans will manage to distinguish themselves from Trump.

All that said, we might be at the peak of the business cycle, and yet the president who is presiding over the good times — and pushed for and signed the tax package that has boosted the recovery further — isn’t enjoying their full political benefit.

An economic boom is a terrible thing to waste.