Skip to content

Best way to show input validation errors? #490

Answered by unix
agoldis asked this question in Q&A
Discussion options

You must be logged in to vote

I always use the Text component to manually display the error myself, a little annoying indeed. I think the Input component needs a Label or something to display some text information, similar to:

<Input>
  <Input.Label type="error">Something doesn't seem right.</Input.Label>
</Input>

<Input>
  <Input.Label type="error"><Image ... /></Input.Label>
</Input>

// custom type or not set
<Input>
  <Input.Label type="myLabel">...</Input.Label>
</Input>


// more complex combinations
<Input>
  <Input.Label type="myLabel">
    <Text h1>....</Text>
    <Text h1>....</Text>
    <Button>Try again</Button>
  </Input.Label>
</Input>

This is just a preliminary idea, if anyone would like to implement …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@unix
Comment options

unix Mar 31, 2021
Maintainer

Answer selected by ofekashery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants