Skip to content

Home > @unseenco/backstage-core > ISheet > declareOutlineNamespace

ISheet.declareOutlineNamespace() method

Declares an outline namespace folder in the Studio. The folder appears in the outline panel even before any sheet objects are added under it.

You can also use this to set the default collapsed state for a namespace folder. The default only applies when the user has not manually expanded or collapsed the folder yet.

This method is part of @unseenco/backstage so you can configure outline folders without importing @unseenco/backstage/studio.

Signature:

typescript
declareOutlineNamespace(namespacePath: string, opts?: {
        collapsed?: boolean;
    }): void;

Parameters

ParameterTypeDescription
namespacePathstringThe namespace path, e.g. "My Folder" or "My Folder / Subfolder"
opts{ collapsed?: boolean; }Optional configuration for the namespace folder

Returns:

void

Example

ts
const sheet = project.sheet('Scene')

// Create an empty folder ahead of time, collapsed by default
sheet.declareOutlineNamespace('Props', {collapsed: true})

// Later, add objects under that folder
sheet.object('Props / Chair', {x: 0})
sheet.object('Props / Table', {x: 0})