Overview
Properties make your components configurable and reusable. They define the inputs your component accepts and how they appear in the inspector panel. BindJS supports multiple property types, each with its own validation and inspector options.Property Structure
Every property definition follows this structure:String Properties
Text input properties for single or multi-line text.Basic String
String with Validation
Multi-line String
Markdown String
String Options
| Option | Type | Description |
|---|---|---|
type | "string" | Required - Property type |
title | string | Display name in inspector |
description | string | Help text shown below field |
required | boolean | Whether the field is required |
defaultValue | string | Default value |
examples | string[] | Example values |
inspector.control | "singleline" | "multiline" | Input type |
inspector.placeholder | string | Placeholder text |
inspector.markdown | boolean | Enable markdown editing |
inspector.numberOfLines | number | Lines for multiline (default: 3) |
validation.minLength | number | Minimum character length |
validation.maxLength | number | Maximum character length |
validation.pattern | string | Regex pattern to match |
validation.format | "text" | "email" | "url" | Format validation |
Number Properties
Numeric input properties with optional min/max validation.Basic Number
Number with Range
Number with Slider
Number Options
| Option | Type | Description |
|---|---|---|
type | "number" | Required - Property type |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
defaultValue | number | Default value |
inspector.control | "slider" | "input" | Input type |
inspector.step | number | Step increment |
inspector.placeholder | number | Placeholder value |
validation.min | number | Minimum value |
validation.max | number | Maximum value |
Boolean Properties
Toggle switch properties for true/false values.Basic Boolean
Boolean with Default
Boolean Options
| Option | Type | Description |
|---|---|---|
type | "boolean" | Required - Property type |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
defaultValue | boolean | Default value (true/false) |
Enum Properties
Dropdown or segmented control for selecting from predefined options.Basic Enum
Enum with Labels
Enum with Icons
Segmented Control
Enum Options
| Option | Type | Description |
|---|---|---|
type | "enum" | Required - Property type |
options | string[] | number[] | object[] | Required - Available options |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
defaultValue | string | number | Default selected value |
inspector.control | "segmented" | "dropdown" | Control type |
Array Properties
Properties that accept multiple values.String Array
Number Array
Array Options
| Option | Type | Description |
|---|---|---|
type | "array" | Required - Property type |
valueType | PropertyField | Required - Type of array items |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
defaultValue | any[] | Default array value |
validation.minItems | number | Minimum number of items |
validation.maxItems | number | Maximum number of items |
Asset Properties
Properties for uploading and selecting media assets.Image Asset
Video Asset
Multiple Asset Types
3D Model Asset
Asset Value Structure
Asset properties return values wrapped by their type:Asset Options
| Option | Type | Description |
|---|---|---|
type | "asset" | Required - Property type |
assetTypes | AssetType[] | Required - Allowed asset types |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
"image"- Image files (jpg, png, gif, etc.)"video"- Video files (mp4, mov, etc.)"audio"- Audio files (mp3, wav, etc.)"model"- 3D model files"model/usdz"- USDZ format models"model/glb"- GLB format models
Component Properties
Properties that accept other components as values.Basic Component
Component with Environment
Component with Restrictions
Component Options
| Option | Type | Description |
|---|---|---|
type | "component" | Required - Property type |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
environment | object | Environment values for component |
allowedComponents | string[] | Restrict to specific components |
Date Properties
Properties for date selection.Basic Date
Date with Range
Date Options
| Option | Type | Description |
|---|---|---|
type | "date" | Required - Property type |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
defaultValue | string | Default date (ISO format) |
inspector.placeholder | string | Placeholder text |
validation.minDate | string | Minimum date (ISO format) |
validation.maxDate | string | Maximum date (ISO format) |
Group Properties
Properties for nested object structures.Basic Group
Nested Groups
Group Options
| Option | Type | Description |
|---|---|---|
type | "group" | Required - Property type |
properties | ComponentProperties | Required - Nested properties |
title | string | Display name in inspector |
description | string | Help text |
required | boolean | Whether required |
Inspector Customization
All property types support inspector customization to control how they appear in the editor.Common Inspector Options
Best Practices
1. Use Descriptive Titles
2. Provide Validation
3. Use Appropriate Controls
4. Set Defaults in Previews
Don’t usedefaultValue in properties unless necessary. Instead, provide defaults in previews:
5. Name Asset Properties Appropriately
Complete Example
Next Steps
- Core Concepts: Learn how properties fit into components
- Quickstart: Build a component with properties
- Components: See properties in action
