- Checkout this repository
- Have corepack enabled:
corepack enable
yarn install
yarn watch
- Do your changes (see below)
- Use
yarn generateOverrides
to add any new classes also to the Overrides module. - Commit and create a Pull Request
- Take any component from MUI and look for its
d.ts
file, e.g. Accordion.d.ts - Copy the content of the props type over, including the documentation comments.
- Copy also the classes type over, e.g. accordionClasses.ts. This one always must be
type classes
as it gets picked up by thegenerateOverrides
script. - Replace all
;
with,
and adapt the types accordingly. - Cross-check with the corresponding MUI page, e.g. https://mui.com/material-ui/api/accordion/, if you ended up with all the listed props (execept for deprecated ones)
- Have a look at
Accordion.res
for inspiration.
- Every main props type needs to inherit from
CommonProps.t
, except if MUI documentation explicitly says that only the listed props are the valid ones. - If some component inherits from a MUI parent, the props to inherit from need to be called publicProps, e.g.
Paper.publicProps
. This is necessary, because prop names cannot be overwritten with different types. For instance theclasses
type is different betweenAccordion
andPaper
(of which the former inherits most props).
- For uppercase names, always use @as and write the first letter lowercase
- if there is a conflict, add a
_
behind the name - Examples:
InputProps
conflicts withinputProps
so it becomesinputProps_
MuiSlider
becomesmuiSlider
- if there is a conflict, add a
- For props that are ReScript keywords, add a
_
behind the name- Examples:
type
becomestype_
open
becomesopen_
- Examples: