DocsAPI referenceHeadlesspart-scope

part-scope headless API

The core connector and vanilla mount are always visible. Use the framework choice to inspect native composition, props, outputs, context and hooks for the selected adapter.

@grassroot/ui-headless-core/part-scope

Core connector and vanilla API

4 exports
View source packages/ui-headless/core/src/part-scope.ts

Registers a target part and keeps its conditional IDREF attributes synced when related parts mount or unmount. The ref owns the subscription lifetime, so no listener survives the target's null cleanup.

DeclarationView source
createPartRelationshipRefts
declare function createPartRelationshipRef(scope: PartScope, part: string, relationships: readonly PartScopeRelationship[]): (node: Element | null) => void;
Name
Kind
Type
Requirement
scope
parameter
PartScope
required
part
parameter
string
required
relationships
parameter
readonly PartScopeRelationship[]
required
return
return value
(node: Element | null) => void
n/a
Name
scope
Kind
parameter
Type
PartScope
Requirement
required
Name
part
Kind
parameter
Type
string
Requirement
required
Name
relationships
Kind
parameter
Type
readonly PartScopeRelationship[]
Requirement
required
Name
return
Kind
return value
Type
(node: Element | null) => void
Requirement
n/a

createPartScope

function
DeclarationView source
createPartScopets
declare function createPartScope(options: {
seed: string;
root?: () => Document | ShadowRoot | HTMLElement | null;
}): PartScope;
Name
Kind
Type
Requirement
options
parameter
{ seed: string; root?: () => Document | ShadowRoot | HTMLElement | null; }
required
return
return value
PartScope
n/a
Name
options
Kind
parameter
Type
{ seed: string; root?: () => Document | ShadowRoot | HTMLElement | null; }
Requirement
required
Name
return
Kind
return value
Type
PartScope
Requirement
n/a

createScopeSeed

function
DeclarationView source
createScopeSeedts
declare function createScopeSeed(counterRef?: {
current: number;
}): string;
Name
Kind
Type
Requirement
counterRef
parameter
{ current: number; }
optional
return
return value
string
n/a
Name
counterRef
Kind
parameter
Type
{ current: number; }
Requirement
optional
Name
return
Kind
return value
Type
string
Requirement
n/a
DeclarationView source
PartScopeRelationshipts
interface PartScopeRelationship {
readonly attribute: string;
readonly part: string;
}
Name
Kind
Type
Requirement
attribute
property
string
required
part
property
string
required
Name
attribute
Kind
property
Type
string
Requirement
required
Name
part
Kind
property
Type
string
Requirement
required

Framework adapters

Each panel keeps its adapter's public vocabulary. React compound exports, Vue composables, standalone Angular declarations, Svelte components, and Solid hooks stay native to their framework.

This entry is core-only. No framework adapter package ships for part-scope yet — mount it through the vanilla API above.