JOHANNESBURG, South Africa (AP) _ Tens of thousands of black workers shunned jobs and schools Monday to protest South Africa's state of emergency, but the main effect appeared to be in areas noted for anti-apartheid activism.

The government said at least 80 percent of the nation's 1.7 million black students returned to school for resumption of classes after a six-week vacation. That would mean up to 340,000 stayed away in response to a call from militant youth leaders.

Black trade unions proclaimed a national ''day of action'' against the detention of more than 200 labor leaders, who are among an estimated 3,500 people held without charge.

Participation appeared spotty in the first concerted mass protest since the nationwide state of emergency was imposed June 12, according to employers and academic monitoring groups.

Up to 70 percent of workers stayed off the job at Port Elizabeth, or reported briefly and left. The industrial city on the Indian Ocean has been a center of protest during nearly two years of racial unrest in which more than 2,000 people have been killed.

Only scattered strikes occurred in most parts of the country, however, and the vital mining industry reported few problems.

Elijah Baraji, president of the Congress of South African Trade Unions and vice president of the National Union of Mineworkers, was released Friday after two weeks in detention, said Marcel Golding, spokesman for the mine workers.

''That's probably one reason why there hasn't been widespread action today in the mines,'' he said, adding that Baraji was granted freedom on conditions that bar him from leaving his house or being quoted.

Restrictions under the emergency include rules that prohibit journalists from reporting actions of security forces without official permission, publishing the names of detained people and quoting ''subversive statements,'' which are vaguely defined.

In calling for the day of action, including sit-down strikes and other on- the-job protests, the 500,000-member union Congress said detentions of labor leaders were causing havoc in industrial relations.

Employer groups have made the same complaint to President P.W. Botha's government, but also appealed to the unions to stop job actions that have plagued several industries since the emergency took effect.

The outlawed African National Congress, the main guerrilla movement fighting white rule, endorsed the day of protest.

A statement issued at its headquarters in Lusaka, Zambia, said: ''Let us make July 14 a day on which we bring our might to bear on the Botha regime. ... Let us act in unity, intensity the mass and armed actions, spread ungovernability to all corners of the land and move to people's power.''

A provincial supreme court hearing began Monday in Durban on a challenge of the emergency's legality by the Metal and Allied Workers Union. The union argued that Botha did not inform Parliament of the emergency decree, as required, and that the ban on ''subversive statements'' was too vague.

Militant youths called the school boycott to protest emergency detentions and new security measures at black schools that allow authorities to turn away suspected troublemakers, with no right of appeal, and require students to produce new identity cards on demand.

Many high schools appeared nearly deserted in Soweto, Alexandra, Tembisa and Vaal area black townships - all around Johannesburg - but reporters on the scene said attendance was near normal at primary schools.

Attendance was high in other areas and the government Bureau for Information issued a statement saying: ''With the exception of a small number of schools, pupils re-registered en masse across the country.''

Black schools have been a focus of protest since violence began in September 1984 against apartheid, the official policy that preserves privilege for South Africa's 5 million whites and denies rights to the 24 million blacks.

Many of those killed were blacks killed by other blacks in differences over apartheid.

Boycotts involved as many as 300,000 students before a partial state of emergency, later lifted, was declared last July.

The government has increased funds for black education, narrowing the gap between spending on whites and blacks to about 5-1, half the spread of a decade ago.