Overview
DaisyInput is a text input control with DaisyUI styling, supporting labels (top or floating), helper text, icons, and multiple visual variants.
Properties
Text
The text content of the input.
PlaceholderText
Placeholder text displayed when the input is empty.Alias:
Watermark (for compatibility)Variant
The visual variant of the input.Available variants:
Bordered- Standard bordered inputGhost- Minimal styling, no visible borderPrimary- Primary color focusSecondary- Secondary color focusAccent- Accent color focusInfo- Info color focusSuccess- Success color focusWarning- Warning color focusError- Error color focusFilled- Filled background style
Size
The size of the input. Controls height, font size, and padding.Available sizes:
ExtraSmallSmallMediumLargeExtraLarge
Label Properties
Label text displayed above or inside (floating) the input.
Position of the label.Options:
Top- Label above inputFloating- Animated label that floats up on focus/input
Shows a red asterisk (*) next to the label.
Shows “Optional” text next to the label.
Helper Text
Hint text displayed below the label and above the input.
Helper text displayed below the input (typically for character count or validation messages).
Icon Properties
Icon displayed at the start (left) of the input. Accepts
Geometry or string path data.Path data string for the start icon. Takes precedence over
StartIcon.Icon displayed at the end (right) of the input. Accepts
Geometry or string path data.Path data string for the end icon. Takes precedence over
EndIcon.TextBox Properties
Maximum number of characters allowed. 0 means unlimited.
Whether the input accepts the Return key for multiline input.
Text wrapping mode.
When true, the text cannot be edited but can still be selected and copied.
Focus and Selection
Gets or sets the starting position of text selection.
Gets or sets the length of text selection.
Customization
Custom brush for the focus border color. Overrides variant-based focus color.
Events
TextChanged
Occurs when the text content changes.
TextChanging
Occurs when the text is about to change. Allows for text validation/filtering.
Methods
FocusInnerTextBox()
Focuses the inner TextBox and optionally selects all text.FocusInput(bool selectAll = false)
Usage Examples
XAML - Basic Input
XAML - Variants
XAML - Sizes
XAML - Floating Label
XAML - With Icons
XAML - Helper Text
XAML - Multiline Input
XAML - Semantic Colors
C# - Dynamic Configuration
C# - Focus and Selection
C# - Text Validation
Notes
- Floating Label Animation: The floating label smoothly animates up when the input gains focus or contains text
- Icon Sizing: Icons automatically scale based on the input’s
Sizeproperty - Focus Ring: Focus border color is determined by
Variantor can be customized withBorderRingBrush - Platform Differences: Floating label behavior is optimized for both Windows and Skia/WASM platforms
- Clear Button: The built-in clear button (X) automatically inherits theme colors

