MotionScript

@motion-script/code


@motion-script/code / CodeProps

Interface: CodeProps

Defined in: components/code/src/props.ts:4

Extends

  • NodeProps

Properties

blend

blend: "color" | "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "luminosity" | "pass-through"

Defined in: core/dist/nodes/base/node.d.ts:105

Layer blend mode. 'pass-through' (default) does not isolate the node — its opacity scales each child/fill while they blend against the backdrop. Any other mode isolates the node and blends its flattened result against the backdrop.

Inherited from

NodeProps.blend


bottomCenter

bottomCenter: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:144

Inherited from

NodeProps.bottomCenter


bottomLeft

bottomLeft: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:141

Inherited from

NodeProps.bottomLeft


bottomRight

bottomRight: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:142

Inherited from

NodeProps.bottomRight


center

center: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:138

Inherited from

NodeProps.center


centerLeft

centerLeft: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:145

Inherited from

NodeProps.centerLeft


centerRight

centerRight: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:146

Inherited from

NodeProps.centerRight


childPositioning

childPositioning: ChildPositioning

Defined in: core/dist/nodes/base/node.d.ts:118

Frame of reference this node lays its children out in. 'relative' (default) positions them inside this node's own content box; 'absolute' pins them to the stage instead, so their x/y are scene-root coordinates and this node's flow/gap/padding no longer place them. Overridden per child by relativeToParent.

Inherited from

NodeProps.childPositioning


children

children: NodeChildren

Defined in: core/dist/nodes/base/node.d.ts:130

Child nodes. A single Node, or an arbitrarily-nested array of them — the constructor flattens nesting (.flat(Infinity)), so .map() results can be dropped in directly as a child without spreading, like React.

Inherited from

NodeProps.children


clip

clip: boolean

Defined in: core/dist/nodes/base/node.d.ts:110

When true, content drawn outside this node's outline is clipped away (see Node.clipSelf).

Inherited from

NodeProps.clip


code

code: string

Defined in: components/code/src/props.ts:5


colSpan

colSpan: number

Defined in: core/dist/nodes/base/node.d.ts:161

How many grid columns this child spans. Default 1.

Inherited from

NodeProps.colSpan


column

column: number

Defined in: core/dist/nodes/base/node.d.ts:157

1-based column index for explicit grid placement. Undefined = auto-placed.

Inherited from

NodeProps.column


effects

effects: Effect

Defined in: core/dist/nodes/base/node.d.ts:106

Inherited from

NodeProps.effects


flex

flex: number

Defined in: core/dist/nodes/base/node.d.ts:155

Proportional share of the free space along the parent's main axis, relative to sibling fill children (like Flutter's Expanded(flex:)). Only meaningful when this node fills the main axis — in a row that's width:'fill', in a column height:'fill'. Two siblings with flex 2 and 1 split the free space 2:1. Defaults to 1. Specifying flex without an explicit width/height defaults both to 'fill'.

Inherited from

NodeProps.flex


fontFamily

fontFamily: string

Defined in: components/code/src/props.ts:8


fontSize

fontSize: number

Defined in: components/code/src/props.ts:7


height

height: SizeInput

Defined in: core/dist/nodes/base/node.d.ts:89

Inherited from

NodeProps.height


language

language: string

Defined in: components/code/src/props.ts:6


letterSpacing

letterSpacing: number

Defined in: components/code/src/props.ts:12


lineHeight

lineHeight: number

Defined in: components/code/src/props.ts:11


lineNumberGap

lineNumberGap: number

Defined in: components/code/src/props.ts:14


opacity

opacity: number

Defined in: core/dist/nodes/base/node.d.ts:103

Inherited from

NodeProps.opacity


padding

padding: InsetsProps

Defined in: components/code/src/props.ts:15

Inner spacing between this node's edges and its content/children.

Overrides

NodeProps.padding


pivot

pivot: Anchor

Defined in: core/dist/nodes/base/node.d.ts:137

Pivot point for rotation and scale. Either a named anchor ('center', 'topRight', 'bottomLeft', … — the node align vocabulary) or an explicit Vector2: (0,0)=center, (-1,1)=top-left, (1,-1)=bottom-right. Set automatically when an anchor positioning prop is used.

Inherited from

NodeProps.pivot


relativeToParent

relativeToParent: RelativeToParent

Defined in: core/dist/nodes/base/node.d.ts:124

This node's own override of its parent's childPositioning. 'inherit' (default) takes whatever the parent declared; 'relative' and 'absolute' opt this one node in or out regardless.

Inherited from

NodeProps.relativeToParent


rotation

rotation: number

Defined in: core/dist/nodes/base/node.d.ts:102

Inherited from

NodeProps.rotation


row

row: number

Defined in: core/dist/nodes/base/node.d.ts:159

1-based row index for explicit grid placement. Undefined = auto-placed.

Inherited from

NodeProps.row


rowSpan

rowSpan: number

Defined in: core/dist/nodes/base/node.d.ts:163

How many grid rows this child spans. Default 1.

Inherited from

NodeProps.rowSpan


scale

scale: number

Defined in: core/dist/nodes/base/node.d.ts:101

Inherited from

NodeProps.scale


seed

seed: string | number

Defined in: core/dist/nodes/base/node.d.ts:171

Origin seed for this node's Node.random source. Defaults to 0. Set it to give the node a reproducible-but-distinct random stream without re-seeding by hand. The constructor adopts it as random's origin, and the runtime rebuilds the node each playback pass, so draws stay reproducible across scrub/precomp/HMR.

Inherited from

NodeProps.seed


showLineNumbers

showLineNumbers: boolean

Defined in: components/code/src/props.ts:13


size

size: SizeInput

Defined in: core/dist/nodes/base/node.d.ts:100

Sets width and height to the same value in one go. Pure sugar: at construction time, an author-facing size is expanded into width/ height before either is applied. Explicit width or height takes precedence over size (mirroring padding's side-vs-shorthand rule), so { size: 200, width: 100 } yields width: 100, height: 200. Reactive bindings and to()/set() targets both work the same as width/heightsize: 'fill', size: () => ..., or node.to({ size: 300 }, 0.5) are all valid.

Inherited from

NodeProps.size


theme

theme: CodeTheme

Defined in: components/code/src/props.ts:10

A built-in/registered theme name (e.g. 'github-dark'), or a CodeHighlightStyle object.


topCenter

topCenter: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:143

Inherited from

NodeProps.topCenter


topLeft

topLeft: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:139

Inherited from

NodeProps.topLeft


topRight

topRight: Vector2 | (() => Vector2)

Defined in: core/dist/nodes/base/node.d.ts:140

Inherited from

NodeProps.topRight


width

width: SizeInput

Defined in: core/dist/nodes/base/node.d.ts:88

Inherited from

NodeProps.width


x

x: number

Defined in: core/dist/nodes/base/node.d.ts:86

Inherited from

NodeProps.x


y

y: number

Defined in: core/dist/nodes/base/node.d.ts:87

Inherited from

NodeProps.y