Skip to content

Commit c38da30

Browse files
authored
Add anatomy diagrams to React Aria docs (#1452)
1 parent c3db4cd commit c38da30

35 files changed

+940
-39
lines changed
Lines changed: 43 additions & 0 deletions
Loading

packages/@react-aria/breadcrumbs/docs/useBreadcrumbs.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default Layout;
1313
import docs from 'docs:@react-aria/breadcrumbs';
1414
import {HeaderInfo, FunctionAPI, TypeContext, InterfaceType} from '@react-spectrum/docs';
1515
import packageData from '@react-aria/breadcrumbs/package.json';
16+
import Anatomy from './anatomy.svg';
1617

1718
```jsx import
1819
import {useBreadcrumbs, useBreadcrumbItem} from '@react-aria/breadcrumbs';
@@ -52,8 +53,10 @@ Breadcrumbs provide a list of links to parent pages of the current page in heira
5253

5354
## Anatomy
5455

55-
Breadcrumbs consist of a navigation landmark element and a list of links. The last link
56-
represents the current page in the hierarchy, with the previous links representing the
56+
<Anatomy />
57+
58+
Breadcrumbs consist of a navigation landmark element and a list of links, typically with a visual separator
59+
icon between each item. The last link represents the current page in the hierarchy, with the previous links representing the
5760
parent pages of the current page. Each of these parent links can be clicked, tapped, or
5861
triggered via the <kbd>Enter</kbd> key to navigate to that page. Optionally, breadcrumbs can be used
5962
in place of a page title, in which case the last breadcrumb acts as a heading.
Lines changed: 26 additions & 0 deletions
Loading
Lines changed: 59 additions & 0 deletions
Loading

packages/@react-aria/checkbox/docs/useCheckbox.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import focusDocs from 'docs:@react-aria/focus';
1616
import statelyDocs from 'docs:@react-stately/toggle';
1717
import {HeaderInfo, FunctionAPI, TypeContext, InterfaceType, TypeLink} from '@react-spectrum/docs';
1818
import packageData from '@react-aria/checkbox/package.json';
19+
import Anatomy from './checkbox-anatomy.svg';
1920

2021
```jsx import
2122
import {useCheckbox} from '@react-aria/checkbox';
@@ -56,6 +57,8 @@ that can be styled as needed.
5657

5758
## Anatomy
5859

60+
<Anatomy />
61+
5962
A checkbox consists of a visual selection indicator and a label. Checkboxes support three
6063
selection states: checked, unchecked, and indeterminate. Users may click or touch a checkbox
6164
to toggle the selection state, or use the <kbd>Tab</kbd> key to navigate to it and the <kbd>Space</kbd> key to toggle it.

packages/@react-aria/checkbox/docs/useCheckboxGroup.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import focusDocs from 'docs:@react-aria/focus';
1616
import statelyDocs from 'docs:@react-stately/checkbox';
1717
import {HeaderInfo, FunctionAPI, TypeContext, InterfaceType, TypeLink} from '@react-spectrum/docs';
1818
import packageData from '@react-aria/checkbox/package.json';
19+
import Anatomy from './checkboxgroup-anatomy.svg';
1920

2021
```jsx import
2122
import {useCheckboxGroup, useCheckboxGroupItem} from '@react-aria/checkbox';
@@ -60,6 +61,8 @@ checkbox groups that can be styled as needed.
6061

6162
## Anatomy
6263

64+
<Anatomy />
65+
6366
A checkbox group consists of a set of checkboxes, and a label. Each checkbox
6467
includes a label and a visual selection indicator. Zero or more checkboxes
6568
within the group can be selected at a time. Users may click or touch a checkbox
Lines changed: 40 additions & 0 deletions
Loading

packages/@react-aria/dialog/docs/useDialog.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import overlaysDocs from 'docs:@react-aria/overlays';
1515
import focusDocs from 'docs:@react-aria/focus';
1616
import {HeaderInfo, FunctionAPI, TypeContext, InterfaceType, TypeLink} from '@react-spectrum/docs';
1717
import packageData from '@react-aria/dialog/package.json';
18+
import Anatomy from './anatomy.svg';
1819

1920
---
2021
category: Overlays
@@ -54,6 +55,8 @@ helps achieve accessible dialogs that can be styled as needed.
5455

5556
## Anatomy
5657

58+
<Anatomy />
59+
5760
A dialog consists of a container element and an optional title. `useDialog` handles
5861
exposing this to assistive technology using ARIA. It can be combined
5962
with <TypeLink links={overlaysDocs.links} type={overlaysDocs.exports.useModal} />, <TypeLink links={overlaysDocs.links} type={overlaysDocs.exports.usePreventScroll} />,

0 commit comments

Comments
 (0)