Repository: material-ui
Issue: [RFC] icons exports structure for Material Symbols
Labels: package: icons,RFC

### What's the problem?

This RFC looks at 2 problems with icons:
1. for MUI's users, there's no out-of-the-box option to enforce icons' variant: `Sharp`, `Rounded`, `Outlined`, `TwoTone`, `Filled`
2. too many icons; it affects performance (see related issues)

### What are the requirements?

MUI's user should be able to enforce icons' variants and the number of icons shouldn't affect DX.

### Proposed solution

We can tackle both problems by allowing MUI's users to have more consistent interfaces by enforcing icons' variants using ESLint's [no-restricted-imports](https://eslint.org/docs/latest/rules/no-restricted-imports).

File structure for Material Icons:
- the barrel file has 5x less icons 2,127 instead of 10,635
```sh
|-- index.ts // exports everything as it is now to support the current usage
|-- /variants
   |-- /sharp // exports only Sharp variant, available as "@mui/icons-material/sharp"
   |-- /rounded // exports only Rounded variant, available as "@mui/icons-material/rounded"
   |-- /outlined // exports only Outlined variant, available as "@mui/icons-material/outlined"
   |-- /two-tone // exports only TwoTone variant, available as "@mui/icons-material/two-tone"
   |-- /filled // exports only Filled variant, available as "@mui/icons-material/filled"
```

File structure for Material Symbols:
- the barrel file has 63x less icons 2,500 instead of 157,500

```sh
|-- index.ts // exports everything as it is now to support the current usage
|-- /variants
   |-- /sharp // exports only Sharp variant, available as "@mui/icons-material/sharp"
      |-- /100 // exports only 100 weight, available as "@mui/icons-material/sharp/100"
         |-- /neg25 // exports only -25 grade, available as "@mui/icons-material/sharp/100/neg25"
         |-- /0 // exports only 0 grade, available as "@mui/icons-material/sharp/100/0"
         |-- /200 // exports only 200 grade, available as "@mui/icons-material/sharp/100/200"
      |-- ...other weights in separate directories 200, 300, 400, 500, 600, 700
   |-- /rounded // exports only Rounded variant, available as "@mui/icons-material/rounded"
      |-- /100 // exports only 100 weight, available as "@mui/icons-material/rounded/100"
         |-- /neg25 // exports only -25 grade, available as "@mui/icons-material/rounded/100/neg25"
         |-- /0 // exports only 0 grade, available as "@mui/icons-material/rounded/100/0"
         |-- /200 // exports only 200 grade, available as "@mui/icons-material/rounded/100/200"
      |-- ...other weights in separate directories 200, 300, 400, 500, 600, 700
   |-- /outlined // exports only Outlined variant, available as "@mui/icons-material/outlined"
      |-- /100 // exports only 100 weight, available as "@mui/icons-material/outlined/100"
         |-- /neg25 // exports only -25 grade, available as "@mui/icons-material/outlined/100/neg25"
         |-- /0 // exports only 0 grade, available as "@mui/icons-material/outlined/100/0"
         |-- /200 // exports only 200 grade, available as "@mui/icons-material/outlined/100/200"
      |-- ...other weights in separate directories 200, 300, 400, 500, 600, 700
```

### Related issues

- https://github.com/mui/material-ui/issues/29687
- https://github.com/mui/material-ui/issues/35840
- https://github.com/mui/material-ui/issues/32846

**Search keywords**: material icons, symbols, icons v2