1# Icon Themes
2
3Extensions may provide icon themes in order to change the icons Zed uses for folders and files.
4
5## Example extension
6
7The [Material Icon Theme](https://github.com/zed-extensions/material-icon-theme) serves as an example for the structure of an extension containing an icon theme.
8
9## Directory structure
10
11There are two important directories for an icon theme extension:
12
13- `icon_themes`: This directory will contain one or more JSON files containing the icon theme definitions.
14- `icons`: This directory contains the icons assets that will be distributed with the extension. You can created subdirectories in this directory, if so desired.
15
16Each icon theme file should adhere to the JSON schema specified at [`https://zed.dev/schema/icon_themes/v0.2.0.json`](https://zed.dev/schema/icon_themes/v0.2.0.json).
17
18Here is an example of the structure of an icon theme:
19
20```json
21{
22 "$schema": "https://zed.dev/schema/icon_themes/v0.2.0.json",
23 "name": "My Icon Theme",
24 "author": "Your Name",
25 "themes": [
26 {
27 "name": "My Icon Theme",
28 "appearance": "dark",
29 "directory_icons": {
30 "collapsed": "./icons/folder.svg",
31 "expanded": "./icons/folder-open.svg"
32 },
33 "chevron_icons": {
34 "collapsed": "./icons/chevron-right.svg",
35 "expanded": "./icons/chevron-down.svg"
36 },
37 "file_stems": {
38 "Makefile": "make"
39 },
40 "file_suffixes": {
41 "mp3": "audio",
42 "rs": "rust"
43 },
44 "file_icons": {
45 "audio": { "path": "./icons/audio.svg" },
46 "default": { "path": "./icons/file.svg" },
47 "make": { "path": "./icons/make.svg" },
48 "rust": { "path": "./icons/rust.svg" }
49 // ...
50 }
51 }
52 ]
53}
54```
55
56Each icon path is resolved relative to the root of the extension directory.
57
58In this example, the extension would have a structure like so:
59
60```
61extension.toml
62icon_themes/
63 my-icon-theme.json
64icons/
65 audio.svg
66 chevron-down.svg
67 chevron-right.svg
68 file.svg
69 folder-open.svg
70 folder.svg
71 rust.svg
72```