The weex builtin component ‘text’ is used to render text with specified style rule. tag can contain text value only. You can use variable interpolation in the text content with the mark {{}}.

Note: This component supports no child components.


  • value(string): text value of this component. This is equal to the content of ‘text’.

    var textComponent = this.$el("textid");
    this.text = textComponent.attr.value;


  • Support common styles for components
  • lines: specify the text lines. Default value is 0 for unlimited.
  • Support text styles
    • support ‘color’ style.
    • support ‘font-size’ style. iOS: default vlaue 32. Android: platform specify. HTML5: default value 32.
    • support ‘font-style’ style.
    • support ‘font-weight’ style.
    • support ‘text-align’ style.
    • support ‘text-decoration’ style.
    • support ‘text-overflow’ style.
    • support ‘line-height’(available from v0.6.1) style.


Support common events

Custom Typeface#


support ttf and woff font format to custom your text, call addRule in dom module to build your own font-family, we suggest that you call addRule in beforeCreate.


Edit this page on GitHub