You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/dev/s2-docs/pages/react-aria/GridList.mdx
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -429,7 +429,7 @@ function AsyncLoadingExample() {
429
429
430
430
### Links
431
431
432
-
Use the `href` prop on a `<GridListItem>` to create a link. See the [framework setup guide](frameworks) to learn how to integrate with your framework. Link interactions vary depending on the selection behavior. See the [selection guide](selection?component=GridList#selection-behavior) for more details.
432
+
Use the `href` prop on a `<GridListItem>` to create a link. Link interactions vary depending on the selection behavior. See the [selection guide](selection?component=GridList#selection-behavior) for more details.
<Content>Due to [HTML spec limitations](https://github.com/w3c/html-aria/issues/473), GridListItems cannot be rendered as `<a>` elements. React Aria handles link clicks with JavaScript and triggers native navigation. When using a client-side router, use the `onAction` event to programmatically trigger navigation instead of the `href` prop.</Content>
Copy file name to clipboardExpand all lines: packages/dev/s2-docs/pages/react-aria/ListBox.mdx
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -196,7 +196,7 @@ function AsyncLoadingExample() {
196
196
197
197
### Links
198
198
199
-
Use the `href` prop on a `<ListBoxItem>` to create a link. See the [framework setup guide](frameworks) to learn how to integrate with your framework.
199
+
Use the `href` prop on a `<ListBoxItem>` to create a link.
200
200
201
201
By default, link items in a ListBox are not selectable, and only perform navigation when the user interacts with them. However, with `selectionBehavior="replace"`, items will be selected when single clicking or pressing the <Keyboard>Space</Keyboard> key, and navigate to the link when double clicking or pressing the <Keyboard>Enter</Keyboard> key.
202
202
@@ -214,6 +214,18 @@ import {ListBox, ListBoxItem} from 'react-aria-components';
214
214
</ListBox>
215
215
```
216
216
217
+
By default, links are rendered as an `<a>` element. Use the `render` prop to integrate your framework's link component. An `href` should still be passed to `ListBoxItem` so React Aria knows it is a link.
Copy file name to clipboardExpand all lines: packages/dev/s2-docs/pages/react-aria/Menu.mdx
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -285,7 +285,7 @@ import {Button} from 'vanilla-starter/Button';
285
285
286
286
### Links
287
287
288
-
Use the `href` prop on a `<MenuItem>` to create a link. See the [framework setup guide](frameworks) to learn how to integrate with your framework.
288
+
Use the `href` prop on a `<MenuItem>` to create a link.
289
289
290
290
```tsx render hideImports
291
291
"use client";
@@ -305,6 +305,18 @@ import {Button} from 'vanilla-starter/Button';
305
305
</MenuTrigger>
306
306
```
307
307
308
+
By default, links are rendered as an `<a>` element. Use the `render` prop to integrate your framework's link component. An `href` should still be passed to `MenuItem` so React Aria knows it is a link.
309
+
310
+
```tsx
311
+
<MenuItem
312
+
{...props}
313
+
render={domProps=>
314
+
'href'indomProps
315
+
? <RouterLink{...domProps} />
316
+
: <div{...domProps} />
317
+
} />
318
+
```
319
+
308
320
### Autocomplete
309
321
310
322
Popovers can include additional components as siblings of a menu. This example uses an [Autocomplete](Autocomplete) with a [SearchField](SearchField) to let the user filter the items.
Copy file name to clipboardExpand all lines: packages/dev/s2-docs/pages/react-aria/Table.mdx
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -261,7 +261,7 @@ function AsyncSortTable() {
261
261
262
262
### Links
263
263
264
-
Use the `href` prop on a `<Row>` to create a link. See the [framework setup guide](frameworks) to learn how to integrate with your framework. Link interactions vary depending on the selection behavior. See the [selection guide](selection) for more details.
264
+
Use the `href` prop on a `<Row>` to create a link. Link interactions vary depending on the selection behavior. See the [selection guide](selection) for more details.
<Content>Due to [HTML spec limitations](https://github.com/w3c/html-aria/issues/473), table rows cannot be rendered as `<a>` elements. React Aria handles link clicks with JavaScript and triggers native navigation. When using a client-side router, use the `onAction` event to programmatically trigger navigation instead of the `href` prop.</Content>
Copy file name to clipboardExpand all lines: packages/dev/s2-docs/pages/react-aria/Tabs.mdx
+10-40Lines changed: 10 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,46 +186,16 @@ function Example() {
186
186
187
187
### Links
188
188
189
-
Use the `href` prop on a `<Tab>` to create a link. See the [framework setup guide](frameworks) to learn how to integrate with your framework. This example uses a simple hash-based router to sync the selected tab to the URL.
Use the `href` prop on a `<Tab>` to create a link. By default, links are rendered as an `<a>` element. Use the `render` prop to integrate your framework's link component.
Use the `href` prop on a `<Tag>` to create a link. See the [framework setup guide](frameworks) to learn how to integrate with your framework.
81
+
Use the `href` prop on a `<Tag>` to create a link.
81
82
82
83
```tsx render
83
84
"use client";
@@ -95,6 +96,11 @@ import {TagGroup, Tag} from 'vanilla-starter/TagGroup';
95
96
</TagGroup>
96
97
```
97
98
99
+
<InlineAlertvariant="notice">
100
+
<Heading>Client-side routing</Heading>
101
+
<Content>Due to [HTML spec limitations](https://github.com/w3c/html-aria/issues/473), tags cannot be rendered as `<a>` elements. React Aria handles link clicks with JavaScript and triggers native navigation. When using a client-side router, use the `onAction` event to programmatically trigger navigation instead of the `href` prop.</Content>
102
+
</InlineAlert>
103
+
98
104
## Selection
99
105
100
106
Use the `selectionMode` prop to enable single or multiple selection. The selected items can be controlled via the `selectedKeys` prop, matching the `id` prop of the items. Items can be disabled with the `isDisabled` prop. See the [selection guide](selection?component=TagGroup) for more details.
0 commit comments