Svelte LayerChart patterns. Use for chart components with tooltip snippets, Chart context access, and all Svelte 5 snippet patterns for tooltips, gradients, highlights, and axes.
Scanned 9/7/2026
Install to Claude Code
npx -y skills add spences10/svelte-skills-kit --skill svelte-layerchart --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Svelte Layerchart?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/spences10-svelte-layerchart)More formats (shields.io, HTML) on the badges page.
---
name: svelte-layerchart
# prettier-ignore
description: "Svelte LayerChart patterns. Use for chart components with tooltip snippets, Chart context access, and all Svelte 5 snippet patterns for tooltips, gradients, highlights, and axes."
---
# Svelte LayerChart
Docs: **layerchart.com**
## Install
```bash
npm i layerchart d3-scale
```
## Quick Start
```svelte
<Chart {data} x="date" y="value" tooltip={{ mode: 'bisect-x' }}>
<Svg><Area class="fill-primary/20" /><Highlight points /></Svg>
<Tooltip.Root>{#snippet children({ data })}{data.value}{/snippet}</Tooltip.Root>
</Chart>
```
## Core Patterns
- **Tooltip**: `{#snippet children({ data })}` - NOT `let:data`
- **Chart context**: `{#snippet children({ context })}`
- **Gradient**: `{#snippet children({ gradient })}`
- **Enable tooltip**: `tooltip={{ mode: 'band' | 'bisect-x' }}`
- **Type data**: `{#snippet children({ data }: { data: MyType })}`
## Tooltip Modes
| Mode | Use Case |
| ------------ | ---------------------- |
| `band` | Bar charts (scaleBand) |
| `bisect-x` | Time-series area/line |
| `quadtree-x` | Area (nearest x) |
| `quadtree` | Scatter plots |
## References
- [full-patterns.md](references/full-patterns.md) - Area, Bar, Pie,
Calendar
- [tooltip-modes.md](references/tooltip-modes.md) - All modes
- [graph-patterns.md](references/graph-patterns.md) - ForceGraph,
zoom/pan
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!