Taxi.js
Taxi is a 🤏 small and 🐊 snappy js library for adding slick PJAX navigation and beautiful transitions to your website.
It was designed as a drop-in replacement (with enhancements) for Highway.js, which is sadly no longer maintained.
Improvements over Highway:
- URL-based routingPerfect for working with WebGL websites, you can now specify unique transitions for every possible navigation.
- Page cache managementPerfect for archives and search result pages, you can now preserve changes made to the DOM by user interaction.
- Ability to preload URLsFirst-class support for adding pages to the cache ahead of schedule.
- Blocks navigation during an active transitionStop users from performing state-breaking navigation by default.
- Auto-run javascript on the new pageIf you are using a CMS or splitting your JS into page-specific modules, we have you covered.
- Previous page's content is automatically removed (you can opt out of this if you like)Clean code, clean mind.
- Click events on links can be intercepted via
stopPropagationwithout hacksThis finally works as you expect. - Handles 301 redirects gracefullyThe user is served the correct content, and the browser navigation works exactly as you would want.
Differences to Highway
- Different public APICheck it out on the API & events reference.
- Different data attributes
data-taxi,data-taxi-view, anddata-taxi-ignoreare to be used instead ofdata-router-wrapper,data-router-view, anddata-router-disabledrespectively. See how to use for more. attachanddetachare no longer methodsLink clicks are listened to via delegation so these are no longer needed.redirectis nownavigateToIt always felt weird as a method name, and now it doesn't.- Renderers now have an
initialLoadmethodNice and simple. - Old content is automatically removed during a transitionYou can opt of this behaviour if you like via the allowInterruption option.
Contributors
Made with ❤️ by Jake Whiteley, and feedback from the Okay Dev community.
What's next: