polite versus assertive: escolhendo a urgência
Decida se uma atualização interromperá a pessoa.
polite versus assertive: escolhendo a urgência é uma aula grátis de Web Accessibility Academy no CoddyKit. Esta é a aula 1 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Web Accessibility Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Web Accessibility Academy inclui 4 aulas no total.
Partes desta aula ainda não foram traduzidas e aparecem em inglês.
What a Live Region Is
A live region is an element a screen reader watches, so it speaks any text that changes inside it without the user moving focus there.
Two Politeness Levels
The aria-live attribute has two useful values you will reach for constantly: polite and assertive. They decide how an update is delivered. 🔊
Polite Waits Its Turn
With polite, the screen reader finishes whatever it is saying, then reads your update. It never cuts the user off mid-sentence.
<div aria-live="polite">Draft saved</div>Assertive Interrupts Now
With assertive, the screen reader stops what it is reading and announces your update right away. Use it only when waiting would cost the user.
<div aria-live="assertive">Connection lost</div>Polite Is the Default Choice
Reach for polite almost every time. Save, sort, filter, and progress updates can all wait a beat without confusing anyone.
Save Assertive for Real Urgency
Use assertive only for things the user must hear immediately, like a failed payment or a session about to expire.
There Is Also Off
The value off tells the screen reader to ignore changes in that element. It is the implicit default for elements you have not marked as live.
<div aria-live="off">Silent updates</div>The Region Must Exist First
The live element should be in the DOM before the text changes. Screen readers watch existing regions, so add it empty and fill it later.
<div id="msg" aria-live="polite"></div>Change Text, Not the Region
Announce by updating the text content inside the existing region. Swapping the whole region out can make the announcement silently fail.
document.getElementById('msg').textContent = 'Saved';Assertive Can Pile Up
Fire several assertive updates fast and they fight each other, interrupting and talking over the last one. Polite queues them in order instead.
Match Urgency to Impact
Pick the level by asking how much an interruption helps. Most updates: polite. Errors and warnings the user must act on: assertive.
Quick Check
You add a small confirmation that a list was sorted. Which politeness level fits best?
Recap: Choosing Urgency
You learned that polite waits and assertive interrupts. Default to polite, reserve assertive for true urgency, and keep the region in the DOM. ✅
Perguntas Frequentes
A aula “polite versus assertive: escolhendo a urgência” é grátis?
Sim — o texto completo de “polite versus assertive: escolhendo a urgência” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Web Accessibility Academy, atualize para CoddyKit PRO. O curso de Web Accessibility Academy inclui 4 aulas no total.
O que vou aprender em “polite versus assertive: escolhendo a urgência”?
Decida se uma atualização interromperá a pessoa. Você pratica Web Accessibility Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.
Preciso ter experiência prévia para começar Web Accessibility Academy?
Nenhuma experiência prévia é necessária. Web Accessibility Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 1 de 4.
Quanto tempo leva a aula “polite versus assertive: escolhendo a urgência”?
A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.
Posso escrever e executar código nesta aula de Web Accessibility Academy?
Sim. Cada aula de Web Accessibility Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.
Todas as aulas deste curso
- polite versus assertive: escolhendo a urgência
- Papéis status, alert e log
- Anunciando notificações, carregamentos e contagens
- Por que regiões dinâmicas falham e como corrigi-las