fluentui
Skill33 starsChanged 5 days agoMITView on GitHub
Patterns for FluentUI React v9 components in VS Code webviews. Use when working with any FluentUI component (Toolbar, Overflow, Menu, Button, Dialog, etc.), debugging layout or styling issues with FluentUI, implementing toolbar overflow (collapsing items into a "..." menu), or integrating FluentUI components in webview panels.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- blendsdk/fluentui-mcptheir own version, first seen Sep 24, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- blendsdk/fluentui-mcp★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository17 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- detecting-accessibility-issuesSkill
- backportSkill
- documentation-screenshotsSkill
- error-translationSkill
- flagging-fresh-dependenciesSkill
- leadSkill
- prepare-pull-requestSkill
- previewing-docs-siteSkill
- react-webview-architectureSkill
- review-external-prSkill
- skill-creatorSkill
- telemetry-instrumentationSkill
- tree-cluster-architectureSkill
- ux-pr-reviewSkill
- webview-trpc-messagingSkill
- writing-release-notesSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
When working with a FluentUI component you're unfamiliar with, fetch its documentation first.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
FluentUI React v9 Patterns
Proven patterns and project-specific knowledge for using FluentUI React v9 components in VS Code webviews.
Official Documentation
FluentUI provides LLM-compatible documentation. Use these URLs with fetch_webpage to look up any component:
- Index (all components):
https://storybooks.fluentui.dev/react/llms.txt - Individual component:
https://storybooks.fluentui.dev/react/llms/components-{name}.txt- Examples:
components-overflow.txt,components-toolbar.txt,components-menu-menu.txt,components-button-button.txt
- Examples:
When working with a FluentUI component you're unfamiliar with, fetch its documentation first.
Topic References
This skill covers multiple FluentUI topics. Load the relevant reference when needed:
- Overflow & Toolbar: See references/OVERFLOW_PATTERNS.md — Layout constraints, CSS Grid vs Flexbox, divider handling, priority ordering, debugging checklist
When to Use
- Working with any FluentUI React v9 component in a webview
- Adding or modifying a toolbar with overflow behavior
- Debugging FluentUI layout, styling, or measurement issues
- Items not hiding/showing when the toolbar shrinks/expands
- The "..." overflow menu button renders off-screen or doesn't appear
- Placing an
<Overflow>toolbar alongside other elements in a layout - Integrating FluentUI components that use Griffel (CSS-in-JS) with SCSS stylesheets
MessageBar Multiline Layout
MessageBar has two independent multiline concerns. When a request says “make the MessageBar multiline,” ask which one is intended when the context does not make it clear:
- Responsive actions and icon geometry: Set
layout="multiline". This uses Fluent UI's multiline grid, top-aligns the icon, and movesMessageBarActionsbelow the body when needed. - Title above message:
MessageBarTitleis inline by default, even withlayout="multiline". Add a named body class withdisplay: flex,flexDirection: 'column', and an appropriategapto put the message on the next line.
For the default DocumentDB webview notice with a title and message, use both: layout="multiline" for the Fluent UI geometry and a named title-and-message body class for the vertical title/message layout. Use a separate generic stacked-body class only when the body contains controls, commands, or multiple content blocks rather than a simple title and message.
Critical Rule: Layout Constraints
The <Overflow> component measures its child's clientWidth to decide which items to hide. If the child can grow unconstrained, overflow never triggers.
The child of <Overflow> (usually <Toolbar>) MUST have:
flex-wrap: nowrap;
min-width: 0;
overflow: hidden;Side-by-Side Layout (Pinned + Overflow)
Use CSS Grid, not Flexbox, when placing an overflow toolbar next to pinned elements:
.toolbarContainer {
display: grid;
grid-template-columns: auto minmax(0, 1fr);
align-items: center;
gap: 10px;
}- Column 1 (
auto): pinned toolbar — takes its natural width - Column 2 (
minmax(0, 1fr)): overflow toolbar — constrained to remaining space
Why not Flexbox? Flexbox with margin-right: auto on the first child or flex-grow: 1 on the second child fails in practice. The <Overflow> component's clientWidth measurement doesn't shrink correctly in a flex context, even with min-width: 0. CSS Grid's minmax(0, 1fr) provides a hard width constraint that the overflow manager can observe via ResizeObserver.
Right-Alignment
To push overflow items to the right edge of their column:
.toolbarContainer .fui-Overflow {
justify-content: flex-end;
}Quick Reference: Overflow Priority
Higher priority = overflows later (stays visible longer):
<OverflowItem id="shell" priority={1}> {/* hides first */}
<OverflowItem id="playground" priority={2}>
<OverflowItem id="copy" priority={3}>
<OverflowItem id="import" priority={6}> {/* hides last */}Quick Reference: Menu Item Visibility
Each menu item must be a separate React component to call useIsOverflowItemVisible (hook rules):
const OverflowMenuItem = ({ id, children }: { id: string; children: JSX.Element | null }) => {
const isVisible = useIsOverflowItemVisible(id);
return isVisible ? null : children;
};Common Pitfalls
- Inline
displaystyles on OverflowItem children — The overflow manager setsdisplay: nonevia the[data-overflowing]attribute. If you setdisplay: inline-flexvia an inlinestyle={}prop, React will fight the overflow manager on re-render. Use a CSS class instead, with an explicit&[data-overflowing] { display: none; }override. <Overflow>renders no wrapper element — It clones its single child, merging a ref and thefui-Overflowclass. There is no intermediate DOM node.<Toolbar>addsdisplay: flex; align-items: centervia Griffel — You don't need to add these yourself. You only need to addflex-wrap: nowrap; min-width: 0; overflow: hiddenfor the overflow behavior.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

