mui / mui/material-ui

[joy-ui][Input] Should Input have a label prop?

Open
#39,001 1 comment 0 reactions 1 assignee View on GitHub

@siriwatknp is already working on this.

Since Sep 18, 2023.

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

Description

Duplicates
  • I have searched the existing issues
Latest version
  • I have tested the latest version
Summary 💡

In my opinion, adding three extra lines of code and importing 2 more components seems like too much complexity for such a commonly-used and trivial use case:

<FormControl>
  <FormLabel>Label</FormLabel>
  <Input placeholder="Placeholder" />
  <FormHelperText>This is a helper text.</FormHelperText>
</FormControl>

Wouldn't it be better to abstract this all away with a label and 'helperText' prop. like so:

<Input label="Label" helperText="This is a helper text."/>

I know the regular Mui library has this on TextField, so why not the JoyUI Input?

Examples 🌈

No response

Motivation 🔦
  • reduce lines of code
  • reduce imports
  • increase simplicity of code
  • more opinionated.

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.