Skip to main content
Frontend tutorial

8. UI5 Web Components for React

To not invent everything from scratch, we can use components prepared by others. Our backend is SAP anyway, so in this chapter we focus on the components prepared by SAP. SAP prepared web components that can be used directly in HTML, but there is also a library for React that wraps these web components into React components. You import them, render them and pass props, like any other component.

We take a small pallet counter with a plain HTML button and dress it in UI5: first the button, then an icon and a design, then a bar that shows how full the shipment is.

Docs: UI5 Web Components for React

Lessonsโ€‹

  1. Swap in a UI5 Button
  2. Add an icon and a design
  3. Progress and capacity
  4. More exercises

08 / UI5 Web Components for React

UI5 components on the loading screen

UI5 components on the loading screenOne ThemeProvider wraps the app. Inside, the Shipment loading screen shows 6 / 10 pallets loaded. A ProgressIndicator shows 60%, and two UI5 Buttons, Load pallet and Reset, use the imported add and refresh icons. Load pallet stops at a capacity of 10.Shipment loading6 / 10 pallets loaded60%Load palletResetimported icons:add, refreshLoad pallet stops at 10ThemeProviderwraps the appProgressIndicator6 of 10 is 60%ButtonLoad pallet, Reset

Wrap the app once, import the icons, and derive progress from the pallet count.