3.3.2 • Published 3 years ago

nativescript-material-textfield v3.3.2

Weekly downloads
130
License
Apache-2.0
Repository
-
Last release
3 years ago

npm npm GitHub forks GitHub stars

Installation

If using @nativescript :

  • tns plugin add nativescript-material-textfield

If using tns-core-modules

  • tns plugin add nativescript-material-textfield@2.5.4

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:mdt="nativescript-material-textfield" on the Page element

XML

<Page xmlns:mdt="nativescript-material-textfield">
    <StackLayout horizontalAlignment="center">
        <mdt:TextField text="raised textfield"/>
        <mdt:TextField variant="flat" text="flat textfield"/>
        <mdt:TextField variant="text" text="text textfield"/>
        <mdt:TextField elevation="5" rippleColor="red" text="raised custom textfield"/>
   </StackLayout>
</Page>

CSS

mdctextfield {
    ripple-color: blue;
    elevation: 4;
    stroke-color: blue;             // the border color when active
    stroke-inactive-color: green;   // the border color when inactive
    floating-color: blue;           // the floating placeholder color when active
    floating-inactive-color: green; // the floating placeholder color when inactive
}

NativeScript + Angular

import { NativeScriptMaterialTextFieldModule } from "nativescript-material-textfield/angular";

@NgModule({
    imports: [
        NativeScriptMaterialTextFieldModule,
        ...
    ],
    ...
})
<MDTextField  helper="example helper" placeholderColor="green" keyboardType="datetime"
        hint="i am an hint" returnKeyType="next" (focus)="onFocus($event)" (blur)="onBlur($event)"
        (textChange)="onTextChange($event)"></MDTextField>

NativeScript + Vue

import TextFieldPlugin from 'nativescript-material-textfield/vue';

Vue.use(TextFieldPlugin);
<MDTextField helper="example helper" placeholderColor="green" keyboardType="datetime"
        hint="i am an hint" returnKeyType="next" @focus="onFocus" @blur="onBlur"
        @textChange="onTextChange"/>

Also, you can bind the text to some instance data using the v-model directive:

<MDTextField v-model="value" />

Attributes

Inherite from Nativescript TextField so it already has all the same attributes

Attributes

  • variant optional

An attribute to set the variant of the textfield. Can be outline or underline or filled. No value means underline textfield

  • errorColor optional

An attribute to set the error color of the textfield.

  • helper optional

An attribute to set the helper text of the textfield.

  • floating optional

A boolean attribute to set the floating state of the textfield.

3.3.2

3 years ago

3.3.1

4 years ago

3.2.21

4 years ago

3.3.0

4 years ago

3.2.19

4 years ago

3.2.18

4 years ago

3.2.10

4 years ago

3.2.9

4 years ago

3.2.8

4 years ago

3.2.6

4 years ago

3.2.5

4 years ago

3.2.4

4 years ago

3.2.3

4 years ago

3.2.2

4 years ago

3.2.1

4 years ago

3.1.18

4 years ago

3.1.17

4 years ago

3.1.16

4 years ago

3.1.15

4 years ago

3.1.14

4 years ago

3.1.12

4 years ago

3.1.11

4 years ago

3.1.10

4 years ago

3.1.9

4 years ago

3.1.8

4 years ago

3.1.7

4 years ago

3.1.6

4 years ago

3.1.5

4 years ago

3.1.4

4 years ago

3.1.3

4 years ago

3.1.2

4 years ago

3.1.1

4 years ago

3.0.9

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.5.4

5 years ago

2.5.3

5 years ago

2.5.2

5 years ago

2.5.1

5 years ago

2.5.0

5 years ago

2.4.2

5 years ago

2.4.1

5 years ago

2.3.24

5 years ago

2.3.23

5 years ago

2.3.22

5 years ago

2.3.21

5 years ago

2.3.20

5 years ago

2.3.19

5 years ago

2.3.18

5 years ago

2.3.17

5 years ago

2.3.16

5 years ago

2.3.15

5 years ago

2.3.14

5 years ago

2.3.13

5 years ago

2.3.12

5 years ago

2.3.11

5 years ago

2.3.10

5 years ago

2.3.9

5 years ago

2.3.8

5 years ago

2.3.7

5 years ago

2.3.6

5 years ago

2.3.4

5 years ago

2.3.3

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.17

5 years ago

2.2.16

5 years ago

2.2.15

5 years ago

2.2.14

5 years ago

2.2.13

5 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.6

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.2.0-alpha.1

5 years ago

2.2.0-alpha.0

5 years ago

2.1.8

5 years ago

2.1.7

5 years ago

2.1.6

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.4

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago