codeAPI Reference

s&box Inspector Attributes: Complete Reference for Component Properties

calendar_today May 4, 2026 schedule ~1 min read person patrickjr verified 50

s&box Inspector Attributes: Complete Reference for Component Properties

These attributes control how properties appear in the s&box editor inspector.

Display Attributes

CSHARP
[Property]                          // Show in inspector
[Property, Title("My Speed")]       // Custom display name
[Property, Group("Movement")]       // Group in a collapsible section
[Property, Group("Movement", StartFolded = true)] // Start collapsed
[Property, Category("Physics")]     // Category grouping
[Property, ReadOnly]                // Show but don't allow editing
[Property, Hide]                    // Don't show in inspector
[Property, Advanced]                // Hidden unless "Show Advanced" is on
[Property, Header("Section Title")] // Add a header above
[Property, Space(22)]               // Add vertical space above
[Property, Order(10)]               // Control sort order
[Property, Icon("directions_walk")] // Icon next to property
[Property, Description("...")]      // Tooltip description
[Property, HelpUrl("https://...")]  // Link to documentation
[Property, InfoBox("Warning!", "warning", EditorTint.Yellow)] // Info box above

Value Constraints

CSHARP
[Property, Range(0, 100)]           // Slider with min/max
[Property, Range(0f, 1f)]           // Float slider
[Property, MinMax(0, 100)]          // Min/max without slider

Conditional Visibility

CSHARP
// Show only when IsTrigger is true
[Property, ShowIf(nameof(IsTrigger), true)]
public float TriggerRadius { get; set; }

// Hide when IsStatic is true
[Property, HideIf(nameof(IsStatic), true)]
public float Mass { get; set; }

Feature Groups (Toggle Groups)

CSHARP
// Toggle group — boolean enables/disables the group
[Property, FeatureEnabled("Input", Icon = "gamepad", Description = "Enable input controls")]
public bool UseInputControls { get; set; } = true;

// Properties in the feature group
[Property, Feature("Input")]
public float WalkSpeed { get; set; } = 110f;

// Toggle group with explicit label
[Property, ToggleGroup("EnablePressing", Label = "Enable Pressing")]
public bool EnablePressing { get; set; } = true;

[Property, Group("EnablePressing")]
public string UseButton { get; set; } = "use";

Special Editors

CSHARP
[Property, InputAction]             // Input action selector
[Property, TextArea]                // Multi-line text box
[Property, InlineEditor]            // Inline editing (no popup)
[Property, InlineEditor(Label = false)] // Inline without label
[Property, WideMode]                // Full-width editor
[Property, ColorUsage(HasAlpha = true, IsHDR = false)]
[Property, FontName]                // Font name selector
[Property, IconName]                // Material icon selector

Component Attributes

CSHARP
[RequireComponent]                  // Auto-create if missing
[Button("Reset", "refresh")]        // Show a button in inspector
[Alias("OldName")]                  // Backward-compatible name
[Spawnable]                         // Appears in spawn menu
[EditorModel("models/box.vmdl")]    // Editor preview model

Update Subscriber Interfaces

These are automatically added by code generation when you implement the methods:

Was this helpful?