# @gluestack-ui/linear-gradient

> A universal headless LinearGradient component for React Native, Next.js & React

Latest version **0.1.3** (published 2024-11-11) · 0 weekly downloads

## Install

```sh
npm install @gluestack-ui/linear-gradient
pnpm add @gluestack-ui/linear-gradient
yarn add @gluestack-ui/linear-gradient
bun add @gluestack-ui/linear-gradient
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2024-11-11 |
| First published | 2023-08-25 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5300 |
| Maintainers | rajat693, sravankumarvelangi, vaibhk002, daminipandey, rayan1810, amars29, geekgautam, gluestackadmin, geekashwini, vidhi499, mayankp06, madhavb230100, viraj-10, rohit_singh, meenumakkar, surajahmedc |
| Keywords | react, native, react-native, linear-gradient, gluestack-ui, universal, headless, typescript, component, android, ios, nextjs |

## Links

- npm: https://www.npmjs.com/package/@gluestack-ui/linear-gradient
- Repository: https://github.com/gluestack/gluestack-ui
- Homepage: https://github.com/gluestack/gluestack-ui/tree/main/packages/unstyled/linear-gradient#readme
- Issues: https://github.com/gluestack/gluestack-ui/issues
- npm.io page: https://npm.io/package/@gluestack-ui/linear-gradient

## Dependencies (1)

- [expo-linear-gradient](https://npm.io/package/expo-linear-gradient.md) 12.3.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.3 (latest) — 2024-11-11
- 0.1.2 — 2023-10-20
- 0.1.1 — 2023-09-20
- 0.1.0 — 2023-09-11
- 0.0.3 — 2023-09-08
- 0.0.2 — 2023-08-25

## README

# @gluestack-ui/linear-gradient

## Installation

To use `@gluestack-ui/linear-gradient`, all you need to do is install the
`@gluestack-ui/linear-gradient` package:

```sh
$ yarn add @gluestack-ui/linear-gradient

# or

$ npm i @gluestack-ui/linear-gradient
```

## Usage

A linear-gradient component is a graphical user interface element that enables users to act by clicking or tapping. It can be customized in size, shape, color, and behavior to fit the design of the application or website. Here's an example how to use this package to create one:

```jsx
import { createLinearGradient } from '@gluestack-ui/linear-gradient';
import {
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
  Icon,
} from './styled-components';

export const LinearGradient = createLinearGradient({
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
  Icon,
});
```

## Customizing the LinearGradient:

Default styling of all these components can be found in the components/core/linear-gradient file. For reference, you can view the [source code](https://github.com/gluestack/gluestack-ui/blob/development/example/storybook/src/ui-components/LinearGradient/index.tsx) of the styled `LinearGradient` components.

```jsx
// import the styles
import {
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
} from '../components/core/linear-gradient/styled-components';

// import the createLinearGradient function
import { createLinearGradient } from '@gluestack-ui/linear-gradient';

// Understanding the API
const LinearGradient = createLinearGradient({
  Root,
  Text,
  Group,
  GroupHSpacer,
  GroupVSpacer,
  Spinner,
});

// Using the linear-gradient component
export default () => (
  <LinearGradientGroup>
    <LinearGradient>
      <LinearGradientText />
      <LinearGradientSpinner />
      <LinearGradientIcon />
    </LinearGradient>
  </LinearGradientGroup>
);
```

More guides on how to get started are available
[here](https://ui.gluestack.io/docs/components/forms/linear-gradient).

---
_Source: https://npm.io/package/@gluestack-ui/linear-gradient · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
