Sitecore XM Cloud: Creating a FEaaS Component

Learn how to create your first XM Cloud FEaaS component, also known as a no-code component.

May 13, 2025

By Gorman Law

Sitecore Front-End as a Service Overview

Front-End as a Service (FEaaS) components, or no-code components, are built using XM Cloud’s user interface. It allows non-technical content authors to create reusable components to design web pages. This blog post will teach you how to create one.

Prerequisites

This tutorial is on Sitecore JSS version 22.1.3. While FEaaS was added to JSS as early as 21.0.6, I would upgrade to at least version 22 just to make sure there are no issues.

To check if you have FEaaS installed, check your package.json file and look for @sitecore-feaas/clientside. I currently have 0.5.17 installed.

Layout.tsx

Go to your Layout.tsx. You should have the following imports somewhere. If not, add them!

...
import Scripts from 'src/Scripts'; 
...
return (
    <>
        <Scripts />
    ...
);

Scripts.tsx

Now check Scripts.tsx to make sure it’s importing FEAASScripts. If this file doesn’t exist, add it under your src folder.

...
import FEAASScripts from 'components/FEAASScripts';
...
const Scripts = (): JSX.Element => {
  return (
    <>
      ...
      <FEAASScripts />
        ...
    </>
  );
};

FEAASScripts.tsx

Lastly, let’s make sure we have this file. If not, copy the following file into src/components.

import Image from 'next/image';
import * as FEAAS from '@sitecore-feaas/clientside/react';
import nextConfig from 'next.config';
// Element implementations for Sitecore Component Builder can be overriden here

const FEAASScripts = (): JSX.Element => {
  // we cannot use nextjs's logic for remotePatterns matching without extra dependencies
  // so we use a limited approach for now - which will be replaced once nextjs allows to fall back to unoptimized OOB
  const convertToRegex = (pattern: string) => {
    return pattern.replace('.', '\\.').replace(/\*/g, '.*');
  };

  const shouldOptimize = (src: string) => {
    if (src.startsWith('http')) {
      const url = new URL(src);
      const domains: string[] = nextConfig().images?.domains || [];
      const remotePatterns = nextConfig().images?.remotePatterns || [];
      return (
        domains.some((domain) => url.hostname === domain) ||
        remotePatterns.some(
          (pattern) =>
            pattern.protocol === url.protocol.slice(0, -1) &&
            new RegExp('^' + convertToRegex(pattern.hostname) + '$').test(url.hostname)
        )
      );
    }
    return true;
  };

  // Register next Image to be used in Component Builder.
  // Nextjs image implementation will be used when img is rendered in component from Component Builder
  FEAAS.setElementImplementation('img', (attributes: Record<string, string>) => {
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    const { children, src, alt, ...imgAttributes } = attributes;
    return (
      <Image
        height={1920}
        width={1200}
        unoptimized={!shouldOptimize(src)}
        src={src}
        alt={alt}
        {...imgAttributes}
      />
    );
  });

  return <></>;
};

export default FEAASScripts;

Sitecore Content Editor

Open your Sitecore Content Editor and go to your site. Open up the Presentation/Available Renderings folder. You should see one labeled FEaaS.

Sitecore Content Editor showing the FEaaS folder under Available Renderings.

If not, add one, and add the FEaaS Wrapper rendering to the Renderings field.

It can be found inLayout/Renderings/Foundation/Headless Experience Accelerator/FEaas.

Sitecore dialog showing FEaaS Wrapper selected in the content tree

If you don’t do this step, you will see this error when trying to add your FEaaS component later on: The component cannot be dropped into this placeholder.

Sitecore error message in red stating “The component cannot be dropped into this placeholder.

Building Your First Component

Open the Sitecore Cloud Portal (https://portal.sitecorecloud.io/) and do the following:

  1. Go to your desired XM Cloud environment. Here, I’m going to staging.

    Sitecore Cloud Portal dashboard showing multiple environments with one XM Cloud instance highlighted as staging

  2. Click on Open app.

    Sitecore XM Cloud environment panel with Open app button highlighted

  3. Click on Design Library in the top nav bar.

    Sitecore XM Cloud Sites dashboard showing the Design Library dropdown menu with Components highlighted for managing FEaaS components.

  4. You should now be on components.sitecorecloud.io. Click Add collection in the top right.

    Sitecore XM Cloud Components view with Add collection button highlighted to begin creating a new FEaaS component collection.

  5. Name it FEaaS Tutorial and press Save.

    Creating a new FEaaS collection in Sitecore XM Cloud with FEaaS Tutorial entered as the name and the Save button highlighted

  6. Click Add component. Name it Two Column Showcase and press Save.

    Creating a new FEaaS component named Two Column Showcase within the FEaaS Tutorial

Editing Your First Component

  1. Click on Click to start editing.

    Click to start editing prompt displayed for a new FEaaS component in Sitecore XM Cloud

  2. A screen should now appear, as well as a 12x5 grid.

    Sitecore XM Cloud component editor showing grid layout

  3. Let’s create the left column first. Click on the top left square, then drag your mouse across 6x5 squares, then select it.

    Left-side grid section selected in Sitecore XM Cloud’s component builder

  4. Click on Block and change it to Image.

    Sitecore XM Cloud component builder showing the Add element menu

  5. Let’s do the right column now. Select a 6x5 on the right side, then change Block to Card.

    Sitecore XM Cloud component builder showing the Card block element selected for the right-side grid section

  6. Now Click Add Element and select Heading 2.

    Sitecore XM Cloud component editor with the Heading 2 text element highlighted under the Add Element menu

  7. Click at the top of the card to place your heading. It should look like this.

    A Sitecore XM Cloud component preview showing a two-column layout with an image on the left and an editable H2 heading labeled Header on the right

  8. Repeat with Paragraph.

    Sitecore XM Cloud component editor showing the Add element menu with the Paragraph text option selected inside a right-hand column layout

  9. Place it under the heading.

    Card layout in Sitecore XM Cloud component editor showing a Header element

  10. I filled it with Lorem Ipsum. This should be your final result.

    Two-column Sitecore XM Cloud FEaaS component featuring an image on the left and text with header and paragraph on the right

Adding Your New Component to the Page

  1. Stage your new component. Go to the top right and click Stage(mine says Restage, because I’ve staged it before).

    Sitecore XM Cloud FEaaS component restaging screen showing a two-column layout with image and text ready for publishing

  2. Switch to the Page Builder. You should end up on pages.sitecorecloud.io.

    Sitecore XM Cloud UI showing the navigation to Page builder from the main dropdown menu after staging a FEaaS component

  3. I’ve created a new page for this example. Click on the components tab around the top left. Scroll down to see your new component. If you don’t see it, you’ve forgotten to Stage/Publish it!

    Sitecore Page Builder layout view showing a new page structure with multiple placeholders ready for component insertion

  4. Drag the Two Column showcase to any placeholder you want. This is the final result.

    Two Column Showcase component placed on a Sitecore XM Cloud page showing image and text side-by-side in Page Builder

Celebrate

Congratulations! You have created your first FEaaS (no-code) component. Thank you for reading my blog, and keep your eyes out for more!

Gorman Headshot

Gorman Law

Full Stack Developer

Gorman is a Full Stack Developer and a University of Calgary alumni who has a background in Canada's financial industry. Outside of work, he likes to go rock climbing, try out new ice cream places, and watch sports.