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

Add className to props #38

Open
samfirminger opened this issue Nov 17, 2022 · 3 comments
Open

Add className to props #38

samfirminger opened this issue Nov 17, 2022 · 3 comments

Comments

@samfirminger
Copy link

When working with styled-components, in order to override styles of a third party component, the third party component needs to accept className. See here. Without this, it makes it very hard to use this library, which is a shame because it's lightweight and exactly what I need.

@coreyward
Copy link

You could create a simple wrapper component to make this work. Something like this:

const StyledTagInput = ({ className, ...rest }) => (
  <TagsInput
    classNames={{
      tag: className, // or input: className
    }}
    {...rest}
  />
)

@stephenbaek
Copy link

@coreyward Your code works like a charm! Thanks! One follow-up question: how would you change the style of the container? For some reason, I'm seeing some ugly border of the "rti--container" and I want to get rid of it. Any help would be appreciated!

@aktas
Copy link

aktas commented Dec 23, 2024

@coreyward Your code works like a charm! Thanks! One follow-up question: how would you change the style of the container? For some reason, I'm seeing some ugly border of the "rti--container" and I want to get rid of it. Any help would be appreciated!

In my case the hex codes did not work but the rgb did.

.rti--container {
    --rti-bg: rgb(26, 35, 50);
    --rti-border:  rgb(75, 85, 99)
}

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

No branches or pull requests

4 participants