Icons
How the toolbar and ribbon icons of the spreadsheet, PDF viewer and document editor are built, where they come from, and what a host application can change.
The spreadsheet, the PDF viewer and the document editor draw their own icons. No icon font, image file or icon package is loaded at run time: every icon is a short string of SVG path data inside the package, rendered as an inline <svg> that takes its colour from the surrounding text.
One style across the three editors#
All three editors share one drawing style, so a button means the same thing wherever it appears:
- a 24 × 24 unit grid with at least one unit of padding on every side
- outline strokes with round caps and round joins, coloured with
currentColor - solid areas only where a stroke cannot carry the meaning, such as the black bar of the redaction tool or the header band of a table
- Office conventions for the metaphors: a clipboard for paste, a brush for the format painter,
.00with a left arrow for increase decimal, A → Z with a down arrow for an ascending sort, a page with a check mark or a cross for accept and reject
| Package | Icons | From Tabler Icons | Adapted from Tabler Icons | Drawn for Birch UI | Rendered size |
|---|---|---|---|---|---|
@birchui/spreadsheet |
90 | 67 | 3 | 20 | 16 px |
@birchui/pdf |
81 | 66 | 1 | 14 | 18 px |
@birchui/document |
158 | 126 | 7 | 25 | 18 px, 28 px on large ribbon buttons |
Where the icons come from#
Most icons are taken from Tabler Icons 3.53.0, which is published under the MIT licence. Only the path data is copied into the packages, so installing a Birch UI package adds no dependency. Where Tabler has no icon for an office command (merge cells, trace precedents, comma style, redaction, insert text and others), the icon is drawn for Birch UI on the same grid with the same stroke.
The file THIRD-PARTY-NOTICES.md at the root of the repository lists every icon that comes from Tabler, the changes made to it, and the licence text.
Product logos and other vendor trademarks are never used. The file-type badges for DOCX, XLSX, PDF and similar files are Birch UI drawings.
How an icon is stored#
Each icon is one string. The first part is the outline. Further parts are separated by |:
| Part | Meaning |
|---|---|
M4 6h16… |
Outline, stroked with currentColor |
f:M3 9h18… |
Solid area, filled with currentColor |
a:M4 18.5h16… |
Accent area, such as the colour bar under the text colour glyph. It is filled with currentColor and carries a class so that CSS can recolour it |
Colours and themes#
Icons follow the text colour of their button, so they adapt to the light and dark themes, to disabled and pressed states, and to forced-colours mode without extra rules.
The colour bar of the text colour, highlight and shading buttons in the document editor is a separate path with the class lq-doc-icon-accent. Give it any colour with CSS:
.lq-doc-ribbon [data-tool='textColor'] .lq-doc-icon-accent {
fill: #d1242f;
}The spreadsheet shows the current fill and text colour in a swatch under the icon, so its icons have no accent bar.
Sizes and stroke weight#
| Selector | Default | What you can change |
|---|---|---|
.lq-sheet-icon |
16 × 16 px, 2 unit stroke | width and height |
.lq-pdf-tool svg |
18 × 18 px, 1.8 unit stroke | width and height |
.lq-doc-icon |
18 × 18 px, 1.75 unit stroke | width, height and stroke-width |
The icons stay sharp at any size because they are vectors. They are checked at 16, 20 and 24 px on standard and high-density displays.
Accessibility#
Icons are decorative: each <svg> has aria-hidden="true" and focusable="false". The button that holds the icon carries the accessible name and the tooltip, including the keyboard shortcut where there is one.
Replacing icons#
There is no icons option that replaces the built-in set, in any of the three packages. What a host can do today:
| Package | Custom buttons |
|---|---|
@birchui/pdf |
A custom toolbar item takes icon, the name of a built-in icon |
@birchui/spreadsheet |
A custom ribbon item takes glyph, a short text shown in place of an icon |
@birchui/document |
Built-in icons only |
To restyle the built-in icons, use the CSS hooks above. To hide a button, use the toolbar options of the package.