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 posibility to style the knob itself. #22

Closed
padsbanger opened this issue Apr 16, 2020 · 1 comment
Closed

Add posibility to style the knob itself. #22

padsbanger opened this issue Apr 16, 2020 · 1 comment

Comments

@padsbanger
Copy link

Is your feature request related to a problem? Please describe.
I would like to have an ability to style the knob itself.

Describe the solution you'd like
An ability to pass styles to knob so that I can style it like this:
1

(white background with black border)

@gfazioli
Copy link
Owner

@padsbanger hey, if you are using the styled-components, you may

const Wire = styled(Toggle)`
  && {
    input[type="checkbox"] + label::after {
      border:2px solid #000;
      width: 14px;
      height: 14px;
    }
  }  
`

and then

     <Label htmlFor="toggle-9">
            <Wire
              leftBackgroundColor="white"
              rightBackgroundColor="white"
              borderColor="black"
              knobColor="white"
              name="toggle-9"
              onToggle={e => console.log("onToggle", e.target.checked)}
            />
            Right label
   </Label>

image

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

2 participants