---
updatedAt: 2026-07-31T09:30:10.000Z
agentTools:
  siteIndex: https://documentation.bloomreach.com/llms.txt
  projectIndex: https://documentation.bloomreach.com/content/llms.txt
---

# Hello World component

## Introduction

### Goal

Create a Hello World page component with a single string parameter allowing the user to enter a title to display in the component.

### Prerequisites

This tutorial assumes basic knowledge of JSON, REST APIs, and React.

Before starting:

* Read About Bloomreach [Content](https://documentation.bloomreach.com/content/docs/about-bloomreach-content) and have a [development project](https://documentation.bloomreach.com/content/docs/development-environment) with a local copy of the [Reference SPA](https://documentation.bloomreach.com/content/docs/bloomreach-reference-spa) up and running.
* [Obtain an authorization token](https://documentation.bloomreach.com/content/reference/api-authorization) for the Site Management API if you haven't already done so.
* Have the [Site Management API](https://documentation.bloomreach.com/content/reference/site-management-api), [Base components](https://documentation.bloomreach.com/content/docs/base-components), and [SPA SDK](https://documentation.bloomreach.com/content/docs/bloomreach-spa-sdk) and [React SDK](https://bloomreach.github.io/spa-sdk/docs/react-sdk/) reference documentation handy.

To perform the Site Management API request in this tutorial it is recommended to use the [Postman collection](https://documentation.bloomreach.com/content/reference/postman) for the Site Management API. However, you can use any other method or tool you like such as the [Site development app](https://documentation.bloomreach.com/content/reference/site-management-api#site-development-app) or curl or httpies.

## Define the Hello World component using the Site Management API

The first step is to define a new component and add it to the "brx-reference-spa" component group using the [Site Management API's](https://documentation.bloomreach.com/content/reference/site-management-api) components endpoint.

The configuration for the new component will look as follows:

```json
{
  "id": "brx-reference-spa/hello-world",
  "extends": "base/component",
  "hidden": false,
  "system": false,
  "xtype": null,
  "ctype": "HelloWorld",
  "label": "Hello World",
  "icon": null,
  "parameters": [
    {
      "name": "title",
      "valueType": "string",
      "required": true,
      "hidden": false,
      "overlay": false,
      "defaultValue": "Hello World!",
      "displayName": null,
      "system": false,
      "config": null
    }
  ],
  "fieldGroups": []
}
```

As you can see in the configuration, the new component is based on the [Base Component](https://documentation.bloomreach.com/content/docs/base-component) and adds a string parameter "title" with default value "Hello World!".

To add the component to the "brx-reference-spa" component group, send a PUT request to the [components endpoint](https://documentation.bloomreach.com/content/reference/channel-component-operations) using the above JSON representation as request body:

```http
PUT https://<your-content-host>.bloomreach.io/management/site/v1/channels/tutorial-vI43R/component_groups/brx-reference-spa/components/hello-world
```

Make sure to include your authorization token in the `x-auth-token` header!

> 👍 **Tip:**
>
> The easiest way to send Site Management API requests is by using the [Postman collection](https://documentation.bloomreach.com/content/reference/postman).

## Implement the Hello World component in the Reference SPA

Now that the Hello World component is defined in the backend, the frontend application must be updated to be able to render the new component.

In your [local copy of the Reference SPA](https://documentation.bloomreach.com/content/docs/development-environment), create a new file `HelloWorld.tsx` in `components` with the following contents:

```typescript components/HelloWorld.tsx
import React from 'react';
import { BrProps } from '@bloomreach/react-sdk';

interface HelloWorldParameters {
  title?: string;
}

export function HelloWorld({ component, page }: BrProps): React.ReactElement | null {
  const { title } = component.getParameters<HelloWorldParameters>();

  return (
    <div className="mw-container mx-auto my-4">
      {title && <h3 className="mb-4">{title}</h3>}
    </div>
  );
}
```

The interface `HelloWorldParameters` defines the expected parameters (just "title" in this case) and should be consistent with the parameters defined in the component configuration.

The `HelloWorld` React component reads out the title parameter and returns the JSX to render the component.

At the bottom of `components/index.ts`, add the following line:

```typescript components/index.ts
export * from './HelloWorld';
```

In `components/App.tsx`, add `HelloWorld` to the list of components imported from '`./components`':

```typescript components/App.tsx
import {
  BannerCollection,
  Content,
  CtaBanner,
  Link,
  Images,
  Map,
  Menu,
  MultiBannerCarousel,
  Navigation,
  PageCatalog,
  Product,
  ProductGrid,
  ProductSearch,
  SearchBar,
  SingleBannerCarousel,
  Video,
  HelloWorld,
} from './components';
```

Also in `components/App.tsx`, in the function `App`, add `HelloWorld` to the mapping constant:

```typescript components/App.tsx
const mapping = {
    BannerCollection,
    Content,
    CtaBanner,
    Images,
    Map,
    MultiBannerCarousel,
    Navigation,
    PageCatalog,
    Product,
    ProductGrid,
    ProductSearch,
    SingleBannerCarousel,
    SearchBar,
    Video,
    HelloWorld,
  };
```

## Add the Hello World component to the homepage and change the title

The Hello World component is now ready to be used!

In the platform, navigate to *Projects* and open your development project.

Click on the your channel to open it in the *Experience manager*.

(Alternatively, navigate to *Experience manager*, open your channel, and select your development project in *For Project*).

Make sure you are viewing the homepage.

In the *Page* menu, select *Add to project*:

![](https://files.readme.io/2cb7350-Screen_Shot_2022-07-18_at_12.06.04_PM.png "Screen Shot 2022-07-18 at 12.06.04 PM.png")

Make sure the component overlay is enabled.

Open the left sidebar and select *Components*.

![](https://files.readme.io/b9ce1c4-Screen_Shot_2022-07-18_at_12.07.34_PM.png "Screen Shot 2022-07-18 at 12.07.34 PM.png")

Add the "Hello World" component from the catalog to the main container on the homepage. It will show the default title "Hello World!".

![](https://files.readme.io/7eaf728-Screen_Shot_2022-07-18_at_12.14.07_PM.png "Screen Shot 2022-07-18 at 12.14.07 PM.png")

Click on the component to open the editor in the right sidebar.

Change the title to something else, for example "Hello SPA!".

![](https://files.readme.io/d8ecfc6-Screen_Shot_2022-07-18_at_12.14.33_PM.png "Screen Shot 2022-07-18 at 12.14.33 PM.png")

Click *Save* and close the component editor.

Congratulations, you created and used your first Bloomreach component!