Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
76d9294
refactor(input): extract inner element render into virtual hook
desmondinho May 10, 2026
010dea0
feat(textarea): add LumexTextarea component
desmondinho May 10, 2026
a7df08f
test(textarea): cover rendering, parameters, and debounce behavior
desmondinho May 10, 2026
105ba4b
docs(textarea): add page, examples, and navigation entries
desmondinho May 10, 2026
726bb71
fix(textarea): bind value via attribute instead of element content
desmondinho May 11, 2026
d49cb54
refactor(textarea): render own DOM matching HeroUI layout
desmondinho May 11, 2026
e089f31
refactor(input): drop unused RenderInputElement hook
desmondinho May 11, 2026
26e0de3
style(textarea): add missing label-placement compound rules
desmondinho May 11, 2026
13287cf
style(textarea): gate outside-label absolute positioning on non-multi…
desmondinho May 11, 2026
ba098fc
style(textarea): suppress floating-label scale and translate for insi…
desmondinho May 11, 2026
6471408
style(textarea): restore floating-label scale on inside label
desmondinho May 11, 2026
f4b7dfe
docs(textarea): drop mt-2 hack from start/end content icons
desmondinho May 14, 2026
3b17a13
style(textarea): hide scrollbar on the textarea
desmondinho May 14, 2026
9d5f71b
style(textarea): apply size-based label text-size for both placements
desmondinho May 14, 2026
273188b
style(input): restore shrink-0 on label baseline
desmondinho May 14, 2026
eb62ce7
feat(textarea): expose data-autosize-disabled to allow manual resize
desmondinho May 14, 2026
d479a50
style(textarea): always apply resize-none on the textarea
desmondinho May 14, 2026
8c8ec3a
docs(textarea): tighten Autosize and StartEndContent example layouts
desmondinho May 14, 2026
406581c
chore(*): coderabbit suggestions
desmondinho May 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class NavigationStore
.Add( new( nameof( LumexSpinner ) ) )
.Add( new( nameof( LumexSwitch ) ) )
.Add( new( nameof( LumexTabs ) ) )
.Add( new( nameof( LumexTextarea ), PageStatus.New ) )
.Add( new( nameof( LumexTextbox ) ) )
.Add( new( nameof( LumexToastProvider ) ) )
.Add( new( nameof( LumexTooltip ) ) )
Expand Down Expand Up @@ -116,6 +117,7 @@ public class NavigationStore
.Add( new( nameof( LumexSwitch ) ) )
.Add( new( nameof( LumexTab ) ) )
.Add( new( nameof( LumexTabs ) ) )
.Add( new( nameof( LumexTextarea ) ) )
.Add( new( nameof( LumexTextbox ) ) )
.Add( new( nameof( LumexToastProvider ) ) )
.Add( new( nameof( LumexThemeProvider ) ) )
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="w-full flex flex-col gap-6">
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea Label="Default (3-8 rows)"
Placeholder="Type until the textarea grows..." />

<LumexTextarea Label="Custom range"
MinRows="2"
MaxRows="6"
Placeholder="Grows between 2 and 6 rows..." />

<LumexTextarea Label="Autosize disabled"
DisableAutosize="@true"
MinRows="4"
Placeholder="Locked at 4 rows; never grows." />
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<div class="w-full">
<LumexTextarea Clearable="@true"
Label="Bio"
Placeholder="Tell us about yourself..."
Value="@_value"
Variant="@InputVariant.Outlined"
OnCleared="@Notify"
Class="max-w-xs" />
</div>
<p class="text-sm text-default-500">@_text</p>

@code {
private string? _text;
private string? _value = "Loves Blazor and ships UIs in record time.";

private void Notify()
{
_value = null;

if( string.IsNullOrEmpty( _text ) )
{
_text = "Input is cleared!";
}
else
{
_text += " ..and again..";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<div class="w-full grid grid-cols-1 gap-4 md:grid-cols-2">
@foreach( var color in _colors )
{
<div>
<LumexTextarea Color="@color"
Label="Bio"
Placeholder="Tell us about yourself..."
Value="Loves Blazor and ships UIs in record time." />
<small class="text-default-400 mt-1">@color</small>
</div>
}
</div>

@code {
private ThemeColor[] _colors = [
ThemeColor.Default,
ThemeColor.Primary,
ThemeColor.Secondary,
ThemeColor.Success,
ThemeColor.Warning,
ThemeColor.Danger,
ThemeColor.Info
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@using LumexUI.Shared.Icons

<LumexTextarea Label="Note"
Placeholder="Type a note..."
Radius="@Radius.Large"
Clearable="@true"
Classes="@_classes">
<StartContent>
<SearchIcon Size="18" class="text-secondary-400 shrink-0" />
</StartContent>
</LumexTextarea>

@code {
private InputFieldSlots _classes = new()
{
Label = "text-default-700",
InnerWrapper = "bg-transparent",
InputWrapper = ElementClass.Empty()
.Add( "shadow-xl" )
.Add( "bg-default-200/50" )
.Add( "backdrop-blur-xl" )
.Add( "backdrop-saturate-200" )
.Add( "hover:bg-default-200/70" )
.Add( "group-data-[focus=true]:bg-default-200/85" )
.ToString(),
Input = ElementClass.Empty()
.Add( "bg-transparent" )
.Add( "text-default-900" )
.Add( "placeholder:text-default-500" )
.ToString()
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="w-full flex flex-col gap-2">
<LumexTextarea DebounceDelay="250"
Behavior="@InputBehavior.OnInput"
Label="Bio"
Placeholder="Tell us about yourself..."
Clearable="@true"
Class="max-w-xs"
@bind-Value="@_value" />

<p class="text-sm text-default-500">
Value: @_value
</p>
</div>

@code {
private string? _value;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<LumexTextarea Label="Bio"
Placeholder="Tell us about yourself..."
Description="A short paragraph that will appear on your public profile."
Class="max-w-xs" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<LumexTextarea Disabled="@true"
Label="Bio"
Placeholder="Tell us about yourself..."
Class="max-w-xs" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@using FluentValidation
@using FluentValidation.Results

<LumexTextarea Variant="@InputVariant.Underlined"
Label="Bio"
Required="@true"
ErrorMessage="@_userValidator.BioErrorMessage"
Invalid="@(!string.IsNullOrEmpty(_userValidator.BioErrorMessage))"
Color="@(!string.IsNullOrEmpty(_userValidator.BioErrorMessage) ? ThemeColor.Danger : ThemeColor.Success)"
Value="@_user.Bio"
ValueChanged="@OnBioChange"
Class="max-w-xs" />

@code {
private User _user = new();
private UserValidator _userValidator = new();

protected override void OnInitialized()
{
_user.Bio = "Hi";
Validate();
}

private void OnBioChange( string value )
{
_user.Bio = value;
Validate();
Comment thread
desmondinho marked this conversation as resolved.
}

private void Validate()
{
var result = _userValidator.Validate( _user );
if( !result.IsValid )
{
_userValidator.BioErrorMessage = result.Errors
.Where( failure => failure.PropertyName == nameof( User.Bio ) )
.Select( failure => failure.ErrorMessage )
.FirstOrDefault();
}
else
{
_userValidator.BioErrorMessage = null;
}
}

public class User
{
public string? Bio { get; set; }
}

public class UserValidator : AbstractValidator<User>
{
public string? BioErrorMessage { get; set; }

public UserValidator()
{
RuleFor( user => user.Bio )
.NotEmpty().WithMessage( "Bio is required" )
.MinimumLength( 10 ).WithMessage( "Please write at least 10 characters" );
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<div class="w-full grid grid-cols-1 gap-4">
@foreach( var placement in _labelPlacements )
{
<div>
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea LabelPlacement="@placement" Label="Bio" />
<LumexTextarea LabelPlacement="@placement" Label="Bio" Placeholder="Tell us about yourself..." />
</div>
<small class="text-default-400 mt-1">@placement</small>
</div>
}
</div>

@code {
private LabelPlacement[] _labelPlacements = [
LabelPlacement.Inside,
LabelPlacement.Outside
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<LumexTextarea ReadOnly="@true"
Label="Bio"
Value="Loves Blazor and ships UIs in record time."
Class="max-w-xs" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<LumexTextarea Required="@true"
Label="Bio"
Placeholder="Tell us about yourself..."
Class="max-w-xs" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="w-full grid grid-cols-1 gap-4">
@foreach( var size in _sizes )
{
<div>
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea Size="@size" Label="Bio" />
<LumexTextarea Size="@size" Label="Bio" Placeholder="Tell us about yourself..." />
</div>
<small class="text-default-400 mt-1">@size</small>
</div>
}
</div>

@code {
private Size[] _sizes = [
Size.Small,
Size.Medium,
Size.Large
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@using LumexUI.Shared.Icons

<div class="w-full grid gap-4">
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea Label="Note"
Placeholder="Type a note..."
LabelPlacement="@LabelPlacement.Outside"
StartContent="@_pencilIcon" />

<LumexTextarea Label="Search"
Placeholder="Type to search..."
LabelPlacement="@LabelPlacement.Outside"
StartContent="@_searchIcon" />
</div>

<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea Label="Note"
Placeholder="Type a note..."
LabelPlacement="@LabelPlacement.Outside"
EndContent="@_pencilIcon" />

<LumexTextarea Label="Search"
Placeholder="Type to search..."
LabelPlacement="@LabelPlacement.Outside"
EndContent="@_searchIcon" />
</div>
</div>

@code {
private RenderFragment _searchIcon = @<SearchIcon Size="20" class="text-default-400 shrink-0" />;
private RenderFragment _pencilIcon = @<MailIcon Size="20" class="text-default-400 shrink-0" />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<div class="w-full flex flex-col gap-2">
<LumexTextarea Label="Bio"
Placeholder="Tell us about yourself..."
Clearable="@true"
@bind-Value="@_valueOne" />
<p class="text-sm text-default-500">
Value: @_valueOne
</p>
</div>

<div class="w-full flex flex-col gap-2">
<LumexTextarea Label="Bio"
Placeholder="Tell us about yourself..."
Clearable="@true"
Value="@_valueTwo"
ValueChanged="@OnValueChanged" />
<p class="text-sm text-default-500">
Value: @_valueTwo
</p>
</div>
</div>

@code {
private string? _valueOne;
private string? _valueTwo = "Loves Blazor.";

private void OnValueChanged( string value )
{
_valueTwo = value;
}
Comment thread
desmondinho marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea Label="Bio" />
<LumexTextarea Label="Bio" Placeholder="Tell us about yourself..." />
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div class="w-full grid grid-cols-1 gap-4">
@foreach( var variant in _variants )
{
<div>
<div class="w-full flex flex-wrap gap-4 md:flex-nowrap">
<LumexTextarea Variant="@variant" Label="Bio" />
<LumexTextarea Variant="@variant" Label="Bio" Placeholder="Tell us about yourself..." />
</div>
<small class="text-default-400 mt-1">@variant</small>
</div>
}
</div>

@code {
private InputVariant[] _variants = [
InputVariant.Flat,
InputVariant.Outlined,
InputVariant.Underlined
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="w-full grid grid-cols-1 gap-4 md:grid-cols-2">
@foreach( var radius in _radiuses )
{
<div>
<LumexTextarea Radius="@radius" Label="Radius" Placeholder="@radius.ToString()" />
<small class="text-default-400 mt-1">@radius</small>
</div>
}
</div>

@code {
private Radius[] _radiuses = [
Radius.None,
Radius.Small,
Radius.Medium,
Radius.Large
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@rendermode InteractiveWebAssembly

<PreviewCode Code="@new(name: null, snippet: "Textarea.Code.Autosize")">
<LumexUI.Docs.Client.Pages.Components.Textarea.Examples.Autosize />
</PreviewCode>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@rendermode InteractiveWebAssembly

<PreviewCode Code="@new(name: null, snippet: "Textarea.Code.ClearButton")">
<LumexUI.Docs.Client.Pages.Components.Textarea.Examples.ClearButton />
</PreviewCode>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@rendermode InteractiveWebAssembly

<PreviewCode Code="@new(name: null, snippet: "Textarea.Code.Colors")">
<LumexUI.Docs.Client.Pages.Components.Textarea.Examples.Colors />
</PreviewCode>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@rendermode InteractiveWebAssembly

<PreviewCode Code="@new(name: null, snippet: "Textarea.Code.CustomStyles")">
<LumexUI.Docs.Client.Pages.Components.Textarea.Examples.CustomStyles />
</PreviewCode>
Loading
Loading