8.2. Add an icon and a design
Now let's customize the button: add an icon and a design.
design="Emphasized" makes Load pallet the main action on the screen. The icon needs one more step: UI5 icons live in their own package, and you import each one before icon="add" can find it. While you're here, add a Reset button with the refresh icon. It needs its own import too.
import { Button } from '@ui5/webcomponents-react/Button';
import '@ui5/webcomponents-icons/dist/add.js';
import '@ui5/webcomponents-icons/dist/refresh.js';
import './styles.css';
<p>{loaded} / 10 pallets loaded</p>
<Button
icon="add"
design="Emphasized"
onClick={() => setLoaded(loaded + 1)}
>
Load pallet
</Button>
<Button icon="refresh" onClick={() => setLoaded(0)}>
Reset
</Button>
Need a hint?
- No icon? Check its import: icon="add" alone isn't enough.
- Each icon has its own file, so refresh needs its own import.
Load pallet turns SAP blue. Pick another icon from the icon list, or try design="Transparent" on Reset.