Skip to content

docs(docsite): overhaul react-icons docs for headless, transforms & recipes#1138

Open
Hotell wants to merge 7 commits into
microsoft:mainfrom
Hotell:docs/docsite-react-icons-overhaul
Open

docs(docsite): overhaul react-icons docs for headless, transforms & recipes#1138
Hotell wants to merge 7 commits into
microsoft:mainfrom
Hotell:docs/docsite-react-icons-overhaul

Conversation

@Hotell

@Hotell Hotell commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

Overhauls the @fluentui/react-icons Storybook docsite so it fully reflects the current solution (headless API, atomic build transforms, rendering strategies, recipes) and modernizes the existing pages.

image image

Docs content

  • Build Transforms page is now webpack-only, promoting the two dedicated packages: @fluentui/react-icons-atomic-webpack-loader and @fluentui/react-icons-font-subsetting-webpack-plugin. Babel/SWC are collapsed into a secondary <details> in the markdown docs (docs/build-transforms.md) with a README pointer.
  • New Headless API page with an interactive demo; promotes the atomic @fluentui/react-icons/headless/utils subpath.
  • New Bundle Size page porting the Griffel-vs-Headless comparison (CSS extraction: −70% fonts, −56% sprites, −14% inline SVG).
  • New Recipes page — a catalog of real interactive demos (not just code blocks): Using multiple colors for single-color icons and Rendering the same Color icon multiple times (idPrefix).
  • Renamed User GuidanceRendering Approaches (scoped to inline SVG / fonts / sprites).
  • Consolidated all Color-variant deprecation content into the dedicated Color Variants page (single source of truth); removed the duplicate from Rendering Approaches.
  • Marked svg-sprite as ⚠️ preview and removed unsupported headless/svg-sprite references across docs.
  • Overview gains two highlights: Default (Griffel) vs Headless (pairs with the Fluent UI Headless components) and Barrel vs Atomic (atomic preferred via build transform).

Docsite structure / patterns

  • Story pages follow the index.stories re-export pattern so Storybook's "Show code" shows a focused snippet per story (matches PR docs(docsite): fix ColorVariants story 'Show code' to follow index re-export pattern #1136).
  • The idPrefix demo is defined once (ColorVariants/ColorIdPrefix.stories.tsx) and re-exported into both the Color Variants and Recipes pages — 1:1, no duplication.
  • Docs pages use the Fluent addon's native params (skipPrimaryStory / hideArgsTable) instead of a custom docs.page, so the branded chrome (TOC, theme picker, LTR/RTL switch, Copy Page) is preserved while dropping the duplicate Primary hero and the empty/misplaced Args table.

Known limitation / follow-up

Verification

  • nx run docsite:build succeeds; nx run react-icons:build regenerates the headless atoms consumed by the interactive Headless story.
  • No TypeScript/lint errors; internal ?path= cross-links resolve; new/updated pages verified in the dev server.

Draft — feedback welcome on page naming and structure.

…ecipes

- Build Transforms: webpack-only (atomic loader + font subsetting)
- Add Headless API page (re-export story pattern); promote /headless/utils
- Add Bundle Size comparison page
- Add Recipes chapter (multi-color layering, idPrefix pointer)
- Rename User Guidance -> Rendering Approaches
- Consolidate Color-variant deprecation into the Color Variants page
- Mark svg-sprite as preview; drop unsupported headless svg-sprite refs
- Overview: add Griffel-vs-Headless and Barrel-vs-Atomic highlights
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

📋 PR Validation Summary

Check the Build react library job summary for detailed reports:

  • 📦 Bundle Size — size comparison against the base branch
  • 📖 Docsite Preview — build artifact with local preview instructions

To view: click the link above → select the Build react library job → open the Summary tab.

Hotell added 3 commits July 3, 2026 10:30
- Convert Recipes MDX into a story-backed page (re-export pattern)
- Each recipe is a separate story module for correct 'Show code'
- Add MultipleColors and ScopingGradientIds live demos
- Extract canonical ColorIdPrefix demo into its own module
- Re-export it from both Color Variants and Recipes (single source, 1:1)
- Remove divergent Recipes ScopingGradientIds story
- Replace custom docs page with skipPrimaryStory/hideArgsTable
- Restores Fluent chrome (TOC, theme/RTL/copy toggles) on all three pages
- Removes duplicate Primary hero and the misplaced/empty Args table
Hotell added 3 commits July 3, 2026 11:36
- Button toggles display:none on one instance to show the gradient collision live
- Shared demo updates both Color Variants and Recipes pages
- Move Build Transforms & Bundle Size to the bottom (tooling/perf)
- Move API Contract into the reference cluster above tooling
- Mention Light/Color styles
- Add rendering-approaches gist
- Promote catalog to its own heading
- Fix cross-page links: data-sb-kind href='' broke to bare iframe
- Use ./?path= + target=_top so the manager routes correctly
@Hotell Hotell marked this pull request as ready for review July 3, 2026 14:16
@Hotell Hotell requested review from a team as code owners July 3, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant