Tab Navigation

Create tabbed interfaces without JavaScript frameworks
Learn how to build accessible tab navigation using hyperscript's class manipulation and event delegation. Perfect for organizing content into sections!
show/hide add/remove classes event delegation

Product Features

๐Ÿ“‹ Product Overview

LokaScript is a modern, TypeScript-powered implementation of the hyperscript language with 100% pattern compatibility.

Built for developers who want the simplicity of declarative HTML attributes combined with the power of a complete programming language.

โœจ Zero dependencies โ€ข ๐Ÿ“ฆ Tiny bundle size โ€ข ๐Ÿš€ Lightning fast

โšก Key Features

๐ŸŽฏ 100% Pattern Coverage: All 77 hyperscript patterns implemented

๐Ÿ“˜ TypeScript Support: Full type safety and IntelliSense

๐Ÿ”ง Enhanced Commands: Extended functionality beyond standard hyperscript

๐ŸŽจ Modern API: Clean, intuitive interface for developers

๐Ÿงช Well Tested: Comprehensive test suite with 440+ passing tests

๐Ÿ’ฐ Pricing

Open Source - FREE Forever!

LokaScript is completely free and open source under the MIT license. No restrictions, no limits, no paid tiers.

โœ… Unlimited projects
โœ… Commercial use allowed
โœ… Full access to all features
โœ… Community support
โœ… Regular updates

๐Ÿ’ฌ Support & Community

Need help? We've got you covered!

๐Ÿ“š Documentation: Comprehensive guides and examples
๐Ÿ’ก GitHub Issues: Report bugs or request features
๐Ÿ‘ฅ Community: Join our growing community
๐Ÿ“ง Email: Direct support for critical issues

The Code

Tab Buttons:

<button class="tab active" _="on click remove .active from .tab add .active to me remove .active from .tab-content add .active to #overview"> Overview </button>

Tab Content:

<div id="overview" class="tab-content active"> Content for Overview tab </div> <div id="features" class="tab-content"> Content for Features tab </div>

CSS for Active States:

/* Hide inactive content */ .tab-content { display: none; } /* Show active content */ .tab-content.active { display: block; } /* Style active tab */ .tab.active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; }

How it works:

Key Concepts:

Advanced Tab Patterns:

<!-- Keyboard navigation --> <div class="tabs" _="on keydown[key=='ArrowRight'] get next .tab if it exists then click it end on keydown[key=='ArrowLeft'] get previous .tab if it exists then click it end"> <!-- Auto-switch tabs --> <button _="on click repeat 3 times wait 2s get next .tab or first .tab click it end"> Auto Demo </button> <!-- Tab with URL hash --> <button _="on click remove .active from .tab add .active to me set window.location.hash to '#overview'"> Overview </button>

Common Use Cases:

Accessibility Tips:

Try it yourself: