Title: [Feature]: Declarative enter/leave/move transitions bound to `bq-if` and `bq-for` · Issue #137 · bQuery/bQuery · GitHub
Open Graph Title: [Feature]: Declarative enter/leave/move transitions bound to `bq-if` and `bq-for` · Issue #137 · bQuery/bQuery
X Title: [Feature]: Declarative enter/leave/move transitions bound to `bq-if` and `bq-for` · Issue #137 · bQuery/bQuery
Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery's motion module is strong but imperative — there is no declar...
Open Graph Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery's motion module is st...
X Description: Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery's motion module i...
Opengraph URL: https://github.com/bQuery/bQuery/issues/137
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature]: Declarative enter/leave/move transitions bound to `bq-if` and `bq-for`","articleBody":"**Pre-flight checklist**\n- [x] I searched existing issues and did not find a duplicate request.\n- [x] I explained the problem or use case, not just the desired API.\n\n**Problem or use case**\nbQuery's `motion` module is strong but **imperative** — there is no declarative way to animate elements as they enter, leave, or move under conditional and list rendering. Svelte ships `transition:`/`in:`/`out:`/`animate:` and Vue ships `\u003cTransition\u003e`/`\u003cTransitionGroup\u003e` for exactly this, and authors expect to attach an enter/leave animation to a `bq-if` toggle or a `bq-for` reorder without writing lifecycle glue. This is a visible ergonomics gap in the view layer.\n\n**Proposed solution**\nAdd a declarative transition directive that binds the existing motion engine to view lifecycle: enter/leave transitions when a `bq-if`/`bq-show` element mounts or unmounts, and move/FLIP transitions when `bq-for` items reorder. Reuse the motion module's transitions, springs, and FLIP under the hood so this is a thin declarative layer, not a second animation engine — keeping it zero-dependency and consistent with the motion API. Respect reduced-motion preferences automatically (the motion module already exposes this).\n\n**Possible API or UX shape**\n```html\n\u003c!-- enter/leave on conditional render --\u003e\n\u003cdiv bq-if=\"open\" bq-transition=\"fade\" bq-transition-duration=\"200\"\u003e…\u003c/div\u003e\n\n\u003c!-- separate in/out --\u003e\n\u003cli bq-if=\"visible\" bq-in=\"slide-up\" bq-out=\"fade\"\u003e…\u003c/li\u003e\n\n\u003c!-- FLIP move on list reorder --\u003e\n\u003cul\u003e\n \u003cli bq-for=\"item in items\" bq-key=\"item.id\" bq-animate=\"flip\"\u003e…\u003c/li\u003e\n\u003c/ul\u003e\n```\n\n**Alternatives considered**\nDocumenting how to call the imperative motion API from `bq-init`/lifecycle hooks — works but is boilerplate for the most common animation need and has no parity with Svelte/Vue. A standalone animation directive engine independent of `motion` — rejected; it should delegate to the existing motion primitives to avoid divergence and bundle bloat.\n\n**Relevant area**\n`view`\n\n**Additional context**\nStrengthens both `view` (#136) and the perception of `motion` parity. Should compose with the transition primitives in #135 so async boundaries can animate their fallback/content swap.\n","author":{"url":"https://github.com/JosunLP","@type":"Person","name":"JosunLP"},"datePublished":"2026-06-26T21:25:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/137/bQuery/issues/137"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7caf09b4-1284-e867-77dd-2961029e9f36 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA18:1EB0:608254:8C0369:6A4E20B1 |
| html-safe-nonce | 7ccdf856c910efaec2783a68ec656fcc0329fd29d31659fe8d8442636c3279a6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTE4OjFFQjA6NjA4MjU0OjhDMDM2OTo2QTRFMjBCMSIsInZpc2l0b3JfaWQiOiI1NzgzMTYxOTUxMDQwMTg0NDk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e141ca2ea85214a78c09b7514193a900b8c914a4cbc138e0725e8e9671a992e5 |
| hovercard-subject-tag | issue:4755237919 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bQuery/bQuery/137/issue_layout |
| twitter:image | https://opengraph.githubassets.com/85eeb18acd4bf27229dfc4d36ae8d5358bd4603c204949dced8ee1fc33b1297d/bQuery/bQuery/issues/137 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/85eeb18acd4bf27229dfc4d36ae8d5358bd4603c204949dced8ee1fc33b1297d/bQuery/bQuery/issues/137 |
| og:image:alt | Pre-flight checklist I searched existing issues and did not find a duplicate request. I explained the problem or use case, not just the desired API. Problem or use case bQuery's motion module is st... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JosunLP |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git |
| octolytics-dimension-user_id | 256381806 |
| octolytics-dimension-user_login | bQuery |
| octolytics-dimension-repository_id | 1139284244 |
| octolytics-dimension-repository_nwo | bQuery/bQuery |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1139284244 |
| octolytics-dimension-repository_network_root_nwo | bQuery/bQuery |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5fe497b4815fcce3df76c0e246faa739a82c3124 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width