component

Palm

A coconut palm: leaning bowed trunk and a crown of drooping instanced fronds, deterministic from seed.

⌖ Explore the library in 3D →

Add it

npx @runek/cli add palm

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

Use it

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

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

Props

export interface PalmProps extends WorldComponentProps {
  /** Trunk height, in units. */
  height?: number
  /** Sideways lean of the crown, as a fraction of height. */
  lean?: number
  /** Frond count. */
  fronds?: number
  /** Frond length, in units. */
  frondLength?: number
  /** Defaults to the world palette's `bark` slot. */
  trunkColor?: string
  /** Defaults to the world palette's `foliage` slot. */
  frondColor?: string
  /** Grow a coconut cluster under the crown. */
  coconuts?: boolean
}

Registry manifest

registry manifest /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 →.