Build a No-Framework Copilot UX Component with SPFx 1.24.1

An analyst asks whether Project Evergreen is on track, but the agent has no project system behind it yet. The first implementation should show how a Copilot tool can pass a known value into a deterministic cardโ€”not claim to report live project status.

That is a useful first slice for a no-framework SharePoint Framework (SPFx) Copilot UX component: inspect the generated project, preserve its agent wiring, and implement a synthetic result for local Workbench testing.

A scaffold is not a working sample. The generator creates source files, schemas, manifests, and agent configuration; the developer still needs to understand which files connect the tool to the component.

Generated markup can obscure the trust boundary. A starter render method may assemble HTML from strings. A tiny demo is a good place to make the boundary visible by creating DOM elements and assigning text with textContent.

A matching parameter is not a real data source. A card labeled โ€œOn trackโ€ can be mistaken for live project status unless the tutorial says plainly that the value is synthetic and the example makes no network or SharePoint request.

Local preview and tenant rollout are different tests. Copilot Workbench can exercise a locally served component, but it does not establish that a deployed agent discovers the tool or that users can access connected data.

Version examples can drift. The scaffold emitted by the pinned 1.24.1 generator is the evidence to use for this tutorialโ€”not a schema example copied from an older tutorial.

After reading this post, you will be able to:

โœ… Generate a no-framework Copilot UX component project with the SPFx 1.24.1 generator.

โœ… Identify the component, parameter schema, agent grouping, and declarative-agent files that must stay aligned.

โœ… Replace the starter rendering with a deterministic, synthetic-only card using textContent and replaceChildren.

โœ… Follow the local Workbench and packaging steps while distinguishing instructions and expected results from completed validation.

Validation scope: The no-framework project and the render code below built and packaged locally with SPFx 1.24.1 on Node.js 26.13.1. No licensed Workbench run or tenant deployment was performed. The Workbench examples describe expected results.

Scaffold a reproducible project before changing the starter

The sample in this article is Project Evergreen. It has no project database, SharePoint list, API, or external service. The single accepted synthetic identifier is evergreen; any other string is an explicit invalid-input case. This keeps the exercise focused on the component contract: a tool provides a property, and the component renders a result from it.

The generated fixture records Node.js 26.13.1 and @microsoft/generator-sharepoint 1.24.1 in its generator metadata. Microsoft recommends Node.js 26 LTS for a new SPFx 1.24 environment; use the compatibility reference when working with another SPFx release. [3][5]

Install Yeoman and the pinned project generator globally if they are not already available:

npm install --global yo@7.0.1 @microsoft/generator-sharepoint@1.24.1

From the folder where you want the solution created, run the pinned generator with the recorded options:

yo @microsoft/sharepoint --solution-name evergreen-demo --component-type copilotComponent --component-name ProjectStatus --framework none --skip-install --no-insight

The generated project is named evergreen-demo; its component source is under src/copilotComponents/projectStatus/. Because this invocation includes --skip-install, install the project dependencies from the generated solution folder before running Heft:

cd evergreen-demo
npm install

The fixture for this article records generator version 1.24.1 in .yo-rc.json and package references to SPFx 1.24.1. It also emits version: "v1.8" and the v1.8 declarative-agent schema URL in copilot/declarativeAgent.json. Keep that generated version. The first-component tutorial includes an older v1.7 example, while the configuration reference identifies v1.8 as the schema used by new SPFx 1.24 Copilot projects. A declarative-agent schema version describes the schema; it is not the package’s release counter. [1][2]

What this means for you: pin the generator, record the environment, and treat the generated projectโ€”not an older copied JSON sampleโ€”as your starting point.


Trace the generated files before editing the component

The scaffold is a small system of linked files, not a single TypeScript class. Preserve the generated component ID and the relationship between the component manifest and the agent grouping. The following table maps the files in this fixture to the part of the tutorial they control. [1][2]

FileWhat it does in this scaffoldWhat to preserve for this exercise
src/copilotComponents/projectStatus/ProjectStatusCopilotComponent.tsExtends BaseCopilotComponent and renders the component UI.The base class and properties type; replace only the starter render behavior.
src/copilotComponents/projectStatus/ProjectStatusCopilotComponentProperties.tsDefines a Zod object with a string property named message and exports the generated JSON Schema.Keep message; the Workbench turn will supply it.
src/copilotComponents/projectStatus/ProjectStatusCopilotComponent.manifest.jsonDeclares the component, its inline and fullscreen modes, the ProjectStatusTool, and a reference to the properties schema.Keep the manifest ID, alias, tool name, and schema reference aligned with the generated source.
config/copilot-agent.jsonGroups the component ID into the generated ProjectStatus Agent.Keep the components entry matched to the ID in the component manifest.
copilot/declarativeAgent.jsonDefines the generated agent with schema version v1.8, instructions, a starter, and an action.Keep the v1.8 schema reference and version together.
copilot/ai-plugin.json and copilot/manifest.jsonSupply generated plugin metadata and the app manifest.Leave these generated files intact for this local exercise.
config/package-solution.jsonDefines the SharePoint package, including client-side assets and the package output path.Keep the generated package configuration; this post stops at local packaging.

The tool name ProjectStatusTool and the component alias ProjectStatusCopilotComponent are separate identifiers. The manifest’s propertiesSchema.id points to the compiled properties module, while config/copilot-agent.json groups the manifest’s component ID into the agent. Editing one identifier without updating its references can leave a build-time or runtime mismatch. [2]

The generated property schema accepts a string called message; it does not establish that the string is a verified project record. In this example, the meaning of the string is deliberately limited to a known synthetic value. The text โ€œOn trackโ€ is demo output, not a statement about a real project.

What this means for you: make the smallest source change possible while keeping component identity, input schema, and agent grouping intact.


Replace the starter render with a synthetic-only result

The generated ProjectStatusCopilotComponent.ts imports a subset escape helper, styles, localized strings, and two welcome images. Its starter render method builds a markup string with innerHTML, then adds an expand control and a request-display-mode handler. That is useful scaffold material, but this first sample does not need a greeting, image, theme display, or fullscreen button.

Replace the existing protected render(): void method with this implementation:

protected render(): void {
const root: HTMLElement = document.createElement('section');
root.setAttribute('aria-label', 'Synthetic project status');
const heading: HTMLHeadingElement = document.createElement('h2');
heading.textContent = 'Project Evergreen';
const result: HTMLParagraphElement = document.createElement('p');
const message: unknown = this.properties?.message;
const isKnownSyntheticProject: boolean =
typeof message === 'string' && message.trim().toLowerCase() === 'evergreen';
result.textContent = isKnownSyntheticProject
? 'Synthetic demo result only โ€” Project Evergreen is marked On track.'
: 'Unknown synthetic project. Enter "evergreen" to render the demo result.';
root.append(heading, result);
this.context.domElement.replaceChildren(root);
}

The method constructs elements, writes fixed display strings with textContent, and replaces the component root’s children on each render. It never interprets the supplied message value as markup, and it does not fetch or display real project data. The defensive type check also turns an absent or non-string runtime value into the invalid-input message rather than calling a string method on it.

Keep the BaseCopilotComponent and IProjectStatusCopilotComponentProperties imports. Since the replacement method no longer references them, remove these scaffold items from the same file:

  • import { escape } from '@microsoft/sp-lodash-subset';
  • The styles import, both welcome-image imports, and the strings import.
  • The EXPAND_ICON constant.
  • The private _handleRequestFullscreen method.

You can leave the generated SCSS, images, and localization files in the project; they are simply unused by this minimal render. Do not remove or rewrite the component manifest or config/copilot-agent.json for this change.

This is not a project-status application. The valid case is a hard-coded demonstration, and the invalid case intentionally does not echo the supplied value. When a later version connects a real source, it will need its own authorization and data-validation design; this synthetic render proves neither.

What this means for you: keep the first UI deterministic, label synthetic output at the point of display, and avoid turning tool input into markup.


Run the local component in a licensed Copilot Workbench

The Copilot Workbench is the local iteration environment for Copilot UX components. It loads a component served from the developer machine into a Workbench page on a SharePoint site; it is not the deprecated SharePoint Online workbench for web parts. Development and testing in Copilot Workbench require a Microsoft 365 Copilot add-on license on top of an E3, E5, or E7 base license. [3][4][6]

Use the following sequence after the source change.

Step 1 โ€” Trust the local HTTPS development certificate

SPFx’s local development server uses HTTPS with a self-signed development certificate. After npm install, run the project Heft command and follow the operating-system trust prompts:

npx heft trust-dev-cert

Trust only the local development certificate for the development environment you control. The generated config/serve.json enables HTTPS and sets its initial page to a tenant-domain placeholder at /_layouts/CopilotWorkbench.aspx; Microsoft documents the certificate setup and local-serving configuration in the SPFx development-environment guide. [3]

Step 2 โ€” Start the development server

From the solution root, start the project and prevent it from opening a browser automatically:

npm run start -- --nobrowser

The generated start script invokes heft start --clean. When the server compiles successfully, it serves the debug manifest locally over HTTPS. [1]

Step 3 โ€” Open Workbench on a current SharePoint site

In a browser signed in to the licensed development account, open the Copilot Workbench page on the current SharePoint development site. The fixture’s serve.json initial-page placeholder differs from the manual-navigation path in Microsoft’s tutorial; use the documented site path below:

https://<tenant>.sharepoint.com/sites/<development-site>/_layouts/15/copilotworkbench.aspx

Accept the prompt to load debug manifests for this local development session. The Workbench is available at the /_layouts/15/copilotworkbench.aspx path on a tenant SharePoint site; it is not a separate local page. [1][4]

Step 4 โ€” Fire the tool with an explicit JSON value

Select the generated component in the Workbench’s component list, then use Fire turn to pass a JSON object whose property matches the generated message schema:

{
"message": "evergreen"
}

The expected result is a card headed โ€œProject Evergreenโ€ with a sentence explicitly labeling the โ€œOn trackโ€ value as synthetic demo output. Fire a second turn with an invalid-but-well-formed string:

{
"message": "northstar"
}

The expected result is the same card with the โ€œUnknown synthetic projectโ€ message and a prompt to use evergreen.

Workbench is useful for checking the rendering and the parameters passed to this component. It does not prove that a deployed agent discovers the tool, matches user intent, has tenant permissions, or works in an end-user Copilot session; those checks belong to a later deployed-agent test. [4][6]

Note: Do not use Workbench output as evidence of live project data or tenant rollout. This exercise has no data source, and no tenant deployment or end-user test is claimed.

What this means for you: use a licensed Workbench session to test the local component contract, and record its expected and observed behavior separately.


Package locally, then stop before rollout

After dependencies are installed and local validation is available, use the generated project script to run the package pipeline:

npm run build

In this scaffold, build runs heft test --clean --production followed by heft package-solution --production. config/package-solution.json has includeClientSideAssets set to true. The local build produced sharepoint/solution/evergreen-demo.sppkg. This package includes the client-side assets but does not deploy them. [1]

The intended scope is source inspection, local rendering, and the local packaging steps described here. Do not upload the .sppkg to the SharePoint App Catalog, select Add to Teams or Sync to Teams, assign an agent policy, or claim an end-user rollout. Those operations and the licensed deployed-agent checks belong to Part 6 of this series. A local package alone does not establish availability to tenant users. [6]

What this means for you: treat a successful local package as a build artifact, not as evidence that the agent has been deployed or made available.


Now What? Your Next Three Steps

  1. Run the pinned generator command from a clean working folder and record the Node, Yeoman, and generator versions with the scaffold.
  2. Replace only the starter render method, then verify the evergreen and invalid-string outcomes in a licensed local Workbench session.
  3. Build the local .sppkg with the generated project script and record the command outcome without uploading it to a tenant.

How to Navigate This Series

This series runs eight posts across three phases: decide and build (Posts 1โ€“3), design the experience and data boundary (Posts 4โ€“5), then deploy, update, and troubleshoot (Posts 6โ€“8).

  • Phase 1 โ€” Decide and build: Post 01, When to Build a Copilot UX Component; Post 02, this scaffold tutorial; Post 03, How Copilot Finds Your Component and Passes It Arguments.
  • Phase 2 โ€” Experience and data: Post 04, Design an Inline Card That Also Works in Fullscreen; Post 05, Connect SharePoint Data Without Expanding User Access.
  • Phase 3 โ€” Operate the solution: Post 06, Deploy a Copilot UX Component and Roll It Out to a Pilot; Post 07, Redeploy or Sync? A Copilot UX Components Update Guide; Post 08, Troubleshoot Copilot UX Components from Prompt to Render.

By role:

– SPFx developer: โ†’ Post 01 โ†’ Post 02 โ†’ Post 03 โ†’ Post 04 โ†’ Post 05 โ†’ Post 07 โ†’ Post 08

– Architect or tenant admin: โ†’ Post 01 โ†’ Post 05 โ†’ Post 06 โ†’ Post 07 โ†’ Post 08

– Deployment or support owner: โ†’ Post 06 โ†’ Post 07 โ†’ Post 08

The immediate next post is Post 03 โ€” How Copilot Finds Your Component and Passes It Arguments.

References

The official Microsoft documentation below supports the platform and toolchain guidance in this post. The exact generated filenames, identifiers, and package settings described above are from the SPFx 1.24.1 evergreen-demo fixture for this tutorial.

  1. Build your first Copilot UX component: local Workbench testing and package steps
  2. Configure Copilot UX components and agents: manifests, grouping, schemas, and v1.8
  3. Set up your SharePoint Framework development environment: Node.js, Heft, and trusted local HTTPS
  4. Overview of Copilot UX components: Workbench and availability
  5. SharePoint Framework v1.24.1 release notes
  6. Develop and deploy Copilot UX components: local testing boundaries and tenant deployment

Leave a Reply