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

feat(input-component): support icons left/right #5407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IndyVC
Copy link

@IndyVC IndyVC commented Oct 16, 2024

Using Icons inside an input field is something very common. Unfortunately, shadcn didn't truly provide it out of the box, while it easily could. This PR could solve it.

Following these issues:

I've also extended docs:
image

And code example:

import { MapIcon, MapPin } from "lucide-react"

import { Input } from "@/components/ui/input"

export function InputWithIcons() {
  return (
    <div>
      <Input>
        <Input.Icon side="left">
          <MapIcon />
        </Input.Icon>
        <Input.Icon side="right">
          <MapPin />
        </Input.Icon>
      </Input>
    </div>
  )
}

Copy link

vercel bot commented Oct 16, 2024

@IndyVC is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@daanboschmans
Copy link

Can we have this merged? pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants