I\'m working on an app that uses triangles that overlay other containers/divs. Had that solved with CS
render() {
return (
);
}
And styles
const styles = {
triangle: {
width: 0,
height: 0,
backgroundColor: 'transparent',
borderStyle: 'solid',
},
arrowUp: {
borderTopWidth: 0,
borderRightWidth: 30,
borderBottomWidth: 30,
borderLeftWidth: 30,
borderTopColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: "tomato",
borderLeftColor: 'transparent',
},
arrowRight: {
borderTopWidth: 30,
borderRightWidth: 0,
borderBottomWidth: 30,
borderLeftWidth: "tomato",
borderTopColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: "tomato",
},
arrowDown: {
borderTopWidth: 30,
borderRightWidth: 30,
borderBottomWidth: 0,
borderLeftWidth: 30,
borderTopColor: "tomato",
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
},
arrowLeft: {
borderTopWidth: 30,
borderRightWidth: "tomato",
borderBottomWidth: 30,
borderLeftWidth: 0,
borderTopColor: 'transparent',
borderRightColor: "tomato",
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
},
arrowUpLeft: {
borderTopWidth: 30,
borderRightWidth: "tomato",
borderBottomWidth: 0,
borderLeftWidth: 0,
borderTopColor: "tomato",
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
},
arrowUpRight: {
borderTopWidth: 0,
borderRightWidth: "tomato",
borderBottomWidth: 30,
borderLeftWidth: 0,
borderTopColor: 'transparent',
borderRightColor: "tomato",
borderBottomColor: 'transparent',
borderLeftColor: 'transparent',
},
arrowDownLeft: {
borderTopWidth: 30,
borderRightWidth: 0,
borderBottomWidth: 0,
borderLeftWidth: "tomato",
borderTopColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: 'transparent',
borderLeftColor: "tomato",
},
arrowDownRight: {
borderTopWidth: 0,
borderRightWidth: 0,
borderBottomWidth: 30,
borderLeftWidth: "tomato",
borderTopColor: 'transparent',
borderRightColor: 'transparent',
borderBottomColor: "tomato",
borderLeftColor: 'transparent',
},
}
Source : https://github.com/Jpoliachik/react-native-triangle