Inline errors are brief, in-context messages that tell users something went wrong with a single or group of inputs in a form. Use inline errors to help users understand why a form input may not be valid en how to fix it.
<script lang="ts" setup>
import { InlineError } from '@returnless/focus-ui';
</script>
<template>
<InlineError
message="Store name is required"
field-id="my-field-id"
/>
</template>Inline errors should:
Since the error message is directly below the source of the problem, the copy only needs to explain why the error happened. Optionally, the message can clarify what to do next or offer a one-click fix.
Inline error messages should:
fieldId prop to give the inline error a unique id. This ties the error to a form field using aria-describedby so that it's conveyed to screen reader users.message prop to provide the text that describes the error.