Currently, I am attempting to replicate the material-ui outlined input. The background color and input styles are different, so simply setting the label position to absolute and pushing it up is not working for me. Any suggestions on how to achieve this?
Here is my current CSS implementation: https://i.sstatic.net/fABFa.png
Material Design Example: https://i.sstatic.net/pUqQY.png
inputStyle: {
padding: 10,
borderBottomWidth: 0,
},
labelStyle: {
color: colors.black,
marginBottom: 5,
top: props.isFocused ? -6 : 12,
opacity: props.isFocused ? 1 : 0.8,
left: 6,
zIndex: 100,
position: 'absolute',
display: 'inline-block',
fontSize: props.isFocused ? 12 : 16,
fontWeight: 400,
backgroundColor: colors.white,
},
inputContainerStyle: {
width: '100%',
borderColor: handleInputBorder(props.error),
borderRadius: 5,
borderWidth: 1,
backgroundColor: colors.white,
marginBottom: 10,
},
containerStyle: {
paddingLeft: 0,
paddingRight: 0,
},
rightIcon: props.rightIcon,