Skip to main content
Logo
Overview

Fundamentals for SAP Fiori Applications: Intro

July 8, 2019
1 min read

Originally published on SAP Community in July 2019. Library versions and APIs have changed since then.

SAP Fundamental makes it possible to build Fiori applications with the UI framework of choice: React, Vue or Angular. Apps are built with standard web technology and open-source npm libraries, which gives a more flexible structure and access to the wider JavaScript ecosystem.

Fundamental does not replace UI5. Development on UI5 continues; Fundamental simply means Fiori developers are not tied to a single technology.

A simple React app

A React project needs a package manager. npm is the most common (Yarn works too) and comes with Node.js, the runtime that executes JavaScript outside the browser.

After installing Node.js, create the app from a terminal (for example in Visual Studio Code) and move into its folder:

Terminal window
npx create-react-app <project-name>
cd <project-name>

Install the Fundamental styles and React components:

Terminal window
npm install fundamental-styles fundamental-react

The project now has three folders:

  • node_modules: the library files
  • public: files open to external access
  • src: the source files

A panel with a title, text and a button

In App.js, import the components at the top of the file:

import { Panel } from 'fundamental-react/Panel';
import { Button } from 'fundamental-react/Button';

Remove everything inside the App div and add:

<Panel>
<Panel.Header>
<Panel.Head description="New Fundamental App" title="Fiori 3.0 with React" />
<Panel.Actions>
<Button compact glyph="add">
Add Item
</Button>
</Panel.Actions>
</Panel.Header>
<Panel.Body>Open-source, New UI</Panel.Body>
</Panel>

Start the app with npm start.

The sample code is on GitHub. To learn more or contribute to the React library, see sap/fundamental-react.

Resources