Error state for side modals #3780
-
Hi! I'm looking for some guidance on how to handle errors within side modals. This is how I currently have it designed if a user attempts to save information in the side modal and something goes wrong and is unable to save: Do we have any guidelines on this? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
🤖 Hey there @elangager3! 🎉 I'm Dosu, a friendly bot here to lend a hand with bug squashing, fielding questions, and guiding you on your journey to becoming a contributor. While we wait for one of the human maintainers to chime in, I'm here to assist you. I noticed you're having some trouble with error states in side modals, so let me dive into that and I'll get back to you with some insights shortly! |
Beta Was this translation helpful? Give feedback.
-
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. If there are errors when a user attempts to save information in a Side Modal, you should follow these guidelines:
Here is an example of how you might implement the Help Text for an error state: <HelpText variant="error">
There was an issue saving your information. Please check the fields and try again.
</HelpText> And here is how you might use a Toast to indicate a system error after closing the modal: <Toast variant="error" onDismiss={() => {}}>
There was an error saving your information.
</Toast> Remember to ensure that the error messages are informative and guide the user on how to resolve the issue. For additional guidance on how to compose error messages, refer to the error state pattern. I also did a search, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:
|
Beta Was this translation helpful? Give feedback.
-
🤖 Sure, I can provide some guidance on how to handle errors within side modals in Paste.
<HelpText variant="error">This is an error message.</HelpText>
<FormActions>
<Button variant="primary" type="submit">Submit</Button>
<Button variant="secondary" type="reset">Reset</Button>
</FormActions>
<Label htmlFor={uidSeed('name')} required>Name</Label>
<Input id={uidSeed('name')} type="text" required />
<HelpText variant="error">Please enter your name.</HelpText>
<Toast variant="error" onDismiss={() => {}}>
There was a system error.
</Toast> Remember to import the necessary components from Paste: import {Form, FormActions, FormControl, HelpText, Label, Input, Button, Toast} from '@twilio-paste/core'; For the
The For more information, you can refer to the Form component documentation and the HelpText component source code. Sources
|
Beta Was this translation helpful? Give feedback.
-
Hey @elangager3 - from the screenshot your design looks alright to me! Are there any specific questions you have about error messages within Side Modals? If you haven't already, be sure to take a look at our error state guidance. |
Beta Was this translation helpful? Give feedback.
Hey @elangager3 - from the screenshot your design looks alright to me! Are there any specific questions you have about error messages within Side Modals? If you haven't already, be sure to take a look at our error state guidance.