
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
A tabs can.Component; allows switching between one of many panels using a tabs interface.
A tabs widget that can be loaded by:
With StealJS, you can import this module directly in a template that is autorendered:
<script type='text/stache' can-autorender>
<can-import from="bit-tabs"/>
<bit-tabs>
<bit-panel title="CanJS">
CanJS provides the MV*
</bit-panel>
<bit-panel title="StealJS">
StealJS provides the infrastructure.
</bit-panel>
</bit-tabs>
</script>
<script src='./node_modules/steal/steal.js'
main="can/view/autorender/"></script>
Alternatively, you can import this module like:
import "bit-tabs";
import can from "can";
import $ from "jquery";
import stache from "can/view/stache/stache";
var template = stache("<bit-tabs>"+
"<bit-panel title='X'>X Content</bit-panel>"+
"<bit-panel title='Y'> Y-Content</bit-panel>"+
"</bit-tabs>");
$("body").append(template());
Use require
to load bit-tabs
and everything else
needed to create a template that uses bit-tabs
:
var can = require("canjs");
var $ = require("jquery");
// Add's bit-tabs tag
require("bit-tabs");
// Use stache
require("canjs/view/stache/stache");
var template = can.stache("<bit-tabs>"+
"<bit-panel title='X'>X Content</bit-panel>"+
"<bit-panel title='Y'> Y-Content</bit-panel>"+
"</bit-tabs>");
$("body").append(template());
Configure the can
and jquery
paths and the bit-tabs
package:
<script src="require.js"></script>
<script>
require.config({
paths: {
"jquery": "node_modules/jquery/dist/jquery",
"can": "node_modules/canjs/dist/amd/can"
},
packages: [{
name: 'bit-tabs',
location: 'node_modules/bit-tabs/dist/amd',
main: 'lib/bit-tabs'
}]
});
require(["main-amd"], function(){});
</script>
Make sure you have the css
plugin configured also!
Use bit-tabs like:
define(["can", "jquery", "can/view/stache","bit-tabs"], function(can, $){
var template = can.stache("<bit-tabs>"+
"<bit-panel title='X'>X Content</bit-panel>"+
"<bit-panel title='Y'> Y-Content</bit-panel>"+
"</bit-tabs>");
$("body").append(template());
});
Load the global
css and js files:
<link rel="stylesheet" type="text/css"
href="./node_modules/bit-tabs/dist/global/bit-tabs.css">
<script src='./node_modules/jquery/dist/jquery.js'></script>
<script src='./node_modules/canjs/dist/can.jquery.js'></script>
<script src='./node_modules/canjs/dist/can.stache.js'></script>
<script src='./node_modules/bit-tabs/dist/global/bit-tabs.js'></script>
<script id='main-stache' text='text/stache'>
<bit-tabs>
<bit-panel title='X'>X Content</bit-panel>
<bit-panel title='Y'>Y-Content</bit-panel>
</bit-tabs>
</script>
<script>
$("body").append( can.view("main-stache",{}) );
</script>
FAQs
A tabs can.Component; allows switching between one of many panels using a tabs interface.
The npm package bit-tabs receives a total of 87 weekly downloads. As such, bit-tabs popularity was classified as not popular.
We found that bit-tabs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.