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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@svelte-gear/svelte-semantic-ui

v0.6.5

Published

svelte bindings for semantic-ui or fomantic-ui

Readme

svelte-semantic-ui

Svelte actions and data bindings for Semantic UI components. https://fomantic-ui.com/ https://svelte.dev/

Example

    <script lang="ts">
        import { InitForm, InitDropdown, InitNumberInput } from "@svelte-gear/svelte-semantic-ui";

        let liveValidation: boolean = $state(true);
        let isValid: boolean = $state(true);
        let country: string = $state("");
        let salary: number | undefined = $state();
    </script>
    <form class="ui form"
        <InitForm
            active={liveValidation}
            bind:valid={isValid}
            settings={{...}}>
        />

        <select class="ui dropdown selection">
            <option value="CA">Canada</option>
            <option value="MX">Mexico</option>
            <option value="US">USA</option>
        </select>
        <InitDropdown
            bind:value={country}
            validate={["empty", "not[US]"]}
            settings={{...}}>
        />

        <input type="text" class="ui input" />
        <InitNumberInput
            bind:value={salary}
            validate={["empty", "minLength[5]"]}
            settings={{ type: "money" }}
        />
    </form>

Versions

  • Version 0.6.x introduces new simpler syntax and more type checks.
  • Version 0.5.x is using svelte 5 and runes.
  • Version 0.4.x is compiled in svelte 4, but may be used in Svelte 5 project.

Design principles

Keep Semantic UI syntax

  • We are NOT creating a replacement Svelte component for each Semantic UI element.
  • Instead of that we keep Semantic HTML layout and add <Init*> components to replace jQuery code. (see doc/COMPONENTS.md)

Data bindings

  • Init* components allow to set and receive value from Dropdown, Calendar, Slider components, input, or textarea.
  • InitModal controls Modal component visibility through show binding.
  • The Init* should follow the Semantic UI component, input, or textarea that it controls.
    • InitForm may additionally be used as a child of the form.
    • The library may be configured to use Init* as a parent or a child of the component.

Settings

  • Javascript initialization calls used by Semantic UI are replaced with settings prop in the Init* component.
  • There are default settings for each component type, while each component may optionally override the settings.

Features

Field formatting

  • The library introduces InitDateInput, InitNumberInput, and InitTextInput with field formatting behavior.
  • InitDateInput works very similar to the calendar component, as both take user input and produce a date object.
  • InitNumberInput supports integer, decimal and money formats controlled by i18n number settings.
  • InitTextInput may be used for simple formatting or validation.
  • You may override format settings for individual input or create and use your own formatter.

Validation

  • While formatting is strict and will remove invalid input, validation leaves entered data as is and displays a warning.
  • We recommend defining validation rules on field level to improve code readability.
  • Use <Init* validate={...} to define the rules using Semantic UI syntax (see https://fomantic-ui.com/behaviors/form.html#/settings)
  • You can register you own rules and use them in your app (see src/lib/data/validation-rules.ts )

i18n

  • Semantic UI allows setting custom messages and formats.
  • svelte-semantic-ui uses this function to support multiple locales.
  • A locale changes date and number formatting as well as validation messages.
  • You can add more locales yourself (see examples/i18n/src/extra-locales/ )

TypeScript

  • The library is written in TypeScript. It works for both TS and JS projects.
  • We strongly recommend that you use type checking in your code :)