Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
john1625b opened this issue Sep 15, 2023 · 1 comment
Open
2 tasks done

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

john1625b opened this issue Sep 15, 2023 · 1 comment
Assignees
Labels
component: text field This is the name of the generic UI component, not the React module! discussion package: joy-ui Specific to @mui/joy

Comments

@john1625b
Copy link

john1625b commented Sep 15, 2023

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.
@john1625b john1625b added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 15, 2023
@oliviertassinari oliviertassinari added the package: joy-ui Specific to @mui/joy label Sep 16, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 16, 2023

Related to #34176.

I think the docs experience we have today could be better. I think we could move https://mui.com/joy-ui/react-input/ to have it at https://mui.com/joy-ui/react-text-field/, and have the label use case almost at the top of the page.

Also, I feel we too a too big of a leap. Personally, It would make more sense to me to reverse the tradeoff used in https://mui.com/material-ui/react-text-field/#components without going as far as removing the TextField. Meaning, we could make the composition the default in Joy UI and the helper component optional, when it's the opposite in Material UI.

@oliviertassinari oliviertassinari added the component: text field This is the name of the generic UI component, not the React module! label Sep 16, 2023
@danilo-leal danilo-leal changed the title Should <Input/> have a label prop? [joy-ui][Input] Should it have a label prop? Sep 18, 2023
@john1625b john1625b changed the title [joy-ui][Input] Should it have a label prop? [joy-ui][Input] Should Input have a label prop? Sep 19, 2023
@siriwatknp siriwatknp added discussion and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: text field This is the name of the generic UI component, not the React module! discussion package: joy-ui Specific to @mui/joy
Projects
None yet
Development

No branches or pull requests

3 participants