creates a label for keypath with the text content with an optionalattributes` object
keypath
content with an optional