Skip to content

About

A lightweight, user-centric WebUI component library built entirely from scratch using SCSS and JS. This design system provides the foundational interface components for LowerSoft’s official website and commercial product suite.

Topics

Resources

Contributing

Stars

18 stars

Watchers

0 watching

Forks

Repository files navigation

lw_compo

GitHub Actions Workflow Status npm version GitHub License GitHub Repo stars

lw is a set of animated UI components built with SCSS and vanilla JavaScript Web Components. Rather than shipping a framework, it gives you standard custom elements that work everywhere, with zero runtime dependencies and nothing to configure.
It serves as the common UI layer for LowerSoft's web products and is under active development.



Usage

Everything below works the same in plain HTML, React, Vue, Svelte or anything else. No framework needed.

1.1 Get the package

There are no peer dependencies and no build plugins to configure.

npm install @lowersoft/lw

Or load it from a CDN:

<!-- In <head> -->
<link rel="stylesheet" href="https://unpkg.com/@lowersoft/lw/dist/themes.css">

<!-- In <body> -->
<script type="module">
  import 'https://unpkg.com/@lowersoft/lw/dist/index.js';
</script>

Or, for a single component:

<script type="module">
  import 'https://cdn.jsdelivr.net/npm/@lowersoft/lw/dist/components/button.js';
</script>

Important

The <script> tag must use type="module"; import statements only work in module scripts. The CDN paths above point to the built dist/ output. If the published package layout changes, check the file paths on unpkg or jsDelivr. Loading the full bundle registers every component. Importing a single entry point registers only that component.

1.2 Import and render

Import only what you need, every component is a separate entry point:

import '@lowersoft/lw/components/button';

Or register everything at once:

import '@lowersoft/lw';

Then use it like any other HTML element:

<lw-button variant="outline" size="lg">Get started</lw-button>

Components render with the default theme right after the import. There is nothing to wrap, provide or initialize.

1.3 A complete page from a CDN

This example uses no package manager, no bundler, and no framework. It loads one component from unpkg, applies the default theme, overrides a few design tokens, and styles a component internal with ::part().

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>lw CDN Example</title>

  <!-- Optional: static theme tokens before JavaScript loads -->
  <link rel="stylesheet" href="https://unpkg.com/@lowersoft/lw/dist/themes.css">

  <!-- Register only the button component -->
  <script type="module">
    import 'https://unpkg.com/@lowersoft/lw/dist/components/button.js';
  </script>

  <style>
    /* Override design tokens. Defaults have zero specificity. */
    :root {
      --lw-color-primary: #6d28d9;
      --lw-radius-md: 9999px;
    }

    /* Style component internals through ::part() */
    lw-button::part(button) {
      letter-spacing: 0.02em;
    }
  </style>
</head>
<body>
  <h1>lw components via CDN</h1>

  <!-- Use components like normal HTML elements -->
  <lw-button variant="outline" size="lg">Get started</lw-button>
  <lw-button>Default button</lw-button>
</body>
</html>

No initialization, wrapper, provider, or configuration is required. Once the module is imported, every matching custom element on the page is registered and rendered with the default theme.

1.4 Theming

The default theme is installed automatically on first use. It follows prefers-color-scheme; force a scheme with data-theme on <html>:

<html data-theme="dark">

Every design token is a --lw-* CSS custom property. Override any of them, default values have zero specificity, so plain declarations win:

:root {
  --lw-color-primary: #6d28d9;
  --lw-radius-md: 9999px;
}

Style component internals with ::part():

lw-button::part(button) {
  letter-spacing: 0.02em;
}

Need the tokens in your own CSS before JavaScript loads? Link the static theme:

import '@lowersoft/lw/themes.css';

1.5 SCSS

SCSS users can reuse the token functions and mixins:

@use '@lowersoft/lw/scss' as lw;

.card {
  border-radius: lw.v(radius-lg);
}

1.6 Handy commands

Command What it does
npm install Install the development dependencies
npm run storybook Component docs and playground; each story's Usage tab has its markup and API
npm run build Library build into dist/
npm run lint Check the JavaScript with ESLint
npm run build-storybook Static Storybook build into storybook-static/
npm test Open every story of that build in Chromium and fail on errors and leaks
npm run new <name> <Category> Scaffold a new component in a Storybook category

Something broke? Delete node_modules/ and dist/, run npm install again and retry. Still stuck? Open an issue.

How it works

The idea is simple: use the platform and put a thin, boring layer on top of it. Components are plain custom elements, styling is plain CSS custom properties, and the small shared runtime only handles what you would otherwise repeat in every component (theme installation, registration, animation helpers).

2.1 The big picture

flowchart TB
    A["Your page<br/><sub>&lt;lw-button&gt; in HTML, React, Vue, Svelte…</sub>"] --> B["lw components<br/><sub>custom elements · shadow DOM · ::part()</sub>"]
    B --> C["Shared runtime<br/><sub>~2 kB gzip · registration · theme install</sub>"]
    B --> D["Design tokens<br/><sub>--lw-* CSS custom properties</sub>"]
    D --> E["Light · Dark · Your overrides"]
Loading

Your code only ever talks to the HTML element and its attributes. Nothing else leaks upward.

2.2 Repo layout

components/
├── src/
│   ├── components/   One folder per component, each its own entry point
│   ├── core/         The shared runtime: base class, registration, helpers
│   ├── styles/       Tokens, functions, mixins and the default theme
│   └── index.js      The full bundle
├── scripts/          Component scaffolding (npm run new) and the story smoke test
├── .storybook/       Component docs and playground, with the Usage tab
├── .changeset/       Pending release notes
├── CONTRIBUTING.md
└── ROADMAP.md

2.3 Dependencies: none

lw has zero runtime dependencies. No third-party code is bundled, nothing is patched, and every component is a separate entry point, so you only pay for what you import. The shared runtime is about 2 kB (gzip). The one outside contribution is icon artwork from Lucide, see Third-party software.

2.4 Component lifecycle

Importing a component registers its custom element. From there the browser owns the lifecycle:

import '@lowersoft/lw/components/button'
 ├─ shared runtime loads (once, shared by every component)
 ├─ default theme is installed on first use
 ├─ customElements.define('lw-button', …)
 └─ every <lw-button> on the page
     ├─ connectedCallback   ← render + attach animations
     ├─ attributeChangedCallback (variant, size, …)
     └─ disconnectedCallback ← cleanup

Because they are standard custom elements, they work in any framework that can render HTML.

2.5 Theming

Design tokens are installed as CSS custom properties, and components read them at render time:

default theme ──install──▶ :root { --lw-* } ──read──▶ components
      ▲                          ▲
      │                          └── your overrides win (default values have zero specificity)
      └── prefers-color-scheme / data-theme picks light or dark
  • Defaults are declared with zero specificity, so any plain declaration in your CSS overrides them.
  • data-theme on <html> forces a scheme, otherwise prefers-color-scheme decides.
  • Component internals are exposed through ::part(), so you can restyle them without touching the source.
  • themes.css is the same set of tokens as a static file, for use before JavaScript loads.

2.6 Build system

Piece What it does
SCSS Source of all component styles and the exported token functions and mixins.
npm run build Builds the library into dist/, one entry point per component plus the full bundle.
Storybook Component docs and playground, started with npm run storybook.
ESLint npm run lint catches undefined names, unused code and other mistakes.
Smoke test npm test opens every story of the static Storybook, takes its elements out of the page and puts them back, and fails on errors or animations that keep running. CI runs it on every push.
npm run new Scaffolds a component (and its story) so every component starts with the same structure.

2.7 Extending it

Want a new component? Run npm run new <name> <Category>, fill in the generated files and it becomes its own entry point, the same way every existing component is done: no extra libraries, one import from your app. See CONTRIBUTING.md and ROADMAP.md.

Contact

Not sure where to start? Pick the row that matches your situation, so your message reaches the right people on the first try.

I want to... Reach us via
Ask about licensing or copyright info@lowersoft.com
Follow up on a repo issue that hasn't had a reply support@lowersoft.com
Report a problem with the UI of a LowerSoft product I own Open a ticket on lowersoft.com
Learn what lw brings to our products Live chat on lowersoft.com, no sign-in needed

A few details

  • Licensing & copyright (info@): using lw in your own project, redistribution, attribution or anything legal-sounding. If in doubt, ask before you ship.
  • Unanswered issues (support@): please open a GitHub issue first. It keeps the answer public and useful for everyone. If it has been quiet for a while, send us a short mail with the issue link and we'll pick it up.
  • Product tickets: if a LowerSoft product you bought has a UI problem (layout, theme, crashes in the interface), a ticket is the fastest route because it is tied to your account and product version. Include a screenshot and your browser.
  • Live chat: it connects you straight to our customer relations team, no account required.

Heads up: this is a component library repo, not a product helpdesk. Product questions go to a ticket, library bugs go to GitHub issues. Everything else is welcome in the table above.

Credits

Built and maintained by LowerSoft. Every part of this project is shaped by our own time and effort, and we're not planning to slow down. 💙

Contributors

Everyone who has helped along the way shows up here automatically:

Contributors

Want to see your face here? Head over to Contribute.

Contribute

Our goal is to make building animated, accessible web UI easier, tidier and more reliable for everyone. Any contribution that moves the project in that direction is welcome, from a one-character typo fix to a new component. Pull requests and forks are always appreciated.

I want to... Do this
Report a bug Open an issue with the steps to reproduce, the expected result and the actual result
Suggest an idea Open an issue; rough ideas are fine
Fix or add something Fork the repo and send a pull request
Improve the documentation Send a pull request; wording, missing steps and typos are all welcome
Test on my browser Run Storybook and report the result, especially on less common browsers

Sending a pull request

  1. Fork the repository and create a branch from main (for example fix/button-focus or feat/tooltip).
  2. Build it with npm run build and make sure it compiles without warnings, and run npm run lint.
  3. Test it by opening the component in Storybook (npm run storybook), then run npm run build-storybook and npm test. The first test run needs Playwright's Chromium: npx playwright install chromium --only-shell.
  4. Open the pull request and describe what changed and why. Screenshots or recordings help for UI and animation changes.

For larger changes, please open an issue first so we can agree on the direction before you invest the time.

Guidelines

  • Vanilla JavaScript and SCSS, no runtime dependencies.
  • Code, comments and documentation are written in English.
  • Every design token is a --lw-* CSS custom property, and defaults keep zero specificity.
  • Components expose their internals through ::part().
  • Commit messages start with a short summary line, followed by a brief explanation when the reasoning is not obvious.

Questions about contributing? See Contact and CONTRIBUTING.md.

License

lw is released under the MIT License. You are free to use, copy, modify, merge, publish, distribute, sublicense and sell copies of the software, including in commercial projects, as long as the copyright notice and the license text are included in all copies or substantial portions of it.

The software is provided "as is", without warranty of any kind.

Third-party software

lw has no runtime dependencies. Its icons come from Lucide (ISC), some of them derived from Feather (MIT); their notices are in THIRD-PARTY-NOTICES.md, which ships with the package.

Questions about licensing or copyright? See Contact.

Best regards, LowerSoft Team.

About

A lightweight, user-centric WebUI component library built entirely from scratch using SCSS and JS. This design system provides the foundational interface components for LowerSoft’s official website and commercial product suite.

Topics

Resources

Contributing

Stars

18 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages