menu_bookDocumentation

Property Attributes: Inspector Customization for Components and Assets

calendar_today May 20, 2026 schedule ~2 min read person PatrickJr verified 50

Property attributes control how Component properties appear in the s&box editor/inspector. They work on both Components and GameResource properties.

Layout and Visibility

AttributeEffect
[Hide]Hidden from editor but still saves/loads
[ReadOnly]Visible but not editable
[Advanced]Hidden unless user opts to see advanced properties
[Space]Adds space above the property
[Header( "My Header" )]Adds a header above
[Order( 100 )]Controls display order
[Title( "Custom Name" )]Overrides the property name in editor
[InlineEditor]Shows inline editing instead of popup
[WideMode]Full-width widget with label above
[KeyProperty]Represents the whole object in a single line

Grouping

AttributeEffect
[Group( "Helpers" )]Creates a group box
[ToggleGroup( "UseHelpers" )]Group with on/off checkbox (name matches a bool property)
[Feature( "Helpers" )]Separate tab in inspector
[FeatureEnabled( "Helpers" )]Bool that enables/disables a feature tab

Conditional Display

CSHARP
[ShowIf( "PropertyName", 3 )]  // Show only when PropertyName == 3
[HideIf( "PropertyName", 3 )]  // Hide when PropertyName == 3

Numeric Properties

CSHARP
[Range( 0, 100 )]  // Min/max with slider (clamped by default)
[Step( 10 )]        // Increment step when dragging

String Properties

AttributeEffect
[Placeholder( "hint text" )]Shown when empty
[TextArea]Multiline text area
[FilePath]File picker (optional extension filter)
[ImageAssetPath]Image file selector
[MapAssetPath].vmap file selector
[FontName]Font dropdown
[InputAction]Input action dropdown from Project Settings

Validation

CSHARP
[Validate( nameof( IsValid ), "Warning Message", LogLevel.Warn )]

Calls a method for validation and shows the result in the inspector.

Other

AttributeEffect
[RequireComponent]Auto-creates the component if missing
[Flags]Enum treated as flags (multi-select dropdown)
[ResourceType( "vmdl" )]Filters resource picker by type
Was this helpful?