Adaptable Icon
Summary
- The Adaptable Icon object enables the provision of customizable icons
- Icons are very widely used in Adaptable including in Buttons, Menus, and Badge Style
- An AdapTable Icon can be one of 3 types:
- a System icon provided by AdapTable
- a Custom icon provided by a developer
- an HTML element provided by a developer
The Adaptable Icon is used in many places in AdapTable including:
- In Adaptable Buttons
- As the Application Icon (which appears in the Dashboard and Toast Notifications)
- In Column Menu and Context Menu items
- In Badge Style Columns
AdapTable Icons can be styled as needed.
Types of Adaptable Icon
An Adaptable Icon definition (of type AdaptableIcon) can be one of 3 types:
- System Icon - shipped with AdapTable
- Custom Icon - defined and provided by the user
- HTML Element Icon - specified by the user
System Icon
AdapTable provides a number of SVG icons that can be used in various use cases.
This is done by simply referencing the name of the icon.
Note
The full list of available AdapTable Icons - with their names - is provided in the Appendix to this page
Optionally the size of the icon may be specified.
Deep Dive
The System Icon Definition
- This demo leverages a number of different System Icons which are used in various ways:
- an Application Icon (see below for more details) that uses the
homeSystem Icon - 2 Custom Predicates (
Popular&Vanillaon theName&Languagecolumns) using thebroadcastandcheck-circleSystem Icons - 3 Custom Toolbar Buttons which show the 2 Custom Predicates described above (and the same System Icons) plus a Clear button (that uses
closeSystem Icon) - a Dashboard Button to switch Themes that uses the
themesystem icon - a Badge Style on the
Languagecolumn that uses theassignmentSystem Icon - a User Context Menu Item (
Expand / Collapse Dashboard) that usesexpandandcollapseSystem Icons - a User Column Menu Item to set System Status that uses
traffic-lights,error,warning,checkedandinfoSystem Icons
- an Application Icon (see below for more details) that uses the
Custom Icon
Where the System Icons are insufficient, Custom Icons may be provided by developers.
Technically, the icon will be rendered as an <img> element with the provided src attribute.
The src attribute of the <img> element may be a relative, or absolute, path to any supported image format.
Alternatively, the image can be an SVG format if required.
Custom Icons can be configured in 2 ways:
- "in-place", directly provided when needed (e.g. when defining a Button)
- via the
customIconsproperty in User Interface Options and then referenced by name when needed
Hint
- An advantage of providing a
customIconscollection is that you can easily re-use the same Icon in multiple places - Another advantage is that run-time users can select these Icons in the UI (e.g. when creating a Badge Style)
customIcons
- This demo defines 4 Custom Icons -
JavaScript,TypeScript,HTMLandPopular- in User Interface Options, which we use in multiple places:- as a Badge Style on the
LanguageandNamecolumns - as Custom Predicates - available in
LanguageandNamecolumns - in a User Context Menu Item and User Column Menu Item (for the
NameColumn only) which use thePopularicon - as Dashboard Buttons and Custom Toolbar Buttons
- as a Badge Style on the
HTML Element Icon
This option allows users to provide the Icon as a DOM element or HTML string.
Deep Dive
The Element Icon Definition
- In this example we provide an Icon as an HTML Element, which we use in the button in the toolbar
Styling Icons
The style of an Adaptable Icon - for both system or custom icons - may be customized with the following common properties, defined by AdaptableBaseIcon:
| Property | Description |
|---|---|
| className | The class name of the icon |
| style | CSS Properties |
Application Icon
AdapTable allows users to supply an Application Icon which can be used in multiple places:
- Dashboard
- Settings Panel
- Anywhere where Icons are displayed (e.g Buttons)
This is provided in the applicationIcon property in User Interface Options.
applicationIcon
- This example defines a Custom Application Icon (defined in User Interface Options), which is viewable:
- in the top left of the Dashboard
- in the Settings Panel
- in the Toast Notification when an Alert fires (by setting
showApplicationIconto true in Notification Options )
- Change the value of any cell to trigger the Alert: note the Application Icon in the Toast Notification
- Open the Settings Panel and see the Application Icon displayed
Appendix: AdapTable Icon Library
This is the full list of System Icons available in AdapTable.
add | add-circle | alert | align-center |
align-justify | align-left | align-right | arrow-down |
arrow-down-long | arrow-expand | arrow-left | arrow-right |
arrow-up | arrow-up-long | assignment | badge |
bold | boolean-list | brain | broadcast |
brush | building | calculated-column | calendar |
call | case-lower | case-sentence | case-upper |
cells | chart | chat | check |
check-circle | checked | clipboard | clone |
close | cloud-upload | collapse | collapse-all |
color-palette | column-add | column-outline | columns |
comment | comments | contact | contains |
copy | csv | dashboard | data-set |
date-range | delete | division | dock |
dollar | download | downloaded | drag |
edit | edit-table | ends-with | equals |
equation | error | excel | expand |
expand-all | exponent | export | export-data |
fast-backward | fast-forward | fdc3 | filled-circle |
filter | filter-list | filter-off | flag |
folder | folder-open | folder-shared | function |
gradient | greater-than | greater-than-or-equal | grid |
grid-filter | grid-info | history | home |
horizontal-lines | import | import-export | info |
inspector | interactions | italic | json |
laptop | less-than | less-than-or-equal | lightning |
link | list | logout | mail |
menu | minus | money | multiplication |
newpage | news | not-contains | not-equal |
note | open-in-new | order | organisation |
overline | paperclip | pause | percent |
percent-tag | person | pie-chart | play |
plus | quote | refresh | regex |
reminder | resume | rows | save |
schedule | science | search | search-table |
select-all | select-fwd | select-off | settings |
sort-asc | sort-desc | spanner | spark-line |
starts-with | statusbar | stop | strikethrough |
styled-grid | sync | tab-unselected | target |
theme | traffic-lights | triangle-down | triangle-up |
unchecked | underline | undo | unfilled-circle |
upload | visibility-off | visibility-off-bold | visibility-on |
visibility-on-bold | warning |