@nativescript-community/ui-material-textfield
| Install | |
|---|---|
npm install @nativescript-community/ui-material-textfield |
|
| Latest Version: | 7.3.4 |
| License: | Apache-2.0 |
| Last Updated: | Oct 12, 2026 |
| Links: | GitHub · npm |
NativeScript Material Text field
Material Design's Text field component for NativeScript.
Contents
Installation
For NativeScript 7.0+
tns plugin add @nativescript-community/ui-material-textfield
For NativeScript 6.x
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.
Changelog
FAQ
Usage
Plain NativeScript
IMPORTANT: Make sure you include xmlns:mdt="@nativescript-community/ui-material-textfield" on the Page element.
XML
<Page xmlns:mdt="@nativescript-community/ui-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
mdtextfield {
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-community/ui-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-community/ui-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" />
API
Attributes
Inherite from NativeScript TextField so it already has all the same 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.
Related Packages
Material Design Tabs organize content across different screens, data sets, and o...
The Material Design Ripple component provides a radial action in the form of a v...
Material Design Bottom Sheets slide up from the bottom of the screen to reveal m...
Material Design Activity Indicator expresses an unspecified wait time.
Material Design Dialogs inform users about a task and can contain critical infor...
Version History
| Version | Released | License |
|---|---|---|
| 7.3.4 | Apache-2.0 | |
| 7.3.3 | Apache-2.0 | |
| 7.3.2 | Apache-2.0 | |
| 7.3.1 | Apache-2.0 | |
| 7.3.0 | Apache-2.0 | |
| 7.2.80 | Apache-2.0 | |
| 7.2.79 | Apache-2.0 | |
| 7.2.78 | Apache-2.0 | |
| 7.2.77 | Apache-2.0 | |
| 7.2.71 | Apache-2.0 | |
| 7.2.70 | Apache-2.0 | |
| 7.2.69 | Apache-2.0 | |
| 7.2.68 | Apache-2.0 | |
| 7.2.67 | Apache-2.0 | |
| 7.2.66 | Apache-2.0 | |
| 7.2.65 | Apache-2.0 | |
| 7.2.64 | Apache-2.0 | |
| 7.2.63 | Apache-2.0 | |
| 7.2.62 | Apache-2.0 | |
| 7.2.61 | Apache-2.0 | |
| 7.2.60 | Apache-2.0 | |
| 7.2.59 | Apache-2.0 | |
| 7.2.58 | Apache-2.0 | |
| 7.2.57 | Apache-2.0 | |
| 7.2.56 | Apache-2.0 | |
| 7.2.55 | Apache-2.0 | |
| 7.2.54 | Apache-2.0 | |
| 7.2.53 | Apache-2.0 | |
| 7.2.50 | Apache-2.0 | |
| 7.2.49 | Apache-2.0 |
Showing the latest 30 of 263. See every release on npm
Pre-releases (4)
| Version | Released | License |
|---|---|---|
| 6.2.14-alpha.1 | Apache-2.0 | |
| 6.2.14-alpha.0 | Apache-2.0 | |
| 5.4.0-alpha.4 | Apache-2.0 | |
| 5.3.4-alpha.0 | Apache-2.0 |