mui / mui/material-ui

[joy-ui] Locally tweaking components' variants

Open
#39,363 0 comments 2 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

design: joy on hold package: joy-ui scope: all components
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Context

We’ve had been thinking about ways to improving global variants, and one option that we considered was to remove nonsensical variants (#39161). However, after feedbacks and discussions, we ended up finding that the tradeoffs to the developer experience wouldn’t justify removing them.

That said, we are keen to take a different approach: Locally tweaking only the nonsensical variants.

This means that there would be a deliberation about which variants make sense for a given component, and how they should look—instead of just changing colors.

Benefits
  1. Improvement on the visual design of the library.
  2. A lot more freedom for design customization. We’d feel safe to tweak how the outlined variant of a component looks without hurting the other.
    1. Developers would probably have a similar experience, being easier to customize with components being less dependent stylistic-wise.
  3. It’s not a foreign approach to developers ⎯ most of the UI component libraries use it.
Tradeoffs
  1. As far as DX, it would be less predictable, which props the tweaked variants will look like.
  2. Potentially a bit more work to develop and maintain these components as each style would be local (that’s, as far as I understand, the current Material UI reality, so not as foreign, though).
Components to be tweaked

Each one of these components is intended to have ad hoc tweaks to variants, and to see more details you should check the appropriate PRs.

  • Circular progress #39492
  • Linear progress #39492
  • Radio
  • Slider
  • Switch
  • Tabs
Will be iterated in the future
  • List
  • Table

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.