Polygon layer → area_m2 / area_ha per feature and a table of total area per class, styled by class. Run it from the GIS workbench Toolbox (category “Sample plugins”). Source: plugin.js (pure maths, no libraries) and manifest.json — copy them to start your own plugin.