Accessibility
ProNewA floating accessibility menu with text size, contrast, grayscale, highlighted links, a readable font, text spacing, a big cursor, paused animations, quick profiles and reset. Settings apply to the page or a container and are remembered.
Installation
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
Props
| Prop | Type | Default |
|---|---|---|
| target | React.RefObject<HTMLElement | null>The element the settings apply to. Defaults to the whole page. | — |
| position | "bottom-left" | "bottom-right" | "top-left" | "top-right"Corner the button sits in. | "bottom-left" |
| offset | numberDistance from the edges in pixels. | 16 |
| contained | booleanPositions the button inside the nearest `relative` parent instead of the window. | false |
| color | stringAccent color of the button, the switches and the active profile. | "#1d64ec" |
| tone | "tinted" | "plain"`tinted` washes the panel in the accent color, `plain` keeps it neutral. | "tinted" |
| title | stringHeading of the panel and name of the button. | "Accessibility" |
| profiles | booleanHides the quick profiles and shows only the individual settings. | true |
| defaultOpen | booleanOpens the panel on first render. | false |
| storageKey | string | nulllocalStorage key the settings are kept under. Pass `null` to keep nothing. | "accessibility" |
| onChange | (settings: AccessibilitySettings) => voidCalled with all settings whenever one changes, e.g. to pause your own JavaScript animations. | — |
| className | string | — |
Accessibility
- The button is named and opens a labelled, non-modal dialog; focus moves into it, Escape closes it and focus returns to the button.
- Every setting is a labelled switch, profiles are toggle buttons with aria-pressed, and settings are grouped under headings.
- The text size and a reset are announced politely; the stepper and reset buttons stay focusable when they have nothing to do, so focus is never dropped.
- The page stays usable while the panel is open, so changes can be seen as they are made. Under reduced motion the panel and switches move at once.