How to find hex of mdl2 icons?

import { initializeIcons } from '@fluentui/font-icons-mdl2';
// NOTE: getIcon is exported from @fluentui/style-utilities in v8-era Fluent
import { getIcon } from '@fluentui/style-utilities';
initializeIcons(); // do this once during startup
const hist = getIcon('History'); // returns { subset, code, ... } or undefined
const hex = hist && hist.code // e.g., "\uE8xx"
? hist.code.charCodeAt(0).toString(16).toUpperCase()
: null;
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply