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

[Feature Request] Theme setting for default labelPlacement #4621

Open
jprosevear opened this issue Jan 21, 2025 · 5 comments · May be fixed by #4346
Open

[Feature Request] Theme setting for default labelPlacement #4621

jprosevear opened this issue Jan 21, 2025 · 5 comments · May be fixed by #4346
Labels
🔦 Type: Feature New feature or request

Comments

@jprosevear
Copy link

Is your feature request related to a problem? Please describe.

Right now afaict have to override label placement for every individual select/input/etc if using something other than default.

Describe the solution you'd like

Theme setting { defaultLabelPlacement: 'outside-left' } or whatever.

Describe alternatives you've considered

Wrapping every labelled component

Screenshots or Videos

No response

Copy link

linear bot commented Jan 21, 2025

@willalread
Copy link

@jprosevear you can use the extendVariants function to set your own variants/defaults for each component. This is how I set the labelPlacement="outside" as well as autoComplete="off" and change the default height.

import { extendVariants, Input } from "@heroui/react"

const CustomInput = extendVariants(Input, {
  variants: {
    size: {
      md: {
        inputWrapper: "h-9 min-h-9",
      },
    },
  },
  defaultVariants: {
    size: "md",
    labelPlacement: "outside",
    autoComplete: "off",
  },
})

export { CustomInput as Input }

@jprosevear
Copy link
Author

This is nicer than what I'm doing, but still think its a valid feature request.

@wingkwong wingkwong linked a pull request Jan 22, 2025 that will close this issue
@wingkwong
Copy link
Member

There's a PR that allows you to set it in our provider to override it globally. ref: #4346. Scheduled in next minor release.

@jprosevear
Copy link
Author

Basically exactly what I need.

@wingkwong wingkwong added the 🔦 Type: Feature New feature or request label Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔦 Type: Feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants