UI/TextInput.razor

A UI Razor component that extends Sandbox.UI.TextEntry to provide a text input with ghost (placeholder) text. It renders a label when Text is empty, defines a Ghost property, and overrides BuildHash to combine the Text for change detection. Styles set sizing, colors, and ghost label positioning.

NetworkingFile Access
@using System
@using Sandbox
@using Sandbox.UI
@namespace BrickJam.UI
@inherits TextEntry

<root>
	@if ( string.IsNullOrEmpty( Text ) )
	{
		<label class="ghost-text">@Ghost</label>
	}
</root>

@code {
	public string Ghost { get; set; }

	protected override int BuildHash() => HashCode.Combine( Text );
}

<style>
	TextInput {
		font-size: 18px;
		color: white;
		padding: 6px 12px;
		min-width: 300px;
		background-color: rgba(0,0,0,0.6);
		justify-content: center;

		label { word-break: break-all; white-space: normal; }

		.ghost-text { position: absolute; left: 12px; opacity: 0.5; }
	}
</style>