The Ignite UI for Web Components IgcGridComponent icons can be customized to use custom icons from a different collection set using the exposed API methods:
registerIconFromText
registerIcon
setIconRef
Registering an icon caches it locally, so that it can reused between components, that reference that icon by name and collection name. Setting a reference changes which icon, from which collection, will be used when referencing that icon by name.
// Add a new 'material' icon called 'filter_list' from string
registerIconFromText("filter_list", '<svg>...</svg>', "material");
// Add a new 'material' icon called 'my-filter_list' from svg url
registerIcon("filter_list", "url" , "material")
// Sets the icon reference to the new registered icon.
setIconRef('filter_list', 'default', {
name: 'filter_list',
collection: 'material',
});
ts
Web Components Customize Icons Example
The following sample demonstrates how to switch from the original material icons to custom font awesome svg icons and back to material.
<!DOCTYPE html><html><head><title>Sample | Ignite UI | Web Components | infragistics</title><metacharset="UTF-8" /><linkrel="shortcut icon"href="https://static.infragistics.com/xplatform/images/browsers/wc.png"><linkrel="stylesheet"href="https://fonts.googleapis.com/icon?family=Material+Icons" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Kanit&display=swap" /><linkrel="stylesheet"href="https://fonts.googleapis.com/css?family=Titillium Web" /><linkrel="stylesheet"href="https://static.infragistics.com/xplatform/css/samples/shared.v8.css" /><linkrel="stylesheet"href="/src/index.css"type="text/css" /></head><body><divid="root"><divclass="container sample ig-typography"><igc-button-groupid="btnGroup"selection="single-required"style="width: fit-content;"><igc-toggle-buttonvalue="material"selected>Material Icons</igc-toggle-button><igc-toggle-buttonvalue="fontAwesome">Font Awesome Icons</igc-toggle-button></igc-button-group><divclass="container fill"><igc-gridauto-generate="false"name="grid"id="grid"row-editable="true"allow-filtering="true"filter-mode="excelStyleFilter"primary-key="ProductID"><igc-grid-toolbar><igc-grid-toolbar-actions><igc-grid-toolbar-advanced-filtering></igc-grid-toolbar-advanced-filtering><igc-grid-toolbar-hiding></igc-grid-toolbar-hiding><igc-grid-toolbar-pinning></igc-grid-toolbar-pinning><igc-grid-toolbar-exporter></igc-grid-toolbar-exporter></igc-grid-toolbar-actions></igc-grid-toolbar><igc-columnname="ProductName"id="ProductName"field="ProductName"header="Product Name"sortable="true"></igc-column><igc-columnname="UnitPrice"id="UnitPrice"field="UnitPrice"header="Unit Price"sortable="true"></igc-column><igc-columnname="UnitsOnOrder"id="UnitsOnOrder"field="UnitsOnOrder"header="Units On Order"sortable="true"></igc-column><igc-columnname="UnitsInStock"id="UnitsInStock"field="UnitsInStock"header="Units In Stock"sortable="true"></igc-column><igc-columnname="QuantityPerUnit"id="QuantityPerUnit"field="QuantityPerUnit"header="Quantity Per Unit"sortable="true"></igc-column><igc-columnname="ReorderLevel"id="ReorderLevel"field="ReorderLevel"header="Reorder Level"sortable="true"></igc-column><igc-columnname="Discontinued"id="Discontinued"field="Discontinued"header="Discontinued"sortable="true"></igc-column></igc-grid></div></div></div><!-- This script is needed only for parcel and it will be excluded for webpack -->
<% if (false) { %>
<scriptsrc="src/index.ts"></script>
<% } %>
</body></html>html
/* shared styles are loaded from: *//* https://static.infragistics.com/xplatform/css/samples */css
Like this sample? Get access to our complete Ignite UI for Web Components toolkit and start building your own apps in minutes. Download it for free.
Internal Icons
The following lists all internal icons. Alias is the name of the icon by which it can be referenced. Target Icon is the internal icon name and Target Collection is the collection in which the icon is registered internally.
Alias
Target Icon
Target Collection
add
add
material
add_child
add-child
imx-icons
add_row
add-row
imx-icons
arrow_back
arrow_back
material
arrow_drop_down
arrow_drop_up
material
arrow_forward
arrow_forward
material
arrow_next
chevron_right
material
arrow_prev
chevron_left
material
case_sensitive
case-sensitive
imx-icons
carousel_next
arrow_forward
material
carousel_prev
arrow_back
material
chevron_left
chevron_left
material
chevron_right
chevron_right
material
clock
access_time
material
close
close
material
collapse
expand_less
material
confirm
check
material
date_range
date_range
material
delete
delete
material
drag_indicator
drag_indicator
material
edit
edit
material
error
error
material
expand
expand_more
material
expand_more
expand_more
material
file_download
file_download
material
filter_all
select-all
imx-icons
filter_before
is-before
imx-icons
filter_contains
contains
imx-icons
filter_does_not_contain
does-not-contain
imx-icons
filter_empty
is-empty
imx-icons
filter_equal
equals
imx-icons
filter_false
is-false
imx-icons
filter_greater_than
greater-than
imx-icons
filter_greater_than_or_equal
greater-than-or-equal
imx-icons
filter_in
is-in
imx-icons
filter_last_month
last-month
imx-icons
filter_last_year
last-year
imx-icons
filter_less_than
less-than
imx-icons
filter_less_than_or_equal
less-than-or-equal
imx-icons
filter_next_month
next-month
imx-icons
filter_next_year
next-year
imx-icons
filter_not_empty
not-empty
imx-icons
filter_not_equal
not-equal
imx-icons
filter_not_null
is-not-null
imx-icons
filter_null
is-null
imx-icons
filter_starts_with
starts-with
imx-icons
filter_this_month
this-month
imx-icons
filter_this_year
this-year
imx-icons
filter_today
today
imx-icons
filter_true
is-true
imx-icons
filter_yesterday
yesterday
imx-icons
first_page
first_page
material
group_work
group_work
material
hide
visibility_off
material
import_export
import_export
material
input_collapse
arrow_drop_up
material
input_clear
clear
material
input_expand
arrow_drop_down
material
jump_down
jump-down
imx-icons
jump_up
jump-up
imx-icons
last_page
last_page
material
more_vert
more_vert
material
next
navigate_next
material
pin
pin-left
imx-icons
prev
navigate_before
material
refresh
refresh
material
remove
cancel
material
search
search
material
selected
done
material
show
visibility
material
sort_asc
arrow_upward
material
sort_desc
arrow_downward
material
functions
functions
material
table_rows
table_rows
material
today
calendar_today
material
tree_collapse
expand_more
material
tree_expand
chevron_right
material
unfold_less
unfold_less
material
unfold_more
unfold_more
material
unpin
unpin-left
imx-icons
view_column
view_column
material
Here's a breakdown of all icons as used by component:
Grid
Icon
Description
add
Used in excel-filter menu to add filter entry.
arrow_back
Used in various UI elements for moving a column backwards.
arrow_drop_down
Used in various buttons to indicate togglable menus.
arrow_forward
Used in various UI elements for moving a column forwards.
cancel
Used in various UI elements for canceling operations.
chevron_right
Used to indicate expandable menus, like in the excel style filtering.
close
Used to close an expanded menu.
confirm
Used to confirm an operation.
drag_indicator
Used to show a handle to indicate an item can be dragged.
error
Used in editable cells to indicate erroneous data input.
expand_more
Used by the excel filtering menu to indicate the addition of more filters.
file_dowload
Used by the excel filter exporter.
filter_*
Used for various filtering operands.
group_work
Used by the group-by drop area.
hide
Used by various UI elements for hiding columns.
import_export
Used by the pivot data selector for moving.
input_clear
Used by input fields for clearing input data.
next
Used by the filtering row menu to navigate between chips.
pin
Used by various UI elements for column pinning.
prev
Used by the filtering row menu to navigate between chips.
remove
Used by various UI elements as a removal indicator.
refresh
Used by the filtering row menu to reload the filters.
selected
Used by various UI elements to indicated active selection.
show
Used by various UI elements for showing columns.
sort_asc
Used by various UI elements to indicate sorting direction.
sort_desc
Used by various UI elements to indicate sorting direction.
functions
Used by the pivot grid and data selectors.
table_rows
Used by the pivot grid data selector.
tree_collapse
Used by tree-like structure to show less details.
tree_expand
Used by tree-like structure to show more details.
unpin
Used by various UI elements for column pinning.
unfold_less
Used by the hierarchical grid to collapse all rows.
unfold_more
Used by the hierarchical grid to expand all rows.
view_column
Used by the pivot data selector.
Paginator
Icon
Description
first_page
Used by the button used for navigating to the first page.
last_page
Used by the button used for navigating to the last page.
prev
Used by the button used for navigating to the previous page.
next
Used by the button used for navigating to the next page.