Skip to content

Conversation

@devongovett
Copy link
Member

Adds examples section to new RAC docs. Ports over a few examples from the old docs, and adds a few new ones.

A few other bug fixes are included:

  • Changed size() macro to return calc directly without wrapping in square brackets, enabling it to be interpolated into CSS strings.
  • Removed font-variation-settings from the Spectrum macro theme now that the Typekit issue has been fixed for a while. This was causing incorrect fonts to display in Tailwind and Vanilla CSS examples which were not overriding it.
  • Added support for standalone S2 Cards to render as links when they have an href. Such cards must not have interactive elements within them.
  • Fixed border-width of tertiary cards (random bug that was reported in Slack)
  • Fixed WaterfallLayout so that when you change the size of the cards they reflow properly. Also if you filter the collection they should also re-layout and not stick to their previous column.

let press = pressScale(domRef, UNSAFE_style);
if (ElementType === 'div' && !isSkeleton && props.href) {
// Standalone Card that has an href should be rendered as a Link.
// NOTE: In this case, the card must not contain interactive elements.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't really have a way to enforce this...

let estimatedSize = true;
if (oldLayoutInfo) {
height = oldLayoutInfo.rect.height;
height = oldLayoutInfo.rect.height / oldLayoutInfo.rect.width * itemWidth;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the card size changes (e.g. user drags slider in photo library example), re-calculate the height proportionally.

// Figure out which column to place the item in, and compute its position.
// Preserve the previous column index so items don't jump around during resizing unless the number of columns changed.
let prevColumn = numColumns === this.numColumns && oldLayoutInfo && oldLayoutInfo.rect.y < this.virtualizer!.visibleRect.maxY ? oldLayoutInfo.column : undefined;
let prevColumn = numColumns === this.numColumns && oldLayoutInfo && oldLayoutInfo.index === index && oldLayoutInfo.rect.y < this.virtualizer!.visibleRect.maxY ? oldLayoutInfo.column : undefined;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't preserve the column if the index within the collection changed. When filtering the photo library, the cards were staying where they were previously, resulting in "holes" appearing. We want to re-flow in this case.

@rspbot
Copy link

rspbot commented Oct 24, 2025

@rspbot
Copy link

rspbot commented Oct 25, 2025

@rspbot
Copy link

rspbot commented Oct 25, 2025

Copy link
Member

@yihuiliao yihuiliao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emoji Picker

the selection indicator is longer than the text in the picker

Screenshot 2025-10-27 at 10 16 09 AM

Photo Library
can get two focus rings if you select one and expand another, and then keyboard tab. pretty sure this is pre-existing tho.

Screenshot 2025-10-27 at 10 25 42 AM

Swipeable Tabs

it's not quite symmetrical?

Screenshot 2025-10-27 at 10 29 34 AM


# Gesture Driven Sheet

<PageDescription>An iOS-style gesture driven sheet built with React Aria Components, [Framer Motion](https://www.framer.com/motion/), and [Tailwind CSS](https://tailwindcss.com/).</PageDescription>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PageDescription>An iOS-style gesture driven sheet built with React Aria Components, [Framer Motion](https://www.framer.com/motion/), and [Tailwind CSS](https://tailwindcss.com/).</PageDescription>
<PageDescription>An iOS-style gesture driven sheet built with React Aria Components, [Motion](https://motion.dev/), and [Tailwind CSS](https://tailwindcss.com/).</PageDescription>


# iOS List View

<PageDescription>A re-creation of the iOS List View built with React Aria Components, [Framer Motion](https://www.framer.com/motion/), and [Tailwind CSS](https://tailwindcss.com/) with support for swipe gestures, layout animations, and multiple selection mode.</PageDescription>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<PageDescription>A re-creation of the iOS List View built with React Aria Components, [Framer Motion](https://www.framer.com/motion/), and [Tailwind CSS](https://tailwindcss.com/) with support for swipe gestures, layout animations, and multiple selection mode.</PageDescription>
<PageDescription>A re-creation of the iOS List View built with React Aria Components, [Motion](https://motion.dev/), and [Tailwind CSS](https://tailwindcss.com/) with support for swipe gestures, layout animations, and multiple selection mode.</PageDescription>

export const keywords = ['react-aria', 'example', 'gridlist', 'gesture', 'framer motion', 'tailwind'];
export const description = 'A GridList with Framer Motion swipe gestures and layout animations.';

# iOS List View
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not getting a focus ring for the items

Copy link
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for testing, mainly did a quick sweep of the examples and mentioned fixes, somethings I noticed:

  • noticed the code file picker's underline is too wide in the emoji picker example
  • the modal sheet example makes the "shell" of the site black even though it isn't open
  • the photo library's tree chevrons don't rotate in place, such that they become indented when expanded
  • I'm not sure we have an example of a standalone link S2 card? I created one locally to verify the behavior

@yihuiliao yihuiliao added this pull request to the merge queue Oct 27, 2025
@@ -0,0 +1,45 @@
import {Layout} from '../../../src/Layout';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thumbnail images in the search menu cards are broken

Image

let files = await fs.readdir('../../../' + dir);
return (
<div className={style({marginTop: 32, backgroundColor: 'layer-1', borderRadius: 'xl', padding: {default: 12, lg: 24}})}>
<Files files={files.map(f => path.join(dir, f))} defaultSelected={defaultSelected ? path.join(dir, defaultSelected) : undefined} maxLines={Infinity} />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to have more prominent "Download ZIP", "Open in CodeSandbox", etc. buttons on this page instead of just having them in the menu within the code.

import ogImage from 'url:../../assets/ReactAriaOpenGraph.webp';
import reactAriaFavicon from 'url:../../assets/react-aria.ico';

export const section = 'Getting started';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to link to the example pages next to the examples here.

export const keywords = ['react-aria', 'example', 'dialog', 'modal', 'sheet', 'motion', 'tailwind'];
export const description = 'An iOS-style gesture driven modal sheet built with Framer Motion.';

# Gesture Driven Sheet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

The page background is black on page load for me (using MacOS Chrome in light mode).

Merged via the queue into main with commit 63ed5b1 Oct 27, 2025
32 checks passed
@yihuiliao yihuiliao deleted the docs-examples branch October 27, 2025 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants