diff --git a/packages/ui/src/oauth/oauth-button.tsx b/packages/ui/src/oauth/oauth-button.tsx index 002b0c5dc04..d02314cc7bb 100644 --- a/packages/ui/src/oauth/oauth-button.tsx +++ b/packages/ui/src/oauth/oauth-button.tsx @@ -19,9 +19,17 @@ const OAuthButton = React.forwardRef(function OAuthButton( ) { const { text, icon, compact = false, className = "", ...rest } = props; + // Compact mode hides the label, which leaves the button with nothing but an icon: + // no accessible name for assistive technology, and no way to tell providers apart + // for anyone who does not recognise the mark. Supplying the label as `aria-label` + // restores the name, and `title` gives sighted users a tooltip. Only applied when + // compact -- with the label visible, `aria-label` would needlessly shadow it. + const compactLabelProps = compact ? { title: text, "aria-label": text } : {}; + return (