# Palm

> A coconut palm: leaning bowed trunk and a full crown of feathery fronds, young ones standing up and old ones arching down, deterministic from seed.

## Add it

```bash
npx @runek/cli add palm
```

Pulls `@react-three/rapier@^2.2.0`, `@runek/core@^0.15.0`, `three@^0.184.0`.

## Use it

```tsx
import { Palm } from './runek/Palm'

<Palm position={[0, 0, 0]} seed={1} />
```

Or as a node in a world file ([worlds as data](https://runek.nullorder.org/docs/worlds-as-data.md)):

```json
{ "type": "Palm", "props": { "position": [0, 0, 0], "seed": 1 } }
```

## Props

| Prop | Type | Default | Description |
|---|---|---|---|
| `height` | `number` | `6` | Trunk height, in units. |
| `lean` | `number` | `0.18` | Sideways lean of the crown, as a fraction of height. |
| `fronds` | `number` | `16` | Frond count. |
| `frondLength` | `number` | `2.8` | Frond length, in units. |
| `trunkColor` | `color` | palette `bark` | Defaults to the world palette's `bark` slot. |
| `frondColor` | `color` | palette `foliage` | Defaults to the world palette's `foliage` slot. |
| `coconuts` | `boolean` | `true` | Grow a coconut cluster under the crown. |
| `position` | `[x, y, z]` | `[0, 0, 0]` | Position [x, y, z] in units (1 unit = 1 m, Y-up). |
| `rotation` | `[x, y, z]` | `[0, 0, 0]` | Euler rotation [x, y, z] in radians. |
| `seed` | `number` | `1` | Seed for the deterministic variation: same seed, same result. |

## Registry manifest

[https://runek.nullorder.org/r/components/palm.json](https://runek.nullorder.org/r/components/palm.json): Self-contained JSON: inlined source plus resolved dependencies, exactly what `runek add palm` fetches.

Browse the whole catalog in the **[gallery →](https://runek.nullorder.org/gallery)**.
