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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextField] Implement variant without shrinking label #27940

Open
1 task done
eoliphan opened this issue Aug 24, 2021 · 2 comments
Open
1 task done

[TextField] Implement variant without shrinking label #27940

eoliphan opened this issue Aug 24, 2021 · 2 comments
Labels
component: text field This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@eoliphan
Copy link

eoliphan commented Aug 24, 2021

This isn't standard Material UI, but the spec's handling of input labels is perhaps one of its most loved and hated bits. Labels outside is a pretty common pattern, so would be nice to just have a variant for it, to avoid losing the convenience of the high-level TextField, etc abstraction

  • I have searched the issues of this repository and believe that this is not a duplicate.

Summary 💡

Basically something like <TextField variant="normal"/> would render

<FormControl ..>
   <InputLabel> ...  // perhaps a bit larger/bolder than the MUI default, no shrink
   <OutlinedInput> ..
   <FormHelperText>..
   ...   

Basically something sort of like the bootstrap input styling example

Motivation 🔦

Ease of use for a non-spec, but common pattern for fields and their input labels

@eoliphan eoliphan added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 24, 2021
@eps1lon eps1lon changed the title "Normal" or something variant for inputs to place labels outside [TextField] Implement variant without shrinking label Aug 25, 2021
@eps1lon eps1lon added component: text field This is the name of the generic UI component, not the React module! new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 25, 2021
@siriwatknp
Copy link
Member

cc @michaldudak may be unstyled can provide a composition for this.

@michaldudak
Copy link
Member

With the unstyled TextField you'll be able to implement various patterns regarding inputs and labels, but it will require customization. Perhaps the second design system that we about to work on could have a solution. As far as I remember we were discussing not having labels inside (visually) inputs.

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! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants