SAN FRANCISCO — The tech industry’s opposition to President Trump escalated Thursday as corporate leaders drafted a letter warning of the economic risks of his immigration policies, Uber’s chief executive quit an administration advisory board, and Lyft pulled its ads from Breitbart News, the site founded by White House chief strategist Stephen Bannon.

The developments followed remarks this week from Apple, Amazon and other companies, which said they were exploring legal action against Trump’s executive order that temporarily barred travelers from seven majority-Muslim countries. Amazon and Expedia also joined a lawsuit brought by the state of Washington against the immigration ban.

The actions underscored rising alarm along the West Coast’s tech archipelago from Silicon Valley to Seattle that Trump’s policies threaten a sector that has long been a driver of new wealth and innovation in an otherwise tepid economy. After trying to reach out to Trump by attending a meeting at his hotel in New York, tech companies are readying themselves for a high-stakes confrontation with the president.

Trump’s quest to tighten immigration has struck particularly hard at left-leaning Silicon Valley, which relies on a flow of high-level talent from India, East Asia and elsewhere and sees diversity as core to its identity as an innovation hub.

Some tech companies are now mulling whether to move jobs out of the United States to places with more relaxed immigration policies.