component

Room

Composite: four walls and a floor with a doorway, arranged from one Level. Unpack to customize.

⌖ Explore the library in 3D →

Room is a composite: a data arrangement of parts, not code. add copies the arrangement JSON plus the source of every part it references.

Add it

npx @runek/cli add room

Pulls level.

Use it

Place it in a world by type — the renderer expands the arrangement in place:

{ "type": "Room", "props": { "position": [0, 0, 0], "seed": 1 } }

Register the arrangement in your registry map next to the parts it uses:

import room from './runek/composites/room.json'

const registry = { /* …parts… */, Room: room as unknown as CompositeDef }

An instance seed deterministically re-rolls every child that doesn’t pin its own. In the editor, Unpack replaces an instance with its editable arrangement (a Group of ordinary nodes) for per-instance customization.

Arrangement

{
  "kind": "composite",
  "name": "Room",
  "description": "Four walls and a floor with a front doorway — one Level with an opening. Unpack it to add a ceiling, windows, or more openings.",
  "bounds": [8, 3, 8],
  "nodes": [
    {
      "type": "Level",
      "props": {
        "size": [8, 8],
        "height": 3,
        "walls": {
          "front": { "openings": [{ "width": 1.4, "height": 2 }] }
        }
      }
    }
  ]
}

Migrate

v0.11.0 → v0.12.0. Room is no longer a coded component — the registry name now resolves to a composite: one Level with a front doorway. For JSX composition, reach for Level directly; it is the same walls-plus-floor ring with per-side openings.

v0.11.0
import { Room } from './runek/Room'

<Room size={[8, 8]} doorWidth={1.4} roof />
v0.12.0
import { Level } from './runek/Level'

<Level
  size={[8, 8]}
  walls={{ front: { openings: [{ width: 1.4, height: 2 }] } }}
/>

Registry manifest

registry manifest /r/components/room.json Self-contained JSON: the inlined arrangement plus resolved dependencies, exactly what runek add room fetches.

Browse the whole catalog in the gallery →.