npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

svelte-flick

v1.0.2

Published

A simple, flexible, and reactive **feature flag management system** for Svelte apps. Flick helps you toggle features dynamically during development or in production, enabling controlled rollouts, A/B testing, and experimental UI activation with minimal

Downloads

7

Readme

Flick

A simple, flexible, and reactive feature flag management system for Svelte apps. Flick helps you toggle features dynamically during development or in production, enabling controlled rollouts, A/B testing, and experimental UI activation with minimal setup.


Features

  • Reactive Svelte store for feature flags
  • Easy toggle UI component
  • Conditional rendering with FeatureFlag wrapper component
  • Lightweight and 0 dependencies
  • Supports dynamic updates without page reloads

Installation

Install via npm:

npm install svelte-flick

Usage

1. Set up the feature flag store

Within your main component or layout, initialize the feature flags using the initFeatureFlags function. This sets up the initial state of your flags.

<script lang="ts">
import { initFeatureFlags } from 'svelte-flick';

initFeatureFlags({
    'feature-a': true,
    'feature-b': false,
    'experimental-ui': false,
    'beta-content': true
});
</script>

<slot />

2. Add the toggle popup UI

Use the provided FlagPopup.svelte component to toggle flags interactively:

<script>
  import FlagPopup from 'svelte-flick';
</script>

<FlagPopup />

3. Conditionally render features

Wrap feature-specific UI inside the FeatureFlag component:

<script>
  import FeatureFlag from 'svelte-flick';
</script>

<FeatureFlag on="feature-a">
  <p>Feature A is enabled</p>
</FeatureFlag>

Or use the store directly:

{#if $featureFlags['feature-b']}
  <p>Feature B is enabled</p>
{:else}
  <p>Feature B is disabled</p>
{/if}

Example

-- src/routes/+layout.svelte --

<script lang="ts">
    import { initFeatureFlags } from 'svelte-flick';

    initFeatureFlags({
        'feature-a': true,
        'feature-b': false,
        'experimental-ui': false,
        'beta-content': true
    });
</script>

<slot />

-- src/routes/+page.svelte --

<script>
    import FlagPopup from 'svelte-flick';
    import FeatureFlag from 'svelte-flick';
    import { featureFlags } from 'svelte-flick';
</script>

<FlagPopup />

<main>
  <FeatureFlag on="feature-a">
    <h2>Feature A Content</h2>
  </FeatureFlag>

  {#if $featureFlags['feature-b']}
    <p>Feature B Enabled</p>
  {:else}
    <p>Feature B Disabled</p>
  {/if}
</main>

Advanced Usage

You could create your own custom toggle UI or integrate Flick with your backend to fetch feature flags dynamically. The store is reactive, so any changes to the flags will automatically update the UI without needing a page reload.

The featureFlags store can be used directly in any Svelte component to check the status of flags or to toggle them programmatically.

This is a snippet from FlagPopup.svelte which demonstrates how to use the store

import { featureFlags } from 'svelte-flick';
import { onMount } from 'svelte';

let flags = {};

const toggleFlag = (key: string) => {
    featureFlags.toggle(key);
};

const unsubscribe = featureFlags.subscribe(v => {
    flags = v;
});

onMount(() => {
    return () => unsubscribe();
});