Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

310
Views
Espacio adicional en la etiqueta cuando la reducción es verdadera con un tamaño de fuente de 12 px en el campo de texto mui

Estoy tratando de personalizar el componente textField pero tengo un problema con la etiqueta cuando se reduce:

 import * as React from "react"; import TextField from "@mui/material/TextField"; import { createTheme } from "@mui/material/styles"; import createStyled from "@mui/system/createStyled"; import type { TextFieldProps } from "@mui/material/TextField"; const defaultTheme = createTheme({}); const styled = createStyled({ defaultTheme }); const CustomTextField = styled(TextField)<TextFieldProps>( ({ theme, size }) => ({ "& .MuiOutlinedInput-root": { height: size === "small" ? theme.spacing(5) : theme.spacing(6) }, "& .MuiInputLabel-root": { transform: "translate(14px, 8px) scale(1)" }, "& .MuiInputLabel-shrink": { transform: "translate(12px, -9px) scale(0.75)", fontSize: "12px", fontWeight: 500, letterSpacing: 0.6, lineHeight: '20px', "&.MuiInputLabel-sizeSmall": { transform: "translate(12px, -9px) scale(0.75)" } } }) ); export default function BasicTextFields() { return ( <CustomTextField id="outlined-basic" label="long" variant="outlined" size="medium" InputLabelProps={{ shrink: true }} /> ); }

Hay espacio adicional entre el borde y el texto: Etiqueta larga

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

aquí hay un caso de exhibición para Mui fieldSet y la leyenda en el componente TextFiled.

 import * as React from "react"; import TextField from "@mui/material/TextField"; import { createTheme } from "@mui/material/styles"; import createStyled from "@mui/system/createStyled"; import type { TextFieldProps } from "@mui/material/TextField"; const defaultTheme = createTheme({}); const styled = createStyled({ defaultTheme }); const CustomTextField = styled(TextField)<TextFieldProps>( ({ theme, size }) => ({ "& .MuiOutlinedInput-root": { height: size === "small" ? theme.spacing(5) : theme.spacing(6), '& fieldset legend span':{ opacity:1, backgroundColor:'blue', marginRight:10, } }, "& .MuiInputLabel-root": { transform: "translate(14px, 8px) scale(1)", backgroundColor:'red' }, "& .MuiInputLabel-shrink": { transform: "translate(12px, -9px) scale(0.75)", "&.MuiInputLabel-sizeSmall": { transform: "translate(12px, -9px) scale(0.75)" } } }) ); export default function BasicTextFields() { return ( <CustomTextField id="outlined-basic" label="long" variant="outlined" size="medium" InputLabelProps={{ shrink: true }} /> ); }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!