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

simplesvelte

v2.5.0

Published

A lightweight collection of essential Svelte components and utilities for building modern web applications quickly and efficiently.

Downloads

818

Readme

SimpleSvelte

A lightweight collection of essential Svelte components and utilities for building modern web applications quickly and efficiently.

Features

  • Form Components: Ready-to-use Input, Label, Select, and TextArea components with built-in validation support
  • UI Components: Modal and Grid components for common layout needs
  • Popup System: Easy-to-use Pop class for alerts, confirmations, and notifications (powered by SweetAlert2)
  • Utility Functions: FormHelper for form data processing, clickOutside action, and role helpers
  • TypeScript Support: Fully typed components and utilities
  • Lightweight: Minimal dependencies, maximum functionality

Installation

bun install simplesvelte

CSS Setup

SimpleSvelte requires CSS to be imported for proper styling. See CSS_USAGE.md for detailed instructions.

Quick setup:

/* In your main CSS file */
@import 'simplesvelte/styles.css';

Or in JavaScript/TypeScript:

import 'simplesvelte/styles.css'

Quick Start

<script>
	import { Input, Label, Modal, Pop } from 'simplesvelte'

	let showModal = false
	let inputValue = ''

	const handleConfirm = async () => {
		const result = await Pop.confirm('Delete item?', 'This action cannot be undone')
		if (result.isConfirmed) {
			// Handle deletion
			Pop.success('Deleted!', 'Your item has been deleted.')
		}
	}
</script>

<Label for="email">Email Address</Label>
<Input name="email" type="email" bind:value={inputValue} placeholder="Enter your email" required />

<button on:click={() => (showModal = true)}>Open Modal</button>
<button on:click={handleConfirm}>Delete Item</button>

<Modal bind:show={showModal}>
	<h2>Modal Content</h2>
	<p>Your modal content goes here!</p>
</Modal>

Components

aa

Form Components

  • Input: Versatile input component supporting text, email, password, number, date, and more
  • Label: Accessible label component with built-in styling
  • Select: Dropdown select component with custom styling and multi-select support
  • TextArea: Multi-line text input with auto-resize options

UI Components

  • Modal: Flexible modal component with backdrop and keyboard controls
  • Grid: Responsive grid layout component

Utilities

  • Pop: SweetAlert2-powered popup system for alerts, confirmations, and toasts
  • FormHelper: Utility class for processing FormData with type-safe getters
  • clickOutside: Svelte action for detecting clicks outside an element
  • roleHelper: Accessibility helper for ARIA roles

Examples

Select Component

<script>
	import { Select } from 'simplesvelte'

	let singleValue = ''
	let multipleValues = []

	const options = [
		{ value: 'apple', label: 'Apple' },
		{ value: 'banana', label: 'Banana' },
		{ value: 'cherry', label: 'Cherry' },
	]
</script>

<!-- Single Select -->
<Select bind:value={singleValue} {options} label="Choose a fruit" name="fruit" required />

<!-- Multi Select -->
<Select bind:value={multipleValues} {options} label="Choose multiple fruits" name="fruits" multiple />

<!-- Disabled Select -->
<Select value={['apple', 'cherry']} {options} label="Pre-selected fruits" name="preset-fruits" multiple disabled />

Using Pop for Notifications

import { Pop } from 'simplesvelte'

// Success notification
await Pop.success('Your changes have been saved.')

// Error notification
await Pop.error('Something went wrong.')

// Confirmation dialog
const result = await Pop.confirm('Delete this item?', 'This action cannot be undone')
if (!res) {
	// User confirmed
}

// Custom toast
Pop.toast('Updated!', 'success', 'top-end')

Using FormHelper

<script>
	import { FormHelper } from 'simplesvelte'

	function parseFormData(FormData: FormData) {
	  const fh = new FormHelper(formData)
	  const data = {
			name: fh.string("name")
			optionalPhone: fh.nString("phone")
		}

		
	}
</script>

<form use:enhance>
	<!-- Your form inputs here -->
</form>

Using clickOutside Action

<script>
	import { clickOutside } from 'simplesvelte'

	let showDropdown = false

	function handleClickOutside() {
		showDropdown = false
	}
</script>

<div use:clickOutside={handleClickOutside}>
	<!-- Dropdown content -->
</div>

Development

This library is built with SvelteKit and powered by Vite. To contribute or modify the library:

# Clone and install dependencies
git clone <your-repo>
cd SimpleSvelte
bun install

# Start development server with showcase app
bun run dev

# or open in browser automatically
bun run dev -- --open

The src/lib directory contains all library components, while src/routes provides a showcase/preview app for testing components.

Building

To build your library:

bun run package

This will generate the distribution files in the dist directory.

License

MIT - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.