Skip to content

Using a MUI Icon as side label text #106

Answered by rokotyan
ndtreviv asked this question in Q&A
Discussion options

You must be logged in to vote

Since Unovis's core is not native to React, you can't provide icons as React components. However, you can import Material UI icons as an icon font and provide an the exact characters code to text:

          nodeSideLabels={useCallback((n) => n.expanded ? [] : [{ text: `` }], [])}

Don't forget to set the --vis-graph-icon-font-family CSS variable to the name of your icon font, e.g.:

--vis-graph-icon-font-family : 'Material Icons'

P.S. You can browse through the icons and find their character codes here:
b1.png)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ndtreviv
Comment options

@ndtreviv
Comment options

@rokotyan
Comment options

Answer selected by ndtreviv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants