SwiftUI.js
Components

LinearGradient

LinearGradient fills a view using color stops distributed along a line.

LinearGradient fills a view using color stops distributed along a line.

Examples

Example

Preview unavailable for this example in the static docs build.

Show code
<LinearGradient endPoint="bottomTrailing" startPoint="topLeading" stops={[
      { color: '#0a84ff', location: 0 },
      { color: '#64d2ff', location: 0.45 },
      { color: '#30d158', location: 1 },
    ]} style={{
      borderRadius: '20px',
      height: '220px',
      width: '100%',
    }}></LinearGradient>

API

PropTypeRequiredDescription
startPointIUnitPointNoNo description yet.
endPointIUnitPointNoNo description yet.
stopsIGradientStop[]YesNo description yet.

Inherits additional props from IBaseComponent.

Overview

LinearGradient fills a view using color stops distributed along a line.

SwiftUI Correspondence: Mirrors SwiftUI's LinearGradient with stops, startPoint, and endPoint.

On this page