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

Switch thumb is green and I can't change it #1848

Closed
baptisteArno opened this issue Dec 17, 2020 · 2 comments
Closed

Switch thumb is green and I can't change it #1848

baptisteArno opened this issue Dec 17, 2020 · 2 comments

Comments

@baptisteArno
Copy link

I implemented a simple Switch:

        <View style={{ flexDirection: "row", alignItems: "center" }}>
          <Text style={{ ...grotesk, marginRight: 5 }}>cm</Text>
          <Switch
            trackColor={{ false: blue, true: blue }}
            onValueChange={() =>
              setMeasurementUnits(
                measurementUnits === "inches" ? "centimeters" : "inches"
              )
            }
            value={measurementUnits === "inches"}
          />
          <Text style={{ ...grotesk, marginLeft: 5 }}>inches</Text>
        </View>

And the thumb color is green when the switch is enabled? I can't figure out how to change this.

CleanShot 2020-12-17 at 17 46 24

@necolas
Copy link
Owner

necolas commented Dec 17, 2020

See the docs https://necolas.github.io/react-native-web/docs/?path=/docs/components-switch--active-thumb-color

@necolas necolas closed this as completed Dec 17, 2020
@paulwongx
Copy link

paulwongx commented Nov 5, 2021

For people coming from Google, what you're looking for is activeThumbColor and probably implemented for web in such a way like

<Switch
    // ...your other switch props
    {...Platform.select({web: {
        activeThumbColor: "white"
    }})}
/>

Also, new link as of Nov 5, 2011: https://necolas.github.io/react-native-web/docs/switch/

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

3 participants