question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LinearGradient component

See original GitHub issue

I recently came across this beautiful landing page from auth0: https://auth0.design/

It included these cool gradients:

Screen Shot 2021-02-11 at 11 06 28 AM

Which reminded me of this webflow theme I used for the doorman.cool website:

Screen Shot 2021-02-11 at 11 09 04 AM

It would be cool to have a LinearGradient component in Dripsy, which re-exports Expo’s.

import { LinearGradient } from '@dripsy/gradient'

// theme colors
<LinearGradient colors={['primary', 'accent']} />

Maybe you could even have gradients in your theme.

const theme = {
  linearGradients: {
    strong: ['primary', 'secondary']
  }
}

<LinearGradient variant="strong" />

The variant prop might not be the right one to use here, since we’re technically not applying a set of styles, but rather we’re using an opinionated mapping of colors -> props.

This might be more appropriate:

const theme = {
  linearGradients: {
    strong: ['primary', 'secondary']
  }
}

<LinearGradient gradient="strong" />

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
nandorojocommented, Feb 11, 2021

One last thing, which is unrelated but I’m seeing on the Pressable code. Our current types for the ref prop in createThemedComponent are wrong. I’m forced to pass as any whenever I pass a ref down.

1reaction
cmaycumbercommented, Feb 11, 2021

Alright, I’ll try to make your code the basis for the pressable component and check out that other issue. We can always tweak as we go.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<linearGradient> - SVG: Scalable Vector Graphics | MDN
The <linearGradient> element lets authors define linear gradients to apply to other SVG elements. Example.
Read more >
LinearGradient - Expo Documentation
LinearGradient. Type: Component<LinearGradientProps>. Renders a native view that transitions between multiple colors in a linear direction.
Read more >
React Native Linear Gradient - GitHub
A component for react-native. Contribute to react-native-linear-gradient/react-native-linear-gradient development by creating an account on GitHub.
Read more >
Creating complex gradients with react-native-linear-gradient
The LinearGradient component takes in a few props that determine how the gradient will be displayed, including colors, where it starts, ...
Read more >
SVG Linear Gradient - W3Schools
SVG Gradients. A gradient is a smooth transition from one color to another. In addition, several color transitions can be applied to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found