react-fluent-ui-patterns
Skill for React TypeScript frontend development with Fluent UI Copilot components. Use when creating UI components, handling SSE streams, working with chat interfaces, or implementing theme support.
Best use case
react-fluent-ui-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Skill for React TypeScript frontend development with Fluent UI Copilot components. Use when creating UI components, handling SSE streams, working with chat interfaces, or implementing theme support.
Teams using react-fluent-ui-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/react-fluent-ui-patterns/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How react-fluent-ui-patterns Compares
| Feature / Agent | react-fluent-ui-patterns | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Skill for React TypeScript frontend development with Fluent UI Copilot components. Use when creating UI components, handling SSE streams, working with chat interfaces, or implementing theme support.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# React Fluent UI Development Skill
This skill provides patterns and guidance for developing the React TypeScript frontend in the Foundry Agent Accelerator.
## Project Structure
```
src/frontend/
├── src/
│ ├── main.tsx # App entry point
│ ├── components/
│ │ ├── App.tsx # Root component
│ │ ├── agents/ # Chat-related components
│ │ │ ├── AgentPreview.tsx
│ │ │ ├── chatbot/ # Chat input components
│ │ │ └── hooks/ # Custom React hooks
│ │ └── core/ # Shared/reusable components
│ │ └── theme/ # Theme provider
│ └── types/
│ └── chat.ts # TypeScript interfaces
└── package.json
```
## Component Documentation Format
Every component file MUST start with:
```tsx
/**
* =============================================================================
* COMPONENT NAME - Brief Description
* =============================================================================
*
* WHAT THIS FILE DOES:
* --------------------
* 1. First responsibility
* 2. Second responsibility
*
* HOW TO CUSTOMIZE:
* -----------------
* - Customization instructions
*
* =============================================================================
*/
```
## Interface Naming Convention
Prefix all interface names with `I`:
```tsx
interface IAgent {
id: string;
name: string;
description?: string | null;
model: string;
metadata?: Record<string, any>;
}
interface IMessage {
id: string;
content: string;
role: 'user' | 'assistant';
}
```
## Component Pattern
```tsx
import { ReactNode, useState, useCallback } from "react";
import { Button, Body1 } from "@fluentui/react-components";
import styles from "./ComponentName.module.css";
interface IComponentNameProps {
title: string;
onAction?: () => void;
}
export function ComponentName({ title, onAction }: IComponentNameProps): ReactNode {
// -------------------------------------------------------------------------
// STATE
// -------------------------------------------------------------------------
const [isActive, setIsActive] = useState(false);
// -------------------------------------------------------------------------
// HANDLERS
// -------------------------------------------------------------------------
const handleClick = useCallback(() => {
setIsActive(!isActive);
onAction?.();
}, [isActive, onAction]);
// -------------------------------------------------------------------------
// RENDER
// -------------------------------------------------------------------------
return (
<div className={styles.container}>
<Body1>{title}</Body1>
<Button onClick={handleClick} appearance="primary">
Click Me
</Button>
</div>
);
}
```
## CSS Modules
### File naming
- Component: `ComponentName.tsx`
- Styles: `ComponentName.module.css`
### CSS Module Pattern
```css
/* ComponentName.module.css */
.container {
display: flex;
flex-direction: column;
padding: 16px;
gap: 8px;
}
.header {
font-size: 1.5rem;
font-weight: 600;
}
/* Use kebab-case for multi-word classes */
.action-button {
margin-top: 8px;
}
```
### Usage
```tsx
import styles from "./ComponentName.module.css";
<div className={styles.container}>
<h1 className={styles.header}>Title</h1>
<button className={styles.actionButton}>Action</button>
</div>
```
## Fluent UI Components
```tsx
import {
Body1,
Button,
Caption1,
Title2,
Spinner,
Input,
Textarea,
} from "@fluentui/react-components";
import {
ChatRegular,
SendRegular,
SettingsRegular,
DismissRegular,
} from "@fluentui/react-icons";
```
## Fluent UI Copilot Components
For chat interfaces:
```tsx
import { CopilotProvider } from "@fluentui-copilot/react-provider";
import { CopilotChat } from "@fluentui-copilot/react-copilot-chat";
```
## SSE (Server-Sent Events) Pattern
Handle streaming responses from the backend:
```tsx
const processStream = async (response: Response) => {
const reader = response.body?.getReader();
const decoder = new TextDecoder();
if (!reader) return;
let buffer = "";
while (true) {
const { done, value } = await reader.read();
if (done) break;
buffer += decoder.decode(value, { stream: true });
const lines = buffer.split("\n\n");
buffer = lines.pop() || "";
for (const line of lines) {
if (line.startsWith("data: ")) {
const data = JSON.parse(line.slice(6));
switch (data.type) {
case "message":
appendToMessage(data.content);
break;
case "completed_message":
setFinalMessage(data.content);
break;
case "stream_end":
setIsLoading(false);
break;
}
}
}
}
};
```
## Custom Hooks
Place in `hooks/` directory:
```tsx
// hooks/useFormatTimestamp.ts
import { useMemo } from "react";
export function useFormatTimestamp(timestamp: number): string {
return useMemo(() => {
const date = new Date(timestamp);
return date.toLocaleTimeString("en-US", {
hour: "2-digit",
minute: "2-digit",
});
}, [timestamp]);
}
```
## Theme Support
Use the ThemeProvider:
```tsx
import { ThemeProvider } from "./core/theme/ThemeProvider";
return (
<ThemeProvider>
<div className="app-container">
<YourComponent />
</div>
</ThemeProvider>
);
```
## File Attachment Handling
```tsx
interface IFileAttachment {
name: string;
type: string; // MIME type
data: string; // Base64-encoded
}
const handleFileSelect = async (file: File): Promise<IFileAttachment> => {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = () => {
const base64 = (reader.result as string).split(",")[1];
resolve({ name: file.name, type: file.type, data: base64 });
};
reader.onerror = reject;
reader.readAsDataURL(file);
});
};
```
## Markdown Rendering
```tsx
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import rehypeKatex from "rehype-katex";
export function MessageContent({ content }: { content: string }): ReactNode {
return (
<ReactMarkdown
remarkPlugins={[remarkGfm, remarkMath]}
rehypePlugins={[rehypeKatex]}
>
{content}
</ReactMarkdown>
);
}
```
## Component Location Guide
| Component Type | Location |
|----------------|----------|
| Agent/Chat related | `components/agents/` |
| Shared/Reusable | `components/core/` |
| Theme related | `components/core/theme/` |
| Chat input | `components/agents/chatbot/` |
| Custom hooks | `components/agents/hooks/` |Related Skills
starknet-react-rules
Specific rules for Starknet React projects, focusing on blockchain integration.
responsive-design-patterns
Mobile-first responsive design patterns with breakpoints, fluid layouts, and adaptive components
react
React development patterns and best practices including hooks, state management, and performance optimization.
nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file-cursorrules
Apply for nextjs15-react19-vercelai-tailwind-cursorrules-prompt-file. --- description: Best practices for using Tailwind CSS in Next.js 15 and React 19 applications, including responsive design, custom configurations, and performance optimization. globs: app/**/*
frontend-react-testing-strategy
Standardized guidelines and patterns for Frontend React Testing Strategy.
angular-rxjs-patterns
Use when handling async operations in Angular applications with observables, operators, and subjects.
8bit-docs-patterns
Create documentation with gaming-specific examples, retro styling, and 8-bit terminology. Apply when documenting gaming blocks, RPG components, or retro-styled UI elements.
[PROJECT]-deployment-patterns
[PROJECT] CI/CD pipeline and deployment automation patterns
gitlab-ci-patterns
Build GitLab CI/CD pipelines with multi-stage workflows, caching, and distributed runners for scalable automation. Use when implementing GitLab CI/CD, optimizing pipeline performance, or setting up...
ecosystem-patterns
Use this when creating new projects, generating documentation, cleaning/organizing a repo, suggesting architecture, deploying containers and services, naming files/folders, or when the user references 'ecosystem', 'patterns', or 'containers'. This skill outlines naming conventions, stack preferences, project organization (iMi worktrees), Docker patterns, and PRD structures from past conversations.
dotnet-ado-patterns
Composes Azure DevOps YAML pipelines. Templates, variable groups, multi-stage, triggers.
deployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.