Check out example codes for "nativescript hr". It will help you in understanding the concepts better.

Code Example 1

/* In Nativescript you can create a label with a small height and any background color */
.line {
    background: linear-gradient(to left, orangered, green, lightblue);
    height: 2px;
}

<label class="line"></label>

Learn ReactJs, React Native from akashmittal.com