In React-Native, how do I add font borders to Text-components?
I've tried using border
and shadow{Color, Radius, Opacity, Offset}
, but haven't gotten that to work. Any suggestions?
To set a border, you must first set borderWidth. borderWidth is the size of the border, and it's always a number. You can either set a borderWidth that applies to the entire component or choose which borderWidth you want to set specifically (top, right, bottom, or left).
Use the border css property to set the border style of an element in React, e.g. <div style={{border: '1px solid rgba(0,255,0,0.3)'}}> . If you only need to style a specific border, use the corresponding property, e.g. borderBottom . Copied!
In react native there are view's style property to set individual side width. You can use borderTopWidth for Top Border. borderBottomWidth for bottom border, borderLeftWidth for left border and borderRightWidth for right border. If you use single property borderWidth then it will apply to all four side of view.
The official docs have this information for you. You can find it on this site: Text Component. There it shows which props you can use to change the behaviour and style of the component. As you can see there are some specific Text styles but also the styles you can apply on a View Component. And if you follow that link it shows you the border styles. So, what you're looking for is maybe:
borderColor string borderTopColor string borderRightColor string borderBottomColor string borderLeftColor string borderRadius number borderTopLeftRadius number borderTopRightRadius number borderBottomLeftRadius number borderBottomRightRadius number borderStyle enum('solid', 'dotted', 'dashed') borderWidth number borderTopWidth number borderRightWidth number borderBottomWidth number borderLeftWidth number
you can emulator border as two attributes :
textShadowColor color textShadowOffset {width: number, height: number}
Ex:
textshadow:{ fontSize:100, color:'#FFFFFF', fontFamily:'Times New Roman', paddingLeft:30, paddingRight:30, textShadowColor:'#585858', textShadowOffset:{width: 5, height: 5}, textShadowRadius:10, },
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With