nativescript-material-ripple
by farfromrefuge | v3.3.2
Material ripple component
npm i --save nativescript-material-ripple

npm npm GitHub forks GitHub stars

Installation

If using @nativescript :

  • tns plugin add nativescript-material-ripple

If using tns-core-modules

Be sure to run a new build after adding plugins to avoid any issues.


Material Design Spec

Usage

Plain NativeScript

IMPORTANT: Make sure you include xmlns:mdr="nativescript-material-ripple" on the Page element

XML

<Page xmlns:mdr="nativescript-material-ripple">
<StackLayout horizontalAlignment="center">
<mdr:Ripple rippleColor="green" width="100" height="100" />
</StackLayout>
</Page>

CSS

mdcripple {
ripple-color: blue;
}

NativeScript + Angular

import { NativeScriptMaterialRippleModule } from "nativescript-material-ripple/angular";

@NgModule({
imports: [
NativeScriptMaterialRippleModule,
...
],
...
})
<MDRipple rippleColor="green" width="100" height="100"></MDRipple>

NativeScript + Vue

import Vue from 'nativescript-vue';
import RipplePlugin from 'nativescript-material-ripple/vue';

Vue.use(RipplePlugin);
<MDRipple rippleColor="green" width="100" height="100"/>

Attributes

Inherite from Nativescript StackLayout

Attributes

  • rippleColor optional

An attribute to set the ripple color of the ripple.