diff --git a/.changeset/keyboard-screen-reader-support.md b/.changeset/keyboard-screen-reader-support.md
new file mode 100644
index 000000000..93bcc10b1
--- /dev/null
+++ b/.changeset/keyboard-screen-reader-support.md
@@ -0,0 +1,6 @@
+---
+"gitbook": patch
+"@gitbook/icons": patch
+---
+
+Add a skip link, keyboard navigation between content tabs, focusable table of contents toggles, and hide decorative icons from assistive technologies.
diff --git a/packages/gitbook/src/components/DocumentView/CodeBlock/CopyCodeButton.tsx b/packages/gitbook/src/components/DocumentView/CodeBlock/CopyCodeButton.tsx
index 7f4971749..1b66b2282 100644
--- a/packages/gitbook/src/components/DocumentView/CodeBlock/CopyCodeButton.tsx
+++ b/packages/gitbook/src/components/DocumentView/CodeBlock/CopyCodeButton.tsx
@@ -1,8 +1,7 @@
'use client';
-import React from 'react';
-
import { getCodeTextFromId } from './utils';
+import { useCopyToClipboard } from '@/components/hooks';
import { Button } from '@/components/primitives';
import { t, useLanguage } from '@/intl/client';
import { type ClassValue, tcls } from '@/lib/tailwind';
@@ -15,41 +14,30 @@ export function CopyCodeButton(props: { codeId: string; style: ClassValue }) {
const { codeId, style } = props;
const language = useLanguage();
- const [copied, setCopied] = React.useState(false);
-
- React.useEffect(() => {
- if (!copied) {
- return;
- }
-
- const timeout = setTimeout(() => {
- setCopied(false);
- }, 1000);
-
- return () => {
- clearTimeout(timeout);
- };
- }, [copied]);
+ const { copied, copy } = useCopyToClipboard();
const onClick = () => {
const codeText = getCodeTextFromId(codeId);
if (codeText === null) {
return;
}
-
- navigator.clipboard.writeText(codeText);
-
- setCopied(true);
+ copy(codeText);
};
return (
-
+ <>
+
+ {/* A label swap on the focused button isn't announced, the live region is. */}
+
+ {copied ? t(language, 'code_copied') : null}
+
+ >
);
}
diff --git a/packages/gitbook/src/components/DocumentView/Prompt/PromptActions.tsx b/packages/gitbook/src/components/DocumentView/Prompt/PromptActions.tsx
index f37e01b49..b60296893 100644
--- a/packages/gitbook/src/components/DocumentView/Prompt/PromptActions.tsx
+++ b/packages/gitbook/src/components/DocumentView/Prompt/PromptActions.tsx
@@ -5,6 +5,7 @@ import React from 'react';
import { Icon } from '@gitbook/icons';
import { type PromptActionId, setPromptAction, usePromptAction } from './promptAction';
+import { useCopyToClipboard } from '@/components/hooks';
import {
Button,
ButtonGroup,
@@ -27,25 +28,10 @@ export function PromptActions(props: { prompt: string; openInAIProviders: boolea
const { prompt, openInAIProviders } = props;
const language = useLanguage();
const selectedAction = usePromptAction();
- const [copied, setCopied] = React.useState(false);
-
- React.useEffect(() => {
- if (!copied) {
- return;
- }
-
- const timeout = setTimeout(() => {
- setCopied(false);
- }, COPIED_MESSAGE_DURATION);
-
- return () => {
- clearTimeout(timeout);
- };
- }, [copied]);
+ const { copied, copy } = useCopyToClipboard(COPIED_MESSAGE_DURATION);
const copyPrompt = () => {
- navigator.clipboard.writeText(prompt);
- setCopied(true);
+ copy(prompt);
};
// The pick follows the visitor from site to site, so fall back to copying wherever the agent
diff --git a/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.test.ts b/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.test.ts
new file mode 100644
index 000000000..50b91c090
--- /dev/null
+++ b/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.test.ts
@@ -0,0 +1,26 @@
+import { describe, expect, it } from 'bun:test';
+
+import { getNextTabIndex } from './DynamicTabs';
+
+describe('getNextTabIndex', () => {
+ it('moves with the arrow keys and wraps around', () => {
+ expect(getNextTabIndex('ArrowRight', 0, 3)).toBe(1);
+ expect(getNextTabIndex('ArrowRight', 2, 3)).toBe(0);
+ expect(getNextTabIndex('ArrowLeft', 0, 3)).toBe(2);
+ });
+
+ it('jumps to the first and last tab', () => {
+ expect(getNextTabIndex('Home', 2, 3)).toBe(0);
+ expect(getNextTabIndex('End', 0, 3)).toBe(2);
+ });
+
+ it('mirrors the arrows in right-to-left', () => {
+ expect(getNextTabIndex('ArrowLeft', 0, 3, true)).toBe(1);
+ expect(getNextTabIndex('ArrowRight', 0, 3, true)).toBe(2);
+ });
+
+ it('ignores other keys and an unknown tab', () => {
+ expect(getNextTabIndex('Enter', 0, 3)).toBeNull();
+ expect(getNextTabIndex('ArrowRight', -1, 3)).toBeNull();
+ });
+});
diff --git a/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx b/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx
index 4aef68fe0..e898f0f54 100644
--- a/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx
+++ b/packages/gitbook/src/components/DocumentView/Tabs/DynamicTabs.tsx
@@ -151,10 +151,15 @@ const TabItemList = memo(function TabItemList(props: {
}).filter((x) => x !== undefined),
[overflowing, tabs]
);
+ // Roving tabindex: one tab stop for the strip, the active tab when it isn't in the overflow menu.
+ const visibleTabs = tabs.filter((tab) => !overflowing.has(getTabButtonId(tab.id)));
+ const focusableTabId =
+ visibleTabs.find((tab) => tab.id === activeTabId)?.id ?? visibleTabs[0]?.id ?? null;
return (
;
isActive: boolean;
+ isFocusable: boolean;
isMeasuring: boolean;
tab: TabsItem;
onSelect: (tabId: string) => void;
}) {
- const { ref, tab, isActive, isMeasuring, onSelect } = props;
+ const { ref, tab, isActive, isFocusable, isMeasuring, onSelect } = props;
return (
) {
+ const current = event.target instanceof HTMLElement ? event.target : null;
+ if (current?.getAttribute('role') !== 'tab') {
+ return;
+ }
+ const tabs = Array.from(
+ event.currentTarget.querySelectorAll('[role="tab"]:not([disabled])')
+ );
+ const index = tabs.indexOf(current);
+ const isRTL = getComputedStyle(event.currentTarget).direction === 'rtl';
+ const next = getNextTabIndex(event.key, index, tabs.length, isRTL);
+ if (next === null) {
+ return;
+ }
+ event.preventDefault();
+ tabs[next]?.focus();
+}
+
+/**
+ * Index of the tab to focus for a key press, or null when the key doesn't move focus.
+ */
+export function getNextTabIndex(
+ key: string,
+ index: number,
+ count: number,
+ isRTL = false
+): number | null {
+ if (index < 0 || count === 0) {
+ return null;
+ }
+ const forward = isRTL ? 'ArrowLeft' : 'ArrowRight';
+ const backward = isRTL ? 'ArrowRight' : 'ArrowLeft';
+ switch (key) {
+ case forward:
+ return (index + 1) % count;
+ case backward:
+ return (index - 1 + count) % count;
+ case 'Home':
+ return 0;
+ case 'End':
+ return count - 1;
+ default:
+ return null;
+ }
+}
+
/**
* Get the ID for a tab button.
*/
diff --git a/packages/gitbook/src/components/Header/HeaderLinks.tsx b/packages/gitbook/src/components/Header/HeaderLinks.tsx
index 6ef92fbaf..6da478d05 100644
--- a/packages/gitbook/src/components/Header/HeaderLinks.tsx
+++ b/packages/gitbook/src/components/Header/HeaderLinks.tsx
@@ -9,7 +9,7 @@ interface HeaderLinksProps {
export async function HeaderLinks({ children, style }: HeaderLinksProps) {
return (
- .button+.button]:-ml-2 z-20 ml-auto flex min-w-9 shrink grow @7xl:grow-0 items-center justify-end @4xl:gap-x-6 gap-x-4',
@@ -17,6 +17,6 @@ export async function HeaderLinks({ children, style }: HeaderLinksProps) {
)}
>
{children}
-
+
);
}
diff --git a/packages/gitbook/src/components/PageBody/PageBody.tsx b/packages/gitbook/src/components/PageBody/PageBody.tsx
index 8d4e62d2f..795ba6c85 100644
--- a/packages/gitbook/src/components/PageBody/PageBody.tsx
+++ b/packages/gitbook/src/components/PageBody/PageBody.tsx
@@ -16,6 +16,7 @@ import { PageCover } from './PageCover';
import { PageFooterNavigation } from './PageFooterNavigation';
import { PageHeader } from './PageHeader';
import { PreservePageLayout } from './PreservePageLayout';
+import { MAIN_CONTENT_ID } from '@/components/layout';
import { getSpaceLanguage } from '@/intl/server';
import { t } from '@/intl/translate';
import type { GitBookSiteContext } from '@/lib/context';
@@ -103,6 +104,7 @@ export async function PageBody(props: {
/>
) : null}
+
diff --git a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx
index 4946b320e..697f9c355 100644
--- a/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx
+++ b/packages/gitbook/src/components/TableOfContents/ToggleableLinkItem.tsx
@@ -26,6 +26,7 @@ export function ToggleableLinkItem(
isActive || pathnames.some((pathname) => currentPagePath.startsWith(`${pathname}/`));
const [isOpen, setIsOpen] = React.useState(defaultIsOpen);
const hasBeenToggled = useRef(false);
+ const linkId = React.useId();
// Update the visibility of the children if one of the descendants becomes active.
React.useEffect(() => {
@@ -60,10 +61,16 @@ export function ToggleableLinkItem(
}
return (
-
+
{({ descendants, toggler }) => (
<>
& {
+ props: Pick & {
isActive: boolean;
onActiveClick?: () => void;
}
) {
- const { isActive, href, insights, children, onActiveClick } = props;
+ const { id, isActive, href, insights, children, onActiveClick } = props;
const handleClick = (event: React.MouseEvent) => {
if (isActive && onActiveClick) {
@@ -104,6 +111,7 @@ function LinkItem(
return (
>;
+ /** Id of the link the toggle belongs to, used as its accessible name. */
+ labelledBy: string;
children: (renderProps: {
descendants: React.ReactNode;
toggler: React.ReactNode;
}) => React.ReactNode;
}) {
- const { descendants, isOpen, setIsOpen } = props;
+ const { descendants, isOpen, setIsOpen, labelledBy } = props;
return props.children({
toggler: (
{
setIsOpen((prev) => !prev);
}}
@@ -144,8 +155,13 @@ function DescendantsRenderer(props: {
});
}
-function Toggler(props: { isLinkActive: boolean; isOpen: boolean; onToggle: () => void }) {
- const { isOpen, onToggle } = props;
+function Toggler(props: {
+ isLinkActive: boolean;
+ isOpen: boolean;
+ labelledBy: string;
+ onToggle: () => void;
+}) {
+ const { isOpen, labelledBy, onToggle } = props;
return (
);
}
diff --git a/packages/gitbook/src/components/hooks/index.ts b/packages/gitbook/src/components/hooks/index.ts
index a8d70b117..c29cea7d7 100644
--- a/packages/gitbook/src/components/hooks/index.ts
+++ b/packages/gitbook/src/components/hooks/index.ts
@@ -10,3 +10,4 @@ export * from './useNow';
export * from './useListOverflow';
export * from './useCurrentPageMetadata';
export * from './useBackToSpace';
+export * from './useCopyToClipboard';
diff --git a/packages/gitbook/src/components/hooks/useCopyToClipboard.ts b/packages/gitbook/src/components/hooks/useCopyToClipboard.ts
new file mode 100644
index 000000000..366cdadfe
--- /dev/null
+++ b/packages/gitbook/src/components/hooks/useCopyToClipboard.ts
@@ -0,0 +1,31 @@
+'use client';
+
+import React from 'react';
+
+/**
+ * Copy text to the clipboard and expose a `copied` flag that resets after `duration`.
+ * The flag is only set once the write succeeded.
+ */
+export function useCopyToClipboard(duration = 1000) {
+ const [copied, setCopied] = React.useState(false);
+
+ React.useEffect(() => {
+ if (!copied) {
+ return;
+ }
+ const timeout = setTimeout(() => setCopied(false), duration);
+ return () => clearTimeout(timeout);
+ }, [copied, duration]);
+
+ const copy = React.useCallback(async (text: string) => {
+ try {
+ await navigator.clipboard.writeText(text);
+ setCopied(true);
+ } catch {
+ // Clipboard access can be denied (permissions, insecure context): don't claim success.
+ setCopied(false);
+ }
+ }, []);
+
+ return { copied, copy };
+}
diff --git a/packages/gitbook/src/components/layout.ts b/packages/gitbook/src/components/layout.ts
index 57516f214..515029e17 100644
--- a/packages/gitbook/src/components/layout.ts
+++ b/packages/gitbook/src/components/layout.ts
@@ -50,3 +50,6 @@ export const SIDE_COLUMN_WITHOUT_HEADER_AND_COVER: ClassValue = [
'top-[240px]',
'h-[calc(100vh-240px)]',
];
+
+/** Id of the `` landmark, target of the skip link. */
+export const MAIN_CONTENT_ID = 'gitbook-main-content';
diff --git a/packages/gitbook/src/components/primitives/SkipToContent.tsx b/packages/gitbook/src/components/primitives/SkipToContent.tsx
new file mode 100644
index 000000000..e52bd9fc0
--- /dev/null
+++ b/packages/gitbook/src/components/primitives/SkipToContent.tsx
@@ -0,0 +1,19 @@
+'use client';
+
+import { MAIN_CONTENT_ID } from '../layout';
+import { tString, useLanguage } from '@/intl/client';
+
+/**
+ * Link shown on keyboard focus to jump over the header and navigation.
+ */
+export function SkipToContent() {
+ const language = useLanguage();
+ return (
+
+ {tString(language, 'skip_to_content')}
+
+ );
+}
diff --git a/packages/gitbook/src/intl/translations/ar.ts b/packages/gitbook/src/intl/translations/ar.ts
index 7f144b31e..652978725 100644
--- a/packages/gitbook/src/intl/translations/ar.ts
+++ b/packages/gitbook/src/intl/translations/ar.ts
@@ -10,6 +10,7 @@ export const ar: TranslationLanguage = {
switch_to_light_theme: 'التبديل إلى السمة الفاتحة',
switch_to_system_theme: 'التبديل إلى سمة النظام',
search: 'بحث',
+ skip_to_content: 'تخطي إلى المحتوى',
clear: 'مسح',
table_filtered_by_selection: 'يطابق الاختيار: ${1}',
table_clear_selection: 'مسح الاختيار',
diff --git a/packages/gitbook/src/intl/translations/bg.ts b/packages/gitbook/src/intl/translations/bg.ts
index 6720c6941..f15b58a77 100644
--- a/packages/gitbook/src/intl/translations/bg.ts
+++ b/packages/gitbook/src/intl/translations/bg.ts
@@ -10,6 +10,7 @@ export const bg: TranslationLanguage = {
switch_to_light_theme: 'Превключване към светла тема',
switch_to_system_theme: 'Превключване към системната тема',
search: 'Търсене',
+ skip_to_content: 'Към съдържанието',
clear: 'Изчистване',
table_filtered_by_selection: 'Съответства на избора: ${1}',
table_clear_selection: 'Изчисти избора',
diff --git a/packages/gitbook/src/intl/translations/cs.ts b/packages/gitbook/src/intl/translations/cs.ts
index d2d770fb4..57329bb94 100644
--- a/packages/gitbook/src/intl/translations/cs.ts
+++ b/packages/gitbook/src/intl/translations/cs.ts
@@ -10,6 +10,7 @@ export const cs: TranslationLanguage = {
switch_to_light_theme: 'Přepnout na světlý motiv',
switch_to_system_theme: 'Přepnout na systémový motiv',
search: 'Hledat',
+ skip_to_content: 'Přejít k obsahu',
clear: 'Vymazat',
table_filtered_by_selection: 'Odpovídá výběru: ${1}',
table_clear_selection: 'Zrušit výběr',
diff --git a/packages/gitbook/src/intl/translations/da.ts b/packages/gitbook/src/intl/translations/da.ts
index d2da3ac2e..5b232c556 100644
--- a/packages/gitbook/src/intl/translations/da.ts
+++ b/packages/gitbook/src/intl/translations/da.ts
@@ -10,6 +10,7 @@ export const da: TranslationLanguage = {
switch_to_light_theme: 'Skift til lyst tema',
switch_to_system_theme: 'Skift til systemtema',
search: 'Søg',
+ skip_to_content: 'Spring til indhold',
clear: 'Ryd',
table_filtered_by_selection: 'Matcher valg: ${1}',
table_clear_selection: 'Ryd valg',
diff --git a/packages/gitbook/src/intl/translations/de.ts b/packages/gitbook/src/intl/translations/de.ts
index 21793b1fc..1efe757f4 100644
--- a/packages/gitbook/src/intl/translations/de.ts
+++ b/packages/gitbook/src/intl/translations/de.ts
@@ -10,6 +10,7 @@ export const de: TranslationLanguage = {
switch_to_light_theme: 'Zum hellen Modus wechseln',
switch_to_system_theme: 'Zum Systemmodus wechseln',
search: 'Suche',
+ skip_to_content: 'Zum Inhalt springen',
clear: 'Löschen',
table_filtered_by_selection: 'Entspricht Auswahl: ${1}',
table_clear_selection: 'Auswahl zurücksetzen',
diff --git a/packages/gitbook/src/intl/translations/el.ts b/packages/gitbook/src/intl/translations/el.ts
index 3e7725229..cd6c9436d 100644
--- a/packages/gitbook/src/intl/translations/el.ts
+++ b/packages/gitbook/src/intl/translations/el.ts
@@ -10,6 +10,7 @@ export const el: TranslationLanguage = {
switch_to_light_theme: 'Αλλαγή σε φωτεινό θέμα',
switch_to_system_theme: 'Αλλαγή στο θέμα συστήματος',
search: 'Αναζήτηση',
+ skip_to_content: 'Μετάβαση στο περιεχόμενο',
clear: 'Εκκαθάριση',
table_filtered_by_selection: 'Ταιριάζει με την επιλογή: ${1}',
table_clear_selection: 'Εκκαθάριση επιλογής',
diff --git a/packages/gitbook/src/intl/translations/en.ts b/packages/gitbook/src/intl/translations/en.ts
index 18e68eb00..f8a4aa668 100644
--- a/packages/gitbook/src/intl/translations/en.ts
+++ b/packages/gitbook/src/intl/translations/en.ts
@@ -8,6 +8,7 @@ export const en = {
switch_to_light_theme: 'Switch to light theme',
switch_to_system_theme: 'Switch to system theme',
search: 'Search',
+ skip_to_content: 'Skip to content',
clear: 'Clear',
table_filtered_by_selection: 'Matches selection: ${1}',
table_clear_selection: 'Clear selection',
diff --git a/packages/gitbook/src/intl/translations/es.ts b/packages/gitbook/src/intl/translations/es.ts
index 1afbfad20..ed958f3b1 100644
--- a/packages/gitbook/src/intl/translations/es.ts
+++ b/packages/gitbook/src/intl/translations/es.ts
@@ -10,6 +10,7 @@ export const es: TranslationLanguage = {
switch_to_light_theme: 'Cambiar a tema claro',
switch_to_system_theme: 'Cambiar a tema del sistema',
search: 'Buscar',
+ skip_to_content: 'Saltar al contenido',
clear: 'Limpiar',
table_filtered_by_selection: 'Coincide con la selección: ${1}',
table_clear_selection: 'Borrar selección',
diff --git a/packages/gitbook/src/intl/translations/et.ts b/packages/gitbook/src/intl/translations/et.ts
index 119dd7ba6..005ec42f2 100644
--- a/packages/gitbook/src/intl/translations/et.ts
+++ b/packages/gitbook/src/intl/translations/et.ts
@@ -10,6 +10,7 @@ export const et: TranslationLanguage = {
switch_to_light_theme: 'Lülitu heledale teemale',
switch_to_system_theme: 'Lülitu süsteemi teemale',
search: 'Otsi',
+ skip_to_content: 'Liigu sisu juurde',
clear: 'Tühjenda',
table_filtered_by_selection: 'Vastab valikule: ${1}',
table_clear_selection: 'Tühjenda valik',
diff --git a/packages/gitbook/src/intl/translations/fi.ts b/packages/gitbook/src/intl/translations/fi.ts
index f4972dfaf..ab18074cd 100644
--- a/packages/gitbook/src/intl/translations/fi.ts
+++ b/packages/gitbook/src/intl/translations/fi.ts
@@ -10,6 +10,7 @@ export const fi: TranslationLanguage = {
switch_to_light_theme: 'Vaihda vaaleaan teemaan',
switch_to_system_theme: 'Vaihda järjestelmän teemaan',
search: 'Haku',
+ skip_to_content: 'Siirry sisältöön',
clear: 'Tyhjennä',
table_filtered_by_selection: 'Vastaa valintaa: ${1}',
table_clear_selection: 'Tyhjennä valinta',
diff --git a/packages/gitbook/src/intl/translations/fr.ts b/packages/gitbook/src/intl/translations/fr.ts
index e650faf2c..82a08987f 100644
--- a/packages/gitbook/src/intl/translations/fr.ts
+++ b/packages/gitbook/src/intl/translations/fr.ts
@@ -10,6 +10,7 @@ export const fr: TranslationLanguage = {
switch_to_light_theme: 'Activer le thème clair',
switch_to_system_theme: 'Utiliser le thème du système',
search: 'Rechercher',
+ skip_to_content: 'Aller au contenu',
clear: 'Effacer',
table_filtered_by_selection: 'Correspond à la sélection : ${1}',
table_clear_selection: 'Effacer la sélection',
diff --git a/packages/gitbook/src/intl/translations/he.ts b/packages/gitbook/src/intl/translations/he.ts
index d935c56c3..464c29e36 100644
--- a/packages/gitbook/src/intl/translations/he.ts
+++ b/packages/gitbook/src/intl/translations/he.ts
@@ -10,6 +10,7 @@ export const he: TranslationLanguage = {
switch_to_light_theme: 'מעבר לערכת נושא בהירה',
switch_to_system_theme: 'מעבר לערכת הנושא של המערכת',
search: 'חיפוש',
+ skip_to_content: 'דילוג לתוכן',
clear: 'ניקוי',
table_filtered_by_selection: 'תואם לבחירה: ${1}',
table_clear_selection: 'נקה בחירה',
diff --git a/packages/gitbook/src/intl/translations/hi.ts b/packages/gitbook/src/intl/translations/hi.ts
index 50aa2012d..d4cae1780 100644
--- a/packages/gitbook/src/intl/translations/hi.ts
+++ b/packages/gitbook/src/intl/translations/hi.ts
@@ -10,6 +10,7 @@ export const hi: TranslationLanguage = {
switch_to_light_theme: 'लाइट थीम पर जाएं',
switch_to_system_theme: 'सिस्टम थीम पर जाएं',
search: 'खोजें',
+ skip_to_content: 'सामग्री पर जाएं',
clear: 'साफ करें',
table_filtered_by_selection: 'चयन से मेल खाता है: ${1}',
table_clear_selection: 'चयन साफ़ करें',
diff --git a/packages/gitbook/src/intl/translations/hr.ts b/packages/gitbook/src/intl/translations/hr.ts
index 458cd5654..619a8a8be 100644
--- a/packages/gitbook/src/intl/translations/hr.ts
+++ b/packages/gitbook/src/intl/translations/hr.ts
@@ -10,6 +10,7 @@ export const hr: TranslationLanguage = {
switch_to_light_theme: 'Prebaci na svijetlu temu',
switch_to_system_theme: 'Prebaci na temu sustava',
search: 'Pretraži',
+ skip_to_content: 'Preskoči na sadržaj',
clear: 'Očisti',
table_filtered_by_selection: 'Odgovara odabiru: ${1}',
table_clear_selection: 'Očisti odabir',
diff --git a/packages/gitbook/src/intl/translations/hu.ts b/packages/gitbook/src/intl/translations/hu.ts
index 7477b129e..cbb399b01 100644
--- a/packages/gitbook/src/intl/translations/hu.ts
+++ b/packages/gitbook/src/intl/translations/hu.ts
@@ -10,6 +10,7 @@ export const hu: TranslationLanguage = {
switch_to_light_theme: 'Váltás világos témára',
switch_to_system_theme: 'Váltás rendszer témára',
search: 'Keresés',
+ skip_to_content: 'Ugrás a tartalomra',
clear: 'Törlés',
table_filtered_by_selection: 'Megfelel a kijelölésnek: ${1}',
table_clear_selection: 'Kijelölés törlése',
diff --git a/packages/gitbook/src/intl/translations/id.ts b/packages/gitbook/src/intl/translations/id.ts
index b278e403b..0d165bbed 100644
--- a/packages/gitbook/src/intl/translations/id.ts
+++ b/packages/gitbook/src/intl/translations/id.ts
@@ -10,6 +10,7 @@ export const id: TranslationLanguage = {
switch_to_light_theme: 'Beralih ke tema terang',
switch_to_system_theme: 'Beralih ke tema sistem',
search: 'Cari',
+ skip_to_content: 'Lewati ke konten',
clear: 'Bersihkan',
table_filtered_by_selection: 'Sesuai pilihan: ${1}',
table_clear_selection: 'Hapus pilihan',
diff --git a/packages/gitbook/src/intl/translations/it.ts b/packages/gitbook/src/intl/translations/it.ts
index 0609b8226..55cea5512 100644
--- a/packages/gitbook/src/intl/translations/it.ts
+++ b/packages/gitbook/src/intl/translations/it.ts
@@ -10,6 +10,7 @@ export const it: TranslationLanguage = {
switch_to_light_theme: 'Passa al tema chiaro',
switch_to_system_theme: 'Passa al tema di sistema',
search: 'Cerca',
+ skip_to_content: 'Vai al contenuto',
clear: 'Cancella',
table_filtered_by_selection: 'Corrisponde alla selezione: ${1}',
table_clear_selection: 'Cancella selezione',
diff --git a/packages/gitbook/src/intl/translations/ja.ts b/packages/gitbook/src/intl/translations/ja.ts
index 47c6e1009..ea5fe6f96 100644
--- a/packages/gitbook/src/intl/translations/ja.ts
+++ b/packages/gitbook/src/intl/translations/ja.ts
@@ -10,6 +10,7 @@ export const ja: TranslationLanguage = {
switch_to_light_theme: 'ライトテーマに切り替え',
switch_to_system_theme: 'システムのテーマに切り替え',
search: '検索',
+ skip_to_content: 'コンテンツへスキップ',
clear: 'クリア',
table_filtered_by_selection: '選択に一致: ${1}',
table_clear_selection: '選択をクリア',
diff --git a/packages/gitbook/src/intl/translations/ko.ts b/packages/gitbook/src/intl/translations/ko.ts
index eee5bc1d6..ba0e4016a 100644
--- a/packages/gitbook/src/intl/translations/ko.ts
+++ b/packages/gitbook/src/intl/translations/ko.ts
@@ -10,6 +10,7 @@ export const ko: TranslationLanguage = {
switch_to_light_theme: '라이트 테마로 전환',
switch_to_system_theme: '시스템 테마로 전환',
search: '검색',
+ skip_to_content: '본문으로 건너뛰기',
clear: '지우기',
table_filtered_by_selection: '선택과 일치: ${1}',
table_clear_selection: '선택 지우기',
diff --git a/packages/gitbook/src/intl/translations/lt.ts b/packages/gitbook/src/intl/translations/lt.ts
index bf8b98735..fd719e47d 100644
--- a/packages/gitbook/src/intl/translations/lt.ts
+++ b/packages/gitbook/src/intl/translations/lt.ts
@@ -10,6 +10,7 @@ export const lt: TranslationLanguage = {
switch_to_light_theme: 'Perjungti į šviesią temą',
switch_to_system_theme: 'Perjungti į sistemos temą',
search: 'Ieškoti',
+ skip_to_content: 'Pereiti prie turinio',
clear: 'Išvalyti',
table_filtered_by_selection: 'Atitinka pasirinkimą: ${1}',
table_clear_selection: 'Išvalyti pasirinkimą',
diff --git a/packages/gitbook/src/intl/translations/lv.ts b/packages/gitbook/src/intl/translations/lv.ts
index 4289d122c..87496874e 100644
--- a/packages/gitbook/src/intl/translations/lv.ts
+++ b/packages/gitbook/src/intl/translations/lv.ts
@@ -10,6 +10,7 @@ export const lv: TranslationLanguage = {
switch_to_light_theme: 'Pārslēgt uz gaišo motīvu',
switch_to_system_theme: 'Pārslēgt uz sistēmas motīvu',
search: 'Meklēt',
+ skip_to_content: 'Pāriet uz saturu',
clear: 'Notīrīt',
table_filtered_by_selection: 'Atbilst izvēlei: ${1}',
table_clear_selection: 'Notīrīt izvēli',
diff --git a/packages/gitbook/src/intl/translations/ms.ts b/packages/gitbook/src/intl/translations/ms.ts
index 0b411b55b..fff25f332 100644
--- a/packages/gitbook/src/intl/translations/ms.ts
+++ b/packages/gitbook/src/intl/translations/ms.ts
@@ -10,6 +10,7 @@ export const ms: TranslationLanguage = {
switch_to_light_theme: 'Tukar kepada tema cerah',
switch_to_system_theme: 'Tukar kepada tema sistem',
search: 'Cari',
+ skip_to_content: 'Langkau ke kandungan',
clear: 'Kosongkan',
table_filtered_by_selection: 'Sepadan dengan pilihan: ${1}',
table_clear_selection: 'Kosongkan pilihan',
diff --git a/packages/gitbook/src/intl/translations/nl.ts b/packages/gitbook/src/intl/translations/nl.ts
index 2512af767..052687f8f 100644
--- a/packages/gitbook/src/intl/translations/nl.ts
+++ b/packages/gitbook/src/intl/translations/nl.ts
@@ -10,6 +10,7 @@ export const nl: TranslationLanguage = {
switch_to_light_theme: 'Schakel over naar lichte modus',
switch_to_system_theme: 'Schakel over naar systeemmodus',
search: 'Zoeken',
+ skip_to_content: 'Naar inhoud',
clear: 'Wissen',
table_filtered_by_selection: 'Komt overeen met selectie: ${1}',
table_clear_selection: 'Selectie wissen',
diff --git a/packages/gitbook/src/intl/translations/no.ts b/packages/gitbook/src/intl/translations/no.ts
index 59129f181..e334b5367 100644
--- a/packages/gitbook/src/intl/translations/no.ts
+++ b/packages/gitbook/src/intl/translations/no.ts
@@ -10,6 +10,7 @@ export const no: TranslationLanguage = {
switch_to_light_theme: 'Bytt til lyst tema',
switch_to_system_theme: 'Bytt til systemtema',
search: 'Søk',
+ skip_to_content: 'Hopp til innhold',
clear: 'Tøm',
table_filtered_by_selection: 'Samsvarer med valg: ${1}',
table_clear_selection: 'Fjern valg',
diff --git a/packages/gitbook/src/intl/translations/pl.ts b/packages/gitbook/src/intl/translations/pl.ts
index 6893b514d..4f3882bb1 100644
--- a/packages/gitbook/src/intl/translations/pl.ts
+++ b/packages/gitbook/src/intl/translations/pl.ts
@@ -10,6 +10,7 @@ export const pl: TranslationLanguage = {
switch_to_light_theme: 'Przełącz na jasny motyw',
switch_to_system_theme: 'Przełącz na motyw systemowy',
search: 'Szukaj',
+ skip_to_content: 'Przejdź do treści',
clear: 'Wyczyść',
table_filtered_by_selection: 'Zgodne z wyborem: ${1}',
table_clear_selection: 'Wyczyść wybór',
diff --git a/packages/gitbook/src/intl/translations/pt-br.ts b/packages/gitbook/src/intl/translations/pt-br.ts
index 97aea776a..fad76f05a 100644
--- a/packages/gitbook/src/intl/translations/pt-br.ts
+++ b/packages/gitbook/src/intl/translations/pt-br.ts
@@ -10,6 +10,7 @@ export const pt_br: TranslationLanguage = {
switch_to_light_theme: 'Mudar para modo claro',
switch_to_system_theme: 'Mudar para configuração do sistema',
search: 'Buscar',
+ skip_to_content: 'Pular para o conteúdo',
clear: 'Limpar',
table_filtered_by_selection: 'Corresponde à seleção: ${1}',
table_clear_selection: 'Limpar seleção',
diff --git a/packages/gitbook/src/intl/translations/pt.ts b/packages/gitbook/src/intl/translations/pt.ts
index 12ab39367..2992f6e0e 100644
--- a/packages/gitbook/src/intl/translations/pt.ts
+++ b/packages/gitbook/src/intl/translations/pt.ts
@@ -10,6 +10,7 @@ export const pt: TranslationLanguage = {
switch_to_light_theme: 'Mudar para o tema claro',
switch_to_system_theme: 'Mudar para o tema do sistema',
search: 'Pesquisar',
+ skip_to_content: 'Saltar para o conteúdo',
clear: 'Limpar',
table_filtered_by_selection: 'Corresponde à seleção: ${1}',
table_clear_selection: 'Limpar seleção',
diff --git a/packages/gitbook/src/intl/translations/ro.ts b/packages/gitbook/src/intl/translations/ro.ts
index aa79c5068..aff13568c 100644
--- a/packages/gitbook/src/intl/translations/ro.ts
+++ b/packages/gitbook/src/intl/translations/ro.ts
@@ -10,6 +10,7 @@ export const ro: TranslationLanguage = {
switch_to_light_theme: 'Comută la tema luminoasă',
switch_to_system_theme: 'Comută la tema sistemului',
search: 'Caută',
+ skip_to_content: 'Salt la conținut',
clear: 'Șterge',
table_filtered_by_selection: 'Se potrivește cu selecția: ${1}',
table_clear_selection: 'Șterge selecția',
diff --git a/packages/gitbook/src/intl/translations/ru.ts b/packages/gitbook/src/intl/translations/ru.ts
index bd845223a..a8e2a7337 100644
--- a/packages/gitbook/src/intl/translations/ru.ts
+++ b/packages/gitbook/src/intl/translations/ru.ts
@@ -10,6 +10,7 @@ export const ru: TranslationLanguage = {
switch_to_light_theme: 'Переключиться на светлую тему',
switch_to_system_theme: 'Переключиться на системную тему',
search: 'Поиск',
+ skip_to_content: 'Перейти к содержимому',
clear: 'Очистить',
table_filtered_by_selection: 'Соответствует выбору: ${1}',
table_clear_selection: 'Очистить выбор',
diff --git a/packages/gitbook/src/intl/translations/sk.ts b/packages/gitbook/src/intl/translations/sk.ts
index d47e7af5b..77e232de2 100644
--- a/packages/gitbook/src/intl/translations/sk.ts
+++ b/packages/gitbook/src/intl/translations/sk.ts
@@ -10,6 +10,7 @@ export const sk: TranslationLanguage = {
switch_to_light_theme: 'Prepnúť na svetlý motív',
switch_to_system_theme: 'Prepnúť na systémový motív',
search: 'Hľadať',
+ skip_to_content: 'Preskočiť na obsah',
clear: 'Vymazať',
table_filtered_by_selection: 'Zodpovedá výberu: ${1}',
table_clear_selection: 'Zrušiť výber',
diff --git a/packages/gitbook/src/intl/translations/sl.ts b/packages/gitbook/src/intl/translations/sl.ts
index 86b2c1b0f..926ddfe1d 100644
--- a/packages/gitbook/src/intl/translations/sl.ts
+++ b/packages/gitbook/src/intl/translations/sl.ts
@@ -10,6 +10,7 @@ export const sl: TranslationLanguage = {
switch_to_light_theme: 'Preklopi na svetlo temo',
switch_to_system_theme: 'Preklopi na sistemsko temo',
search: 'Išči',
+ skip_to_content: 'Preskoči na vsebino',
clear: 'Počisti',
table_filtered_by_selection: 'Ustreza izbiri: ${1}',
table_clear_selection: 'Počisti izbiro',
diff --git a/packages/gitbook/src/intl/translations/sv.ts b/packages/gitbook/src/intl/translations/sv.ts
index ff9e2a158..21d5d401a 100644
--- a/packages/gitbook/src/intl/translations/sv.ts
+++ b/packages/gitbook/src/intl/translations/sv.ts
@@ -10,6 +10,7 @@ export const sv: TranslationLanguage = {
switch_to_light_theme: 'Byt till ljust tema',
switch_to_system_theme: 'Byt till systemtema',
search: 'Sök',
+ skip_to_content: 'Hoppa till innehåll',
clear: 'Rensa',
table_filtered_by_selection: 'Matchar val: ${1}',
table_clear_selection: 'Rensa val',
diff --git a/packages/gitbook/src/intl/translations/th.ts b/packages/gitbook/src/intl/translations/th.ts
index 4e8fe976d..9896e71a5 100644
--- a/packages/gitbook/src/intl/translations/th.ts
+++ b/packages/gitbook/src/intl/translations/th.ts
@@ -10,6 +10,7 @@ export const th: TranslationLanguage = {
switch_to_light_theme: 'เปลี่ยนเป็นธีมสว่าง',
switch_to_system_theme: 'เปลี่ยนเป็นธีมของระบบ',
search: 'ค้นหา',
+ skip_to_content: 'ข้ามไปยังเนื้อหา',
clear: 'ล้าง',
table_filtered_by_selection: 'ตรงกับการเลือก: ${1}',
table_clear_selection: 'ล้างการเลือก',
diff --git a/packages/gitbook/src/intl/translations/tr.ts b/packages/gitbook/src/intl/translations/tr.ts
index 8f52ec617..704976489 100644
--- a/packages/gitbook/src/intl/translations/tr.ts
+++ b/packages/gitbook/src/intl/translations/tr.ts
@@ -10,6 +10,7 @@ export const tr: TranslationLanguage = {
switch_to_light_theme: 'Açık temaya geç',
switch_to_system_theme: 'Sistem temasına geç',
search: 'Ara',
+ skip_to_content: 'İçeriğe geç',
clear: 'Temizle',
table_filtered_by_selection: 'Seçimle eşleşiyor: ${1}',
table_clear_selection: 'Seçimi temizle',
diff --git a/packages/gitbook/src/intl/translations/uk.ts b/packages/gitbook/src/intl/translations/uk.ts
index 6d0b69984..c0f6a7bee 100644
--- a/packages/gitbook/src/intl/translations/uk.ts
+++ b/packages/gitbook/src/intl/translations/uk.ts
@@ -10,6 +10,7 @@ export const uk: TranslationLanguage = {
switch_to_light_theme: 'Перемкнути на світлу тему',
switch_to_system_theme: 'Перемкнути на системну тему',
search: 'Пошук',
+ skip_to_content: 'Перейти до вмісту',
clear: 'Очистити',
table_filtered_by_selection: 'Відповідає вибору: ${1}',
table_clear_selection: 'Очистити вибір',
diff --git a/packages/gitbook/src/intl/translations/vi.ts b/packages/gitbook/src/intl/translations/vi.ts
index 2053490bc..0f10784a9 100644
--- a/packages/gitbook/src/intl/translations/vi.ts
+++ b/packages/gitbook/src/intl/translations/vi.ts
@@ -10,6 +10,7 @@ export const vi: TranslationLanguage = {
switch_to_light_theme: 'Chuyển sang giao diện sáng',
switch_to_system_theme: 'Chuyển sang giao diện hệ thống',
search: 'Tìm kiếm',
+ skip_to_content: 'Chuyển đến nội dung',
clear: 'Xóa',
table_filtered_by_selection: 'Khớp với lựa chọn: ${1}',
table_clear_selection: 'Xóa lựa chọn',
diff --git a/packages/gitbook/src/intl/translations/yue.ts b/packages/gitbook/src/intl/translations/yue.ts
index c18667745..6b391efd4 100644
--- a/packages/gitbook/src/intl/translations/yue.ts
+++ b/packages/gitbook/src/intl/translations/yue.ts
@@ -10,6 +10,7 @@ export const yue: TranslationLanguage = {
switch_to_light_theme: '切換到淺色主題',
switch_to_system_theme: '切換到系統主題',
search: '搜尋',
+ skip_to_content: '跳至內容',
clear: '清除',
table_filtered_by_selection: '符合選擇:${1}',
table_clear_selection: '清除選擇',
diff --git a/packages/gitbook/src/intl/translations/zh-tw.ts b/packages/gitbook/src/intl/translations/zh-tw.ts
index 3156b36f3..c7ae33a46 100644
--- a/packages/gitbook/src/intl/translations/zh-tw.ts
+++ b/packages/gitbook/src/intl/translations/zh-tw.ts
@@ -10,6 +10,7 @@ export const zh_tw: TranslationLanguage = {
switch_to_light_theme: '切換至淺色主題',
switch_to_system_theme: '切換至系統主題',
search: '搜尋',
+ skip_to_content: '跳至內容',
clear: '清除',
table_filtered_by_selection: '符合選擇:${1}',
table_clear_selection: '清除選擇',
diff --git a/packages/gitbook/src/intl/translations/zh.ts b/packages/gitbook/src/intl/translations/zh.ts
index 150f100c4..a761991d4 100644
--- a/packages/gitbook/src/intl/translations/zh.ts
+++ b/packages/gitbook/src/intl/translations/zh.ts
@@ -10,6 +10,7 @@ export const zh: TranslationLanguage = {
switch_to_light_theme: '切换到浅色主题',
switch_to_system_theme: '切换到系统主题',
search: '搜索',
+ skip_to_content: '跳转到内容',
clear: '清除',
table_filtered_by_selection: '符合选择:${1}',
table_clear_selection: '清除选择',
diff --git a/packages/icons/src/Icon.tsx b/packages/icons/src/Icon.tsx
index c63b38c70..405763622 100644
--- a/packages/icons/src/Icon.tsx
+++ b/packages/icons/src/Icon.tsx
@@ -53,11 +53,14 @@ export const Icon = React.forwardRef(function Icon(
const [iconStyle, icon] = getIconStyle(propIconStyle, propIcon);
const source = context.iconSources?.[getInlineIconSourceKey(iconStyle, icon)];
const maskId = React.useId();
+ // Icons are decorative unless the caller names them; the control they sit in carries the name.
+ const isDecorative = !rest['aria-label'] && !rest['aria-labelledby'] && !rest.role;
if (source) {
return (