
# tronche
Avatars nothing like you.
Tronche generates unique SVG avatars from a name and a color palette. Available as a [vanilla JS package](#vanilla-usage) (no framework), a [Vue component](#vue-usage), a [React component](#react-usage), a [Solid component](#solid-usage), a [Svelte component](#svelte-usage), a [Lit component](#lit-usage), an [Angular component](#angular-usage), a [Nuxt module](#nuxt-module), and a [REST API](#rest-api).
## Installation
```sh
npm install tronche
```
### Package structure
```
node_modules/tronche/
├── dist/
│ ├── index.js # Core library (ESM, framework-agnostic)
│ ├── index.d.ts # Core TypeScript declarations
│ ├── vue/
│ │ ├── index.js # Vue components (pre-compiled)
│ │ └── index.d.ts # Vue component types
│ ├── react/
│ │ ├── index.js # React components (pre-compiled)
│ │ └── index.d.ts # React component types
│ ├── solid/
│ │ ├── index.js # Solid components (pre-compiled)
│ │ └── index.d.ts # Solid component types
│ ├── svelte/
│ │ ├── index.js # Svelte components (pre-compiled)
│ │ └── index.d.ts # Svelte component types
│ ├── lit/
│ │ ├── index.js # Lit components (pre-compiled)
│ │ └── index.d.ts # Lit component types
│ ├── angular/
│ │ ├── index.js # Angular components (pre-compiled)
│ │ └── index.d.ts # Angular component types
│ ├── module.js # Nuxt module
│ └── module.d.ts # Module types
└── package.json
```
### Consumption
| Import path | Environment | Example |
|-------------|-------------|---------|
| `tronche` | Vanilla JS/TS | `import { generateBeamSvg } from 'tronche'` |
| `tronche/vue` | Vue 3 | `import { Avatar } from 'tronche/vue'` |
| `tronche/react` | React 18+ | `import { Avatar } from 'tronche/react'` |
| `tronche/solid` | SolidJS 1.8+ | `import { Avatar } from 'tronche/solid'` |
| `tronche/svelte` | Svelte 5+ | `import { Avatar } from 'tronche/svelte'` |
| `tronche/lit` | Lit 3+ | `` |
| `tronche/angular` | Angular 17+ | `import { Avatar } from 'tronche/angular'` |
| `tronche/module` | Nuxt 3+ | `modules: ['tronche/module']` |
## Vanilla Usage
Use the core generators directly in any JavaScript environment — no framework required.
```ts
import { generateBeamSvg } from 'tronche'
const svg = generateBeamSvg('Clara Barton', ['#E07A5F', '#3D405B', '#81B29A', '#F4D06F', '#D8A47F'], {
size: 120,
square: false,
})
// svg is a string: '