🗻
Norska
  • 🗻Welcome !
  • 🛣️Roadmap
  • 🔥Getting Started
    • Installation
    • Introduction
    • Quick Start
  • 🧊Core
    • Canvas
    • Objects
    • Properties
    • Attach
    • Three
    • Primitive
  • ✨Magic properties
    • $i
    • $three
    • $frame
    • $3
    • $math
    • $irefs
    • $load
      • $loaders
  • 🏗️Features
    • Reactivity
    • Conditional rendering
    • Loop
    • Events
  • ⚙️Advanced
    • Configuration
    • Extending Norska
    • Known issues
Powered by GitBook
On this page
  1. Core

Properties

You can modify any object property, regardless of depth, by adding $ in front of its name and separating levels with a dot.

<br x-3.meshBasicMaterial x-3.$color="'red'" />

No need to add a $ in front of each property level, just the first one. This allows Norska to differentiate between an attempted class instantiation and a property change.

Any properties associated with objects featuring a .set() method can be assigned values directly by passing the same arguments as one would for the set method. For instance, instead of specifying $color={new $three.Color('red')}, you can directly use $color="'red'" .

When set() requires several arguments, you can use an array like this $position="[1, 2, 3]".

Just using a directive with no props will return true by default.

Props with camel case key names can be accessed by splitting the words with - since HTML attributes are not case-sensitive

<div
    x-3.mesh 
    x-3.$cast-shadow 
    x-3.$receive-shadow
>
 <!-- ... -->
</div>
PreviousObjectsNextAttach

Last updated 1 year ago

🧊