Skip to content

jalavosus/svelte-legos

 
 

Repository files navigation

sveltelegos-blue

A fork of ankurrsinghal/svelte-legos, hopefully with more consistent releases and maintenance.

Collection of essential Svelte Composition Utilities

🚀 Features

  • 🎪 Interactive docs & demos
  • âš¡ Fully tree shakeable: Only take what you want, [bundle size]
  • 🦾 Type Strong: Written in TypeScript, with TS Docs
  • 🔋 SSR Friendly
  • 🌎 No bundler required: Usable via CDN
  • 🔩 Flexible: Configurable event filters and targets

🦄 Usage

<script lang="ts">
import { counterStore } from "@sveltelegos-blue/svelte-legos";

const { counter, inc, dec, set, reset } = counterStore();
</script>

<button onclick={() => inc()}>Increment</button>

{counter}

<button onclick={() => dec()}>Decrement</button>
<script lang="ts">
import { clickOutsideAction } from "@sveltelegos-blue/svelte-legos";

let hidden = false;

function handleClickOutside() {
	hidden = !hidden;
}
</script>

<div class="modal" use:clickOutsideAction on:clickoutside={handleClickOutside} />

Refer to functions list or documentations for more details.

📦 Install

npm i @sveltelegos-blue/svelte-legos

Local setup

npm run dev

Current Todos/Projects

  • Actual dark mode design, not just haphazard application of colours where they look good.
  • Styles consolidation (ie. actual themes)
  • Dark mode on demo components in /guides.

Contributions to these lofty goals are welcome.

🌸 Thanks

This project is heavily inspired by the following awesome projects.

License

MIT

About

A framework for Svelte Utilities 💡 Current status: 87 utilities.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 58.7%
  • Svelte 36.5%
  • JavaScript 4.2%
  • Other 0.6%