Skip to content

Add custom SVG icons to command bar Items #30899

Answered by shree998
shree998 asked this question in Q&A
Discussion options

You must be logged in to vote

I found a way to do this, the onRenderIcon function works, but it only works if iconProps is provided with a fluent UI-registered icon name.

const _items: ICommandBarItemProps[] = [ { key: 'assigned', text: 'Assigned', //cacheKey: 'myCacheKey', iconProps: { iconName: 'Assign' }, onRenderIcon: () => (<img style={{ height: "20px", width: "20px" }} src={AssignmentIcons.Assigned} />), className: filterType == 'assigned' ? 'selectedView' : '', onClick: () => handleFilterChange('assigned') },

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shree998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant