Skip to content

Build TypeScript demos for all Joy components #36367

@hbjORbj

Description

@hbjORbj

We need your help!

Some Joy components do not have TypeScript versions of demos but only JavaScript demos. We need the community's help to ensure that all Joy components have TypeScript demos.

Contribution guides

  1. Pick a component in the “Ready to be picked up” section
  2. Go to docs/data/joy/components/${component} directory.
  3. For the demos that do not have matching typescript (.tsx) versions, create typescript files with the same name. For example, docs/data/joy/components/Checkbox has CheckboxColors.js while it doesn't have CheckboxColors.tsx. Create CheckboxColors.tsx.

Warning ⚠️: For ${Component}Variables.js and ${Component}Usage.js, we DO NOT need typescript versions.

  1. In the typescript file, copy/paste the code from its matching JavaScript demo, and turn it into type-safe code. For example, you can type the states, refs or the arguments of functions inside the demo. In some demos, the TypeScript version can be exactly the same as the JavaScript version. This is fine.
  2. Run yarn docs:typescript:formatted and yarn prettier.
  3. Verify that it works
    1. Run yarn docs:dev.
    2. go to URL /joy-ui/react-{component}/ (e.g., /joy-ui/react-checkbox) and check the demos (it should look the same).
    3. For every demo, both the "js" and "ts" toggle buttons at the left-top of the source code must be enabled as shown in the screenshot below.

Screenshot 2023-02-28 at 11 47 52

  1. Open a PR, put the URL to the the end of the component below (so that everyone knows it has been taken) and check the box.
  2. Tag @mui/core to review

If you come across any issue or are unsure of the changes, feel free to open a PR and describe the problem + tag @mui/core for help.

Example PR

#36366

List of components

Ready to be picked up

Metadata

Metadata

Assignees

Labels

docsImprovements or additions to the documentation.package: joy-uiSpecific to Joy UI.umbrellaFor grouping multiple issues to provide a holistic view

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions