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/react-aria-components/docs/GridList.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -315,7 +315,7 @@ HTML lists are meant for static content, rather than lists with rich interaction
315
315
***Item selection** – Single or multiple selection, with optional checkboxes, disabled rows, and both `toggle` and `replace` selection behaviors.
316
316
***Interactive children** – List items may include interactive elements such as buttons, checkboxes, menus, etc.
317
317
***Actions** – Items support optional row actions such as navigation via click, tap, double click, or <Keyboard>Enter</Keyboard> key.
318
-
***Async loading** – Support for loading items asynchronously, with infinite and virtualized scrolling.
318
+
***Async loading** – Support for loading items asynchronously.
319
319
***Keyboard navigation** – List items and focusable children can be navigated using the arrow keys, along with page up/down, home/end, etc. Typeahead, auto scrolling, and selection modifier keys are supported as well.
320
320
***Touch friendly** – Selection and actions adapt their behavior depending on the device. For example, selection is activated via long press on touch when item actions are present.
321
321
***Accessible** – Follows the [ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/), with additional selection announcements via an ARIA live region. Extensively tested across many devices and [assistive technologies](accessibility.html#testing) to ensure announcements and behaviors are consistent.
Copy file name to clipboardExpand all lines: packages/react-aria-components/docs/Table.mdx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -388,7 +388,7 @@ HTML tables are meant for static content, rather than tables with rich interacti
388
388
***Columns** – Support for column sorting, [row header](https://www.w3.org/TR/wai-aria-1.1/#rowheader) columns, and nested column groups.
389
389
***Interactive children** – Table cells may include interactive elements such as buttons, menus, etc.
390
390
***Actions** – Rows and cells support optional actions such as navigation via click, tap, double click, or <Keyboard>Enter</Keyboard> key.
391
-
***Async loading** – Support for loading and sorting items asynchronously, with infinite and virtualized scrolling.
391
+
***Async loading** – Support for loading and sorting items asynchronously.
392
392
***Keyboard navigation** – Table rows, cells, and focusable children can be navigated using the arrow keys, along with page up/down, home/end, etc. Typeahead, auto scrolling, and selection modifier keys are supported as well.
393
393
***Touch friendly** – Selection and actions adapt their behavior depending on the device. For example, selection is activated via long press on touch when row actions are present.
394
394
***Accessible** – Follows the [ARIA grid pattern](https://www.w3.org/WAI/ARIA/apg/patterns/grid/), with additional selection announcements via an ARIA live region. Extensively tested across many devices and [assistive technologies](accessibility.html#testing) to ensure announcements and behaviors are consistent.
Copy file name to clipboardExpand all lines: packages/react-aria-components/docs/react-aria-components.mdx
+4-142Lines changed: 4 additions & 142 deletions
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,7 @@ Compared with the React Aria hooks, the components provide a default DOM structu
68
68
69
69
## Status
70
70
71
-
React Aria Components is currently in **alpha**. This means APIs will likely change in future updates as we discover the best ways to use it, and there are some known bugs and limitations. That said, it is based on a solid and battle-tested foundation in React Aria, and we would love for you to try it out and give us feedback! This will directly help us shape the APIs and make it the best library it can be. Please report issues and feature requests [on GitHub](https://github.com/adobe/react-spectrum/issues).
71
+
React Aria Components is currently in **beta**. This means most APIs are stable but some changes may still occur, and there are some known bugs. That said, it is based on a solid and battle-tested foundation in React Aria, and we would love for you to try it out and give us feedback! Please report issues and feature requests [on GitHub](https://github.com/adobe/react-spectrum/issues).
React Aria Components do not include any styles by default, allowing you to build custom designs to fit your application or design system. Each component accepts the standard `className` and `style` props which enable using vanilla CSS, utility classes (e.g. Tailwind), CSS-in-JS (e.g. Styled Components), etc.
332
-
333
-
When a custom `className` is not provided, each component includes a default class name following the `react-aria-ComponentName` naming convention. You can use this to style a component with standard CSS without needing any custom classes.
334
-
335
-
```css render=false
336
-
.react-aria-Select {
337
-
/* ... */
338
-
}
339
-
```
340
-
341
-
### States
342
-
343
-
Some components support multiple UI states (e.g. pressed, hovered, selected, etc.). React Aria Components exposes states using DOM attributes, which can be targeted by CSS selectors. These are ARIA attributes wherever possible, or data attributes when a relevant ARIA attribute does not exist. They can be thought of like custom CSS pseudo classes. For example:
344
-
345
-
```css render=false
346
-
.react-aria-Item[data-selected] {
347
-
/* ... */
348
-
}
349
-
350
-
.react-aria-Item[data-focused] {
351
-
/* ... */
352
-
}
353
-
```
354
-
355
-
If you're using Tailwind CSS, you can use [ARIA states](https://tailwindcss.com/docs/hover-focus-and-other-states#aria-states) and [data attributes](https://tailwindcss.com/docs/hover-focus-and-other-states#data-attributes) as modifiers.
You can also use our Tailwind CSS [plugin](#tailwind-css-plugin) to get shortened modifiers.
364
-
365
-
In order to ensure high quality interactions across browsers and devices, React Aria Components includes states such as `data-hovered` and `data-pressed` which are similar to CSS pseudo classes such as `:hover` and `:active`, but work consistently between mouse, touch, and keyboard modalities. You can read more about thisin our [blog post series](../blog/building-a-button-part-1.html) and our [Interactions](interactions.html) overview.
366
-
367
-
All of the states and selectors for each component are listed in their respective documentation.
368
-
369
-
### Render props
370
-
371
-
The `className` and `style` props also accept functions which receive states forstyling. This lets you dynamically determine the classes or styles to apply, which is useful when using utility CSS libraries like [Tailwind](https://tailwindcss.com/).
Render props may also be used as children to alter what elements are rendered based on the current state. For example, you could render a checkmark icon when an item is selected.
380
-
381
-
```jsx
382
-
<Item>
383
-
{({isSelected}) => (
384
-
<>
385
-
{isSelected && <CheckmarkIcon />}
386
-
<span>Item</span>
387
-
</>
388
-
)}
389
-
</Item>
390
-
```
391
-
392
-
### Animation
393
-
394
-
Overlay components such as [Popover](Popover.html) and [Modal](Modal.html) support entry and exit animations via the `[data-entering]` and `[data-exiting]` states, or via the corresponding render prop functions. You can use these states to apply CSS keyframe animations. These components will automatically wait for any exit animations to complete before they are removed from the DOM.
395
-
396
-
```css render=false
397
-
.react-aria-Popover[data-entering] {
398
-
animation: slide 300ms;
399
-
}
400
-
401
-
.react-aria-Popover[data-exiting] {
402
-
animation: slide 300ms reverse;
403
-
}
404
-
405
-
@keyframes slide {
406
-
from {
407
-
transform: translateY(-20px);
408
-
opacity: 0;
409
-
}
410
-
411
-
to {
412
-
transform: translateY(0);
413
-
opacity: 1;
414
-
}
415
-
}
416
-
```
417
-
418
-
If you are using Tailwind CSS, we recommend using the [tailwindcss-animate](https://github.com/jamiebuilds/tailwindcss-animate) plugin. This includes utilities for building common animations such as fading, sliding, and zooming.
React Aria Components do not include any styles by default, allowing you to build custom designs to fit your application or design system. It works with any styling solution, including vanilla CSS, Tailwind CSS, CSS-in-JS, etc. See the [styling guide](styling.html) for full details.
425
332
426
333
## Examples
427
334
428
335
The documentation for each component includes many examples styled using vanilla CSS and the default class names. We also have an example of many of the components using Tailwind CSS. You can find the [code](https://github.com/adobe/react-spectrum/blob/main/examples/rac-tailwind/src/App.js) in the repo, as well as a [live demo](https://reactspectrum.blob.core.windows.net/reactspectrum/f239d0b1a96c3e6119135fe6bbf1994dc9984257/verdaccio/rac-tailwind/index.html).
429
336
430
-
## Tailwind CSSPlugin
431
-
432
-
There is a Tailwind CSS plugin available which makes styling different [states](#states) easier.
433
-
434
-
This allows an element with the `data-selected` attribute to be styled in Tailwind with`selected:` instead of`data-[selected]:`. Non-boolean data attributes follow the `{name}-{value}` pattern, so you can style an element with`data-orientation="horizontal"` using `orientation-horizontal:`.
435
-
436
-
To install:
437
-
438
-
```
439
-
yarn add tailwindcss-react-aria-components
440
-
```
441
-
442
-
Then add the plugin to your `tailwind.config.js` file:
443
-
444
-
```jsx
445
-
/** @type {import('tailwindcss').Config} */
446
-
module.exports = {
447
-
plugins: [
448
-
require('tailwindcss-react-aria-components')
449
-
],
450
-
}
451
-
```
452
-
453
-
You can optionally specify a prefix using `require('tailwindcss-react-aria-components')({prefix: 'rac'})`. This will allow you to use `rac-selected:` instead of`selected:`.
454
-
455
-
### Boolean states
456
-
457
-
The `data-pressed` state can be styled with`pressed:` like this:
458
-
459
-
```jsx
460
-
<Button className="pressed:bg-blue">
461
-
{/* ... */}
462
-
</Button>
463
-
```
464
-
465
-
### Non-boolean states
466
-
467
-
The `data-orientation="vertical"` state can be styled with`orientation-vertical:` like this:
468
-
469
-
```jsx
470
-
<Tabs className="orientation-vertical:flex-row">
471
-
{/* ... */}
472
-
</Tabs>
473
-
```
474
-
475
337
## Components
476
338
477
339
### Buttons
@@ -757,4 +619,4 @@ The `data-orientation="vertical"` state can be styled with `orientation-vertical
0 commit comments