Deps
A dependency tree drawn with ASCII branch lines, cascading package by package and showing each name with its version tag.
Install
pnpm add @fractaldesign/machines-ui import '@fractaldesign/machines-ui/style.css';
import { GraphDeps } from '@fractaldesign/machines-ui';Preview
<script lang="ts">
import { GraphDeps, type DepNode } from '@fractaldesign/machines-ui';
const deps: DepNode[] = [
{ name: 'machines-ui', version: '0.9.0', accent: true, children: [
{ name: 'svelte', version: '^5.0.0' },
{ name: 'shiki', version: '^4.0.0' }
]}
];
</script>
<GraphDeps title="DEPS" {deps} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* | string | — | Caption drawn on the top edge as `[ TITLE ]`. |
| deps* | DepNode[] | — | Root-level dependencies, each with a name and version. |
| depth | number | 6 | Maximum depth to render. Default 6. Clamped 1..16. |
| animated | boolean | true | Animate the cascade. Default true. Reduced motion shows the full tree. |
| speedMs | number | 80 | Milliseconds between cascading reveals. Default 80. |
| label | string | '' | Caption rendered muted under the tree. |
| class | string | '' |
API
- class forwarded to the outer element
- motion runs live; set animated={false} to freeze
- a11y honours prefers-reduced-motion
Types
| Name | Kind | Description |
|---|---|---|
| DepNode | interface | A node in a dependency tree. |
| FlatRow | interface |
Theming
CSS custom properties this component reads.
- --border
- --graph-accent
- --text-muted
- --text-primary
- --text-secondary
Related
Built from
src/lib/components/animated/GraphDeps.svelte