Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tralves/nativescript-shadowed-label

A NativeScript Label that supports text shadow.
https://github.com/tralves/nativescript-shadowed-label

Last synced: about 1 month ago
JSON representation

A NativeScript Label that supports text shadow.

Awesome Lists containing this project

README

        

# NativeScript Shadowed Label


npm


npm


stars


donate

A NativeScript plugin that extends the `` UI widget by adding the `text-shadow` CSS property.

| shadow examples | sample from the [playground](https://play.nativescript.org/?template=play-vue&id=roCIm3) |
| ----------------------------------- | ---------------------------------------------------------------------------------------- |
| ![](images/shadowed-label-demo.png) | ![](images/playing-with-shadows.gif) |

> This version is for NS 6. You will find the NS 7 version [here](https://github.com/tralves/nativescript-plugins/tree/master/packages/shadowed-label).

## Installation

```bash
tns plugin add nativescript-shadowed-label
```

## Usage

After installing the plugin, you can add the shadow to the shadowed label with the CSS syntax:

`text-shadow: `

E.g.

```css
.shadow1 {
text-shadow: 1 1 3 blue;
}

.shadow2 {
text-shadow: 10px 10px 10px rgba(100, 130, 200, 0.8);
}
```

You can also add the text shadow as a property (e.g. ``)

_iOS note: The blur radius appears scatters the shadow more on iOS and on Android._

### NativeScript Plain

IMPORTANT: _Make sure you include `xmlns:shadowedLabel="nativescript-shadowed-label"` on the Page element_

#### XML

```xml





```

#### CSS

```css
.h1 {
text-shadow: 2 2 2 #aaa;
font-weight: bold;
}
```

---

### NativeScript Angular

```typescript
import { registerElement } from 'nativescript-angular/element-registry';
import { ShadowedLabel } from 'nativescript-shadowed-label;
registerElement('ShadowedLabel', () => ShadowedLabel);
```

```html

```

---

### NativeScript Vue

```javascript
import Vue from 'nativescript-vue';
Vue.registerElement('ShadowedLabel', () => require('nativescript-shadowed-label').ShadowedLabel);
```

```html

```

## License

Apache License Version 2.0, January 2004