MOUNTAIN VIEW — With rental costs skyrocketing and homes out of reach for many, Google has hit on a solution that may help it attract workers to the crushingly expensive Bay Area.

The tech giant plans to buy 300 units of modular housing to serve as temporary employee accommodations on its planned “Bay View” campus at NASA’s Moffett Field, according to a source familiar with the plan.

Experts heralded the move as not only good for Google, but as a potential template for others to follow as the high cost of construction combined with expensive real estate make affordable housing hard to come by.

Google’s move with prefabricated units is seen as a small but promising step toward solving the region’s housing crisis.

“That’s definitely a really great start,” said Wayne Chen, city of Mountain View housing and neighborhood services manager. “Any time we can find innovative ways to address the housing crisis is an opportunity that we really welcome.”

The Bay View project, which has been in the works for several years but plagued by delays, will consist of three large office buildings totaling about 600,000 square feet, according to a site assessment issued by NASA in July. It’s unclear when the project will be completed.

Google, which recently said it was finding it easier to hire people in Seattle than in the Bay Area because of this region’s sky-high housing costs, plans apartment-style, modular units at the Bay View campus. The company is also planning two additional campuses, massive developments in San Jose and Mountain View.

Get top headlines in your inbox every afternoon.

Sign up for the free PM Report newsletter.

The Mountain View search giant declined to provide details about its plan. The Wall Street Journal reported Wednesday that the project will cost $25 million to $30 million, and that Factory OS of Vallejo will build the units.

Rental housing providers see strong potential in factory-made, prefabricated homes to address the problem of scarce housing, said Charley Goss, spokesman for the San Francisco chapter of the California Apartment Association, which represents owners, developers and suppliers of rental housing.

“The housing crisis and the way that housing costs have risen requires cities and regions, the Bay Area specifically, to come up with alternate options that are creative and that are potentially less expensive,” Goss said. “People are excited about prefab housing — it’s a great option.”

Santa Clara County’s median single-family home price was $1.05 million in May, according to CoreLogic. Average rent for a 2-bedroom unit ranged from $3,500 in Palo Alto and $2,550 in San Jose down to $2,300 in Campbell-Saratoga, according to ApartmentList.

Not only does the lower cost of producing modular housing make building affordable homes more viable for developers, but factory-made units can be put up much faster than traditional homes, Goss said.

Modular housing has the potential to be “a real game changer” for the Bay Area housing crunch, said Matt Regan, senior vice-president of public policy at the Bay Area Council, a business group of which Google is a member.

“In the factory environment you have more controls and more oversight, and it’s more efficient,” Regan said.

“The end product is of the highest quality. It’s impossible to tell the difference between a modular construction project and a traditional project, other than that the modular goes up much quicker.”

The Bay Area boasts many sites suitable for modular rental housing, undeveloped so far largely because the cost of traditional building is too high for the rent the facilities could generate, Regan said.

With prefab housing costing up to 50 percent less, “all of a sudden sites like that become economically feasible to develop,” Regan said.

In Mountain View, factory-made units could fit very well with the city’s plans to address the affordable housing crisis as it develops the North Bayshore area and corridors along El Camino Real and San Antonio Road, Chen said.

“Modular is one way to make it easier to add housing in those areas,” Chen said.