v1.0.0

HTML components.
Zero runtime.

There's times where you just want to reuse a component like a nav on every page, and not need a whole framework. Bascik solves that problem. Create a file, the filename is the component name. Add CSS and JS inside the file, that gets scoped automatically. Then simply reference that component name in your page as an HTML tag.

npm create bascik@latest

You write the HTML. Bascik scopes it.

Create a file with your component name. Add your HTML, CSS, and JavaScript. Reference that tag in any page or component with no imports or configuration needed.

<!-- src/components/my-card.html -->
<style>
  .card {
    padding: 26px 28px;
    background: #1e2022;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;

    h3 { margin: 0 0 8px; color: #f0f1f2; }
    p  { margin: 0; color: #8d929e; }
  }
</style>
<div class="card" id="card">
  <div data-bascik-slot></div>
</div>
<script>
  const card = document.getElementById('card');
  card.addEventListener('click', () => {
    card.classList.toggle('active');
  });
</script>

Live render

My Card

Any HTML goes inside as slot content. Click to toggle state.

One component. Two isolated instances.

Bascik scopes CSS class names and DOM selectors at build time. Each component instance gets its own namespace with no runtime and no Shadow DOM.

<!-- src/components/demo-counter.html - component template -->
<div class="ctr">
  <span class="ctr-label"
         data-bascik-prop-label></span>
  <span class="ctr-count" id="count">0</span>
  <div class="ctr-btns">
    <button class="ctr-dec"></button>
    <button class="ctr-inc">+</button>
  </div>
</div>

<!-- src/pages/index.html - usage -->
<demo-counter data-bascik-prop-label="Instance A"></demo-counter>
<demo-counter data-bascik-prop-label="Instance B"></demo-counter>
Two instances of one component file
Instance A0
Instance B0

Use what already exists.

The principle behind every decision Bascik makes: no inventions, no abstractions you have to learn.

No JS added

Zero runtime footprint

Bascik adds no JavaScript to your output. Every script in dist/ was written by you. What you ship is exactly what you wrote.

Build-time scoping

No CSS collisions. Ever.

Class names and DOM selectors are rewritten at build time. No CSS-in-JS, no BEM discipline, no global namespace to manage.

Standard HTML

Nothing new to learn

No JSX, no template syntax, no special compiler directives. Write the HTML you already know. Bascik does the assembly.

Up and running in under a minute.

One command scaffolds your project and starts the dev server. No config required to get going.

$npm create bascik@latest
Read the Getting Started Guide →