ufw has no command for ICMP, because the rules for it sit in a file that ufw reads before your own rules.
sudo sed -i.bak 's/-A ufw-before-input -p icmp --icmp-type echo-request -j ACCEPT/-A ufw-before-input -p icmp --icmp-type echo-request -j DROP/' /etc/ufw/before.rules
sudo ufw reload
ufw reads /etc/ufw/before.rules before your own rules, and it accepts echo requests there by default. The -i.bak flag keeps a copy of the original next to the file. Changing ACCEPT to DROP stops the host from answering IPv4 ping. The IPv6 rules live in before6.rules and need their own edit. Blocking all ICMP can break path MTU discovery on IPv6, so I would only block echo requests, as above.
Further reading: ufw-framework manual page