Repository navigation
docs(Spinner): an iOS-style activity indicator, composed from existing APIs - #10066
Conversation
…g APIs A story for an app that wants iOS's look: `ActivityIndicator`, eight capsule spokes drawn with StyleX and plain elements, to copy. As UIActivityIndicatorView draws it on iOS 26: a bright head stepping clockwise one spoke every 100 ms (a turn every 0.8 s) and the trail dimming behind it, medium 20 pt and large 37 pt, in UIKit's secondary label gray at its images' alphas, light and dark. Each spoke runs one opacity animation whose holds are joined by short linear ramps rather than steps(), so WebKit runs it on the compositor. It is a named image, not a live region (`spec:AST-086` FR2, FR3): the app announces loading through the shared channel. Spinner itself is unchanged.
…contrast Storybook's code panel shows only a story's render, so the story's description names the file that holds `ActivityIndicator`. The color comment no longer says any theme color works: UIKit's gray reaches 2.74:1 at the brightest spoke on a white page, and the theme's secondary text color is lighter still (2.25:1); the theme's primary text color reaches 3.64:1 at the same alphas, for an app that needs WCAG's 3:1 for non-text graphics. No pixel changes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet, because the pull request is a draft; the required checks run once it is marked ready for review.
The story adds a copyable iOS-style ActivityIndicator without changing Spinner or any public API. It exposes a named image with no live role, so the app keeps ownership of the loading announcement. In Chromium it steps clockwise every 100 ms in light, dark, forced colors and right-to-left, and both indicators are named "Loading".
[Automated review]
Supersedes #8211 by @vjeux: his two commits, cherry-picked onto today's
mainunchanged, with his authorship. Story-only: no library code, no API, and no changeset.Reader impact
An app that wants iOS's activity indicator finds no Spinner option: Spinner draws a ring everywhere. A new story shows how to build that look from StyleX and plain elements, as a component to copy. Spinner itself is unchanged.
Source of truth
On #8211, the owner decided against any new API for this look (no Spinner prop, no theme role, no glyph swap on touch screens) and asked for a story that composes it from existing APIs instead. This is that story.
Change
ActivityIndicatorinSpinner.stories.tsx, with the story "iOS-style activity indicator (composed)":steps(), so WebKit keeps them on the compositor;role="img"with a label), not a live region; the app announces loading once, itself;Evidence
In real Chrome, against a Storybook built from this branch:
ESLint (strict) passes. There is no test to run red-first: the change is a story, with no library behavior.