8.4. More exercises
There is much more in the library than buttons. Pick a component and add it to your loading screen:
- add one of the charts: BulletChart (charts have their own package,
@ui5/webcomponents-react-charts) - add a table: AnalyticalTable
- add a wizard: Wizard
- add a dialog: Dialog
In your own projectโ
Create a project as in 3.2 and add the UI5 packages:
pnpm create vite my-ui5-app --template react-ts
cd my-ui5-app
pnpm add @ui5/webcomponents @ui5/webcomponents-react \
@ui5/webcomponents-fiori @ui5/webcomponents-icons
pnpm dev
In src/main.tsx, wrap App with ThemeProvider, once for the whole app, and remove the template's import './index.css': the styles from 8.3 replace it.
src/main.tsx
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { ThemeProvider } from '@ui5/webcomponents-react/ThemeProvider'
import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<ThemeProvider>
<App />
</ThemeProvider>
</StrictMode>,
)
Then copy App.tsx and styles.css from 8.3 into src/, and drop the ThemeProvider from App: main.tsx has it now.
