microsoft/microsoft-ui-reactor/reactor-getting-started
Claude Code and agent skill by microsoft/microsoft-ui-reactor
- vendor
Checking that the SKILL.md file is still in the repository.
Reactor essentials in one place — React-to-Reactor mental model, minimal app shape, hooks, the most-used factories, the critical gotchas, and project setup. This is the only skill you need loaded for typical Reactor work; load topical skills (`reactor-async`, `reactor-design`, etc.) only when the task explicitly calls for them.
Install
npx vskill@latest install microsoft/microsoft-ui-reactor/reactor-getting-startedSKILL.md
The same SKILL.md was published earlier as microsoft/microsoft-ui-reactor/reactor-getting-started.
Coming from React? Read this first.
Reactor concepts are React's, with one C# spelling. If you know React, you already know how Reactor works — components render an element tree, hooks manage state and effects, lists need keys, lifting state up is the same. Trust your React intuition for shape; verify the names against the table below or references/reactor.api.txt.
| React | Reactor (C#) | |
|---|---|---|
function App() { … } | class App : Component { override Element Render() { … } } | |
useState(0) | var (count, setCount) = UseState(0); | |
useReducer(reduce, init) | var (state, dispatch) = UseReducer<TState,TAction>(reduce, init); | |
useEffect(fn, [dep]) | UseEffect(fn, dep); | |
useMemo(() => v, [dep]) | UseMemo(() => v, dep) | |
useCallback(fn, [dep]) | UseCallback(fn, dep) | |
useRef(v) | UseRef(v) | |
callback ref / ref={node => …} | UseElementRef<T>() + .Ref(r) | |
useContext(Ctx) | UseContext(Ctx) | |
<Provider value={x}>{c}</Provider> | c.Provide(Ctx, x) | |
<div> (linear layout) | FlexColumn(...) / FlexRow(...) (CSS-flexbox semantics) | |
<div> (shrink-wrap) | VStack(...) / HStack(...) | |
<span>text</span> | TextBlock("text") | |
<h1> / <h2> / small caption | Heading(...) / SubHeading(...) / Caption(...) | |
<button onClick={fn}> | Button("label", fn) | |
<input value={v} onChange={e=>…}> | TextBox(v, setV) | |
<select> | ComboBox(items, index, setIndex) | |
<input type="checkbox"> | CheckBox(checked, setChecked) | |
{cond && <X/>} | cond ? X() : null (null children are filtered) | |
{a ? <X/> : <Y/>} | a ? X() : Y() | |
{items.map(i => <Card key={i.id} … />)} | items.Select(i => Component<Card,…>(…).WithKey(i.id)).ToArray() | |
<Card {...props} /> | Component<Card, CardProps>(new CardProps(...)) | |
key={i.id} | .WithKey(i.id) | |
className="..." (style) | .Background(...), .Padding(...), .Margin(...), etc. | |
style={{margin: 10}} | .Margin(10) | |
display: flex; flex: 1 | FlexRow(...) / .Flex(grow: 1, basis: 0) | |
gap: 8 | VStack(8, …), FlexRow(...) with { ColumnGap = 8 } (FlexColumn → RowGap) | |
React Query useQuery / useMutation | UseResource / UseMutation (see reactor-async) | |
| JSX | C# method calls + using static Microsoft.UI.Reactor.Factories |
One important difference: in Reactor, UseState with a List<T> won't re-render on .Add() — same reference. Use UseReducer for lists (just like useReducer is preferred in React for complex state).
Controlled prop note: the factories shown here still take plain values(TextBox(text, setText),Slider(value, ...)) and wrap them for you.Element-record properties behind those factories useOptional<T>soOptional<T>.Unsetcan mean "the control owns this value". See
Starting a new app
dotnet new reactor -n <Name> scaffolds the canonical shape: App.cs (entry point + initial component, with the using block at the top) plus <Name>.csproj. Richer shells: reactor-mvu, reactor-navview, reactor-tabview. See the anti-probe + mur check notes under "Use a .csproj …" below for what comes out of the scaffold.
For a single-file dotnet run App.cs demo (no .csproj), dotnet new reactor-singlefile -n <Name> scaffolds <Name>/<Name>.cs with the file-level #:package / #:property header already in place. Keep all the code in that file, because a file-based app compiles only that one file. Check it with mur check <Name>.cs from its folder; a bare mur check builds the current directory, which needs a project file. To add the header to an existing file instead, see reactor-build-and-check's single-file-scripts section.
If dotnet new rejects --packaging or can't find reactor-singlefile, the installed pack predates them; winapp new --list --template-version latest updates it.
Use a .csproj when you need …
… multiple files, analyzers (single-file .cs builds don't load them), or shared project references. dotnet new reactor scaffolds the canonical csproj — you don't need to author one from scratch.
UseWinUI MUST be true. No XAML files of any kind.
Don't change the packaging mode of a project you didn't scaffold — keep whatever the scaffold produced. Reactor works in both shapes:
- Unpackaged —
<WindowsPackageType>None</WindowsPackageType>, noPackage.appxmanifest.
None wins over EnableMsixTooling, so a project carrying both still builds unpackaged. Runs from any folder, no MSIX registration. Scaffold it with dotnet new reactor --packaging Unpackaged (the other project templates take --packaging too).
- Packaged — has a
Package.appxmanifest. Either omitWindowsPackageTypeentirely (the
default produces a packaged app) or set it to MSIX; pair it with EnableMsixTooling=true for the single-project MSIX tooling. Launches with package identity, which is what identity-gated APIs require. This is what the dotnet new reactor family produces by default.
Neither is "the" Reactor shape, and neither is signalled by one property alone. If a project has a `Package.appxmanifest`, it is packaged on purpose — adding `<WindowsPackageType>None</WindowsPackageType>` to it silently strips its identity, and the build still succeeds, so nothing surfaces the mistake. Switch modes only when the user asks, and switch the whole property set, not a single flag — the packaging guide has both shapes in full, including the explicit-MSIX form.
After `dotnet new reactor -n <Name>`, the source you edit is `App.cs` (entry point + initial component) next to `<Name>.csproj`. The templates also scaffold build and packaging inputs — app.manifest, Assets/, Properties/launchSettings.json, Properties/PublishProfiles/, .vscode/, and Package.appxmanifest when packaged; those are not source — leave them alone. The scaffold's AGENTS.md holds WinApp CLI workflow notes (winapp ui …, winapp find-ui --source reactor); it complements this skill. There is no Program.cs and no GlobalUsings.cs — modify App.cs in place. App.cs has its own using directives at the top — see the Required imports section below — and that is where you add new namespaces (e.g. using System.Linq; when you reach for .Select(...)). Some templates enable implicit usings, so a namespace may already be in scope. Don't probe the .csproj after scaffolding unless you're adding a PackageReference or changing a property — Restore succeeded. in the scaffold stdout is the only confirmation you need.
Scaffolded apps are packaged by default, so `dotnet run` launches them with MSIX package identity — the F5 equivalent. That needs Developer Mode on (Settings → System → For developers) to register the loose-layout package, and a concrete architecture (the template declares x86;x64;ARM64; AnyCPU is rejected). A --packaging Unpackaged scaffold runs as a plain .exe with no package registration, so it doesn't need Developer Mode.
The scaffolded csproj ships a Debug-only ItemGroup that adds `Microsoft.UI.Reactor.Devtools` + `Reactor.DevtoolsSupport=true`. That makes devtools available without turning them on. For the in-app dev menu, run dotnet run -- --devtools app and make sure the app renders DevtoolsMenu(...), e.g. in its title bar — the flag alone draws nothing. dotnet run hands everything after -- to the app, and a packaged scaffold still receives it when it launches with package identity. Keep the app: a bare --devtools is read as --devtools run, the heavier session behind mur devtools that also starts an MCP endpoint. Properties/launchSettings.json depends on the packaging. A packaged scaffold lists a Package profile first, Visual Studio's F5 default, and an Unpackaged profile second. dotnet run can't apply MSIX profiles, so it picks Unpackaged, but WinApp still launches the app with package identity. WinApp also supplies its own run arguments, so dotnet run ignores profile arguments there; pass -- --devtools app yourself. In Visual Studio, keep Package: choosing Unpackaged there starts the exe without identity, and it fails at startup with REGDB_E_CLASSNOTREG. A --packaging Unpackaged scaffold has an Unpackaged profile plus an Unpackaged, Devtools profile that passes --devtools app. Release builds drop the devtools package and host-config switch so trim / AOT analyzers stay quiet — see the packaging guide for the full rationale before flipping either knob.
Verify your edits with `mur check` before declaring done. From the project directory: mur check (no arguments) runs dotnet build and emits one compressed line per diagnostic with a → try: suggestion when the engine recognizes the mistake; mur check --final is the explicit "I am done iterating" sweep that emits the full diagnostic set including suppressed iteration-mode warnings. For anything more involved than the build/fix loop — strict-mode failures, custom diagnostic gating, MSBuild passthrough flags — load the reactor-build-and-check skill.
Required imports
Components
Component skips parent-triggered re-renders by default. Component<TProps> skips when Equals(oldProps, newProps).
App entry point. ReactorApp.Run<MyRoot>("Title", width: W, height: H) against a component class (the scaffolded form). width/height are optional DIPs — omit them to let the OS choose the initial window size. For a tiny demo without a class, the inline form: ReactorApp.Run("Title", ctx => { var (m, setM) = ctx.UseState("hi"); return TextBlock(m); }).
Hooks
Rules: same order every render (no hooks in if/for), only from Render() or function-component body.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 3 Oct 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/reactor/skills/reactor-getting-started/SKILL.md
Popularity
- Repository stars
- 660
- Repository forks
- 57
- 7-day trend score
- 37
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 24 Oct 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/microsoft-ui-reactor/reactor-getting-started)