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.
- Project page: sap.github.io/fundamental
- React: sap.github.io/fundamental-react
- Angular: sap.github.io/fundamental-ngx
- Vue: sap.github.io/fundamental-vue
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:
npx create-react-app <project-name>cd <project-name>Install the Fundamental styles and React components:
npm install fundamental-styles fundamental-reactThe project now has three folders:
node_modules: the library filespublic: files open to external accesssrc: 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.