- Accordion
- Advanced Toast
- AlertMessage
- ArrowButton
- Arrows
- Avatar
- Backdrop
- Basic Toast
- Breadcrumb
- Button
- CardBackground
- Card
- Carousel
- Chapters
- ChatBody
- ChatButton
- ChatHeader
- ChatInput
- ChatMessageActions
- ChatMessageEditor
- ChatMessage
- ChatTypingIndicator
- ChatWindowCsatPrompt
- ChatWindowQuote
- ChatWindow
- CheckboxSelect
- Checkbox
- Checkboxes
- Chip
- ChoiceExpander
- Clickable
- ContentReview
- Countdown
- CriteriaDates
- CriteriaParticipants
- CriteriaTransports
- Date Field
- Datepicker
- Dropdown
- ElasticHeight
- ExpandableCard
- ExpandableText
- Filter
- FloatingLabelTextField
- Form Control
- Form Label
- Frame
- HamburgerIcon
- Heading
- Image
- JourneyCard
- LayerHeader
- Layer
- Link
- Loader
- Number Field
- PageNavigation
- Pagination
- Paragraph
- Password
- Phone Field
- Popin
- Portal
- ProductThumbnail
- Promises
- Prose
- Radio Group
- RadioSelect
- Radio
- Range
- Scrollbar
- Select
- SidebarLayout
- SliderFrame
- SparkleWrapper
- Spinner
- Switch
- Table
- Tabs
- Tag
- TextField
- Toggle
- Tooltip
- ValidationMessage
ValidationMessage
A validation feedback component that displays status indicators with icons and colored text for form field validation
'use client';
import { ValidationMessage } from '@/ui/forms/password/ValidationMessage';
export function ValidationMessageDemo() {
return (
<div className="flex flex-col gap-16">
<ValidationMessage label="At least 8 characters" status="success" />
<ValidationMessage label="Include a number" status="error" />
<ValidationMessage label="Include a special character" status="default" />
</div>
);
}
Installation
npx shadcn@latest add https://develop.trident-ui.pro.clubmed/r/validation-message.json
Usage
import { ValidationMessage } from '@/docs/lib/ui/forms/password/validation-message';
export function Component() {
return (
<div className="flex flex-col gap-16">
<ValidationMessage label="Password must be at least 8 characters" status="success" />
<ValidationMessage label="Password must include a number" status="error" />
<ValidationMessage label="Password must include a special character" status="default" />
</div>
);
}API Reference
ValidationMessage
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | (required) | The validation message text to display |
status | "default" | "error" | "success" | (required) | The validation status that determines the icon and text color |
Notes
-
Validation Status Icons: Each status displays a different icon:
default: Edit icon in middle grey colorerror: Error icon in red colorsuccess: CheckDefault icon in green color
-
Color Coordination: Text and icon colors match the validation status for clear visual feedback
-
Fixed Layout: Component uses flexbox layout with 6px gap between icon and text, and 20px horizontal padding
-
Icon Sizing: All icons are rendered at 30px width for consistency
-
Text Styling: Text uses
text-b3class for consistent typography across validation messages -
Primary Use Case: Designed for password field validation feedback, but can be used with any form field requiring inline validation messages
-
Accessibility: Uses semantic HTML and color-coded icons to communicate validation state to all users
-
Compact Design: Optimized for displaying multiple validation rules in a vertical stack without taking excessive space