Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mauriceconrad/naive-gradient-picker

Naive UI Gradient picker component
https://github.com/mauriceconrad/naive-gradient-picker

Last synced: about 1 month ago
JSON representation

Naive UI Gradient picker component

Awesome Lists containing this project

README

        

# Naive UI Gradient Picker

![Preview](https://raw.githubusercontent.com/MauriceConrad/naive-gradient-picker/main/resources/preview.png)

```bash
$ npm install naive-gradient-picker
```

### Basic usage

The `` component models any valid CSS gradient value (e.g. `linear-gradient(90deg, #fff, #00f 30%, #f00)`).

**Template**

```html

```

#### Size

The size can have the following values: `tiny`, `small`, `medium` or `large`.

**Script**

```javascript
// Import component
import NGradientPicker from 'naive-gradient-picker'
// Import component's style
import 'naive-gradient-picker/style.css'

// Initialize a reactive gradient string
const gradient = ref(`linear-gradient(to right, blue, red, green)`);
```

### Naive Angle Thumb

Aside the `` component, you can also use the `` component if you want to use the angle thumb used within the gradient picker on its own.

**Template**

```html

```

**Script**

```javascript
// Import component
import { NAngleThumb } from 'naive-gradient-picker'
// Import component's style
import 'naive-gradient-picker/style.css'

// Initialize a reactive angle
const angle = ref(90);
```