new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

IBM Carbon · all subjects

toggle/accessibility

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Toggle keyboard interaction

Each toggle is in the tab order. Pressing Enter or Space changes the toggle's state between off and on.

Toggle redundant state indication

Carbon's default toggle uses both color and text to indicate on or off state. Where space constraints make a smaller toggle desirable, Carbon adds a tickmark to the toggle's "on" state so that the component's on/off state can be distinguished without relying on color alone. The state is also captured programmatically for users who cannot see or understand the visual indicators.

Toggle label must not change with state

The toggle's label text must remain consistent and not change based on the on/off state. Only the state indicator text ("On" or "Off") should change, not the label itself.

Toggle ARIA implementation

Toggle is implemented as a button with a role of "switch". "On" and "off" text is aria-hidden; the state of the toggle is surfaced with aria-checked set to "true" or "false". The toggle's label is set with the for attribute.

Toggle tickmark variation for space constraints

Where space is confined, use the tickmark variation in lieu of on/off text to indicate the toggle's "on" state.

Toggle no accessibility annotations needed

No accessibility annotations are needed for toggles when using the default Carbon component.

Give your agent this brain