{"id":38841752,"url":"https://github.com/angular-threejs/ngx-spring","last_synced_at":"2026-01-31T04:03:05.313Z","repository":{"id":331655654,"uuid":"1131735355","full_name":"angular-threejs/ngx-spring","owner":"angular-threejs","description":"@react-spring/core port","archived":false,"fork":false,"pushed_at":"2026-01-12T05:18:40.000Z","size":569,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-26T01:55:26.419Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angular-threejs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-10T15:44:12.000Z","updated_at":"2026-01-12T05:18:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/angular-threejs/ngx-spring","commit_stats":null,"previous_names":["angular-threejs/ngx-spring"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/angular-threejs/ngx-spring","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-threejs%2Fngx-spring","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-threejs%2Fngx-spring/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-threejs%2Fngx-spring/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-threejs%2Fngx-spring/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angular-threejs","download_url":"https://codeload.github.com/angular-threejs/ngx-spring/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angular-threejs%2Fngx-spring/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28928675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T02:59:34.861Z","status":"ssl_error","status_checked_at":"2026-01-31T02:59:05.369Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-17T14:00:29.584Z","updated_at":"2026-01-31T04:03:05.291Z","avatar_url":"https://github.com/angular-threejs.png","language":"TypeScript","readme":"# ngx-spring\n\nSpring-physics based animations for Angular, inspired by [react-spring](https://www.react-spring.dev/).\n\nCreate fluid, natural-feeling animations using spring physics instead of durations and easing curves. Integrates seamlessly with Angular's signal-based reactivity.\n\n## Features\n\n- **Spring Physics**: Natural, physics-based animations that feel alive\n- **Signal Reactive**: Automatically animates when your signals change\n- **Transform Shortcuts**: Use `x`, `y`, `scale`, `rotate` instead of verbose CSS\n- **SSR Safe**: Only runs animations in the browser\n- **TypeScript First**: Full type safety with inferred types\n- **Lightweight**: Built on top of `@react-spring/rafz` for efficient frame scheduling\n\n## Requirements\n\n- Angular 21+ (`@angular/core` and `@angular/common`)\n\n## Installation\n\n```bash\nnpm install ngx-spring\n```\n\n## Quick Start\n\n```typescript\nimport { Component, signal } from '@angular/core';\nimport { spring, Spring } from 'ngx-spring/dom';\n\n@Component({\n  selector: 'app-animated-box',\n  standalone: true,\n  imports: [Spring],\n  template: `\n    \u003cdiv [spring]=\"springValues\" class=\"box\"\u003e\n      Hover me!\n    \u003c/div\u003e\n  `,\n  host: {\n    '(mouseenter)': 'isHovered.set(true)',\n    '(mouseleave)': 'isHovered.set(false)',\n  },\n})\nexport class AnimatedBoxComponent {\n  isHovered = signal(false);\n\n  // Spring automatically animates when isHovered changes\n  springValues = spring({\n    scale: () =\u003e this.isHovered() ? 1.1 : 1,\n    rotate: () =\u003e this.isHovered() ? 5 : 0,\n  });\n}\n```\n\n## API Overview\n\n### `spring()` Function\n\nCreates reactive spring animations. Accepts getter functions that are tracked for signal changes.\n\n```typescript\nimport { spring, config } from 'ngx-spring/dom';\n\n// Basic usage\nspringValues = spring({\n  opacity: () =\u003e this.isVisible() ? 1 : 0,\n  x: () =\u003e this.position().x,\n});\n\n// With custom spring physics\nspringValues = spring({\n  y: () =\u003e this.isOpen() ? 0 : -100,\n}, {\n  config: config.wobbly,  // Bouncy animation\n});\n\n// From/to style\nspringValues = spring({\n  from: { opacity: () =\u003e 0 },\n  to: { opacity: () =\u003e this.isVisible() ? 1 : 0 },\n});\n```\n\n### `Spring` Directive\n\nApplies spring animations to DOM elements.\n\n```html\n\u003c!-- Basic usage --\u003e\n\u003cdiv [spring]=\"springValues\"\u003eAnimated content\u003c/div\u003e\n\n\u003c!-- Custom target element --\u003e\n\u003cdiv [spring]=\"springValues\" [springHost]=\"targetRef\"\u003e\n  \u003cdiv #targetRef\u003eThis element gets animated\u003c/div\u003e\n\u003c/div\u003e\n```\n\n### Transform Shortcuts\n\nUse convenient shortcuts instead of writing CSS transforms:\n\n| Shortcut | CSS Transform |\n|----------|---------------|\n| `x`, `y`, `z` | `translate()` / `translate3d()` |\n| `scale`, `scaleX`, `scaleY` | `scale()` / `scaleX()` / `scaleY()` |\n| `rotate`, `rotateX`, `rotateY`, `rotateZ` | `rotate()` / `rotateX()` / etc. |\n| `skew`, `skewX`, `skewY` | `skew()` / `skewX()` / `skewY()` |\n\n### Spring Presets\n\nBuilt-in spring configurations:\n\n```typescript\nimport { config } from 'ngx-spring';\n\nconfig.default   // tension: 170, friction: 26\nconfig.gentle    // tension: 120, friction: 14\nconfig.wobbly    // tension: 180, friction: 12\nconfig.stiff     // tension: 210, friction: 20\nconfig.slow      // tension: 280, friction: 60\nconfig.molasses  // tension: 280, friction: 120\n```\n\n## Package Structure\n\n- `ngx-spring` - Core animation primitives (`SpringValue`, `config`, `easings`)\n- `ngx-spring/dom` - DOM-specific utilities (`spring()`, `Spring` directive)\n\n## Credits\n\nInspired by [react-spring](https://www.react-spring.dev/) - A spring-physics first animation library.\n\n## License\n\nMIT - Chau Tran\n","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Animations"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-threejs%2Fngx-spring","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangular-threejs%2Fngx-spring","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangular-threejs%2Fngx-spring/lists"}