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

@islandspan/span-ui

v0.1.9

Published

Reusable UI components for Svelte projects

Readme

@islandspan/span-ui

A collection of reusable Svelte components for building modern web applications.

Installation

npm install @islandspan/span-ui

Components

Button

A versatile button component with multiple variants and styles, inspired by Tailwind CSS design patterns.

Props:

  • label (string) - Button text (default: "Click")
  • onClick (function) - Click handler
  • variant (string) - Button style: primary, secondary, soft, outline, ghost, danger (default: "primary")
  • size (string) - Button size: xs, sm, md, lg, xl (default: "md")
  • disabled (boolean) - Disabled state (default: false)
  • type (string) - Button type attribute (default: "button")
  • fullWidth (boolean) - Full width button (default: false)
  • rounded (boolean) - Fully rounded/pill-shaped button (default: false)
  • circular (boolean) - Circular icon button (default: false)
  • ariaLabel (string) - Accessibility label

Variants:

  • Primary - Indigo solid button for primary actions
  • Secondary - White button with border for secondary actions
  • Soft - Light indigo background for subtle emphasis
  • Outline - Transparent with colored border
  • Ghost - Transparent with minimal styling
  • Danger - Red solid button for destructive actions

Examples:

<script>
  import { Button } from '@islandspan/span-ui';
  
  function handleClick() {
    alert('Button clicked!');
  }
</script>

<!-- Primary button -->
<Button label="Primary" variant="primary" onClick={handleClick} />

<!-- Secondary button -->
<Button label="Secondary" variant="secondary" onClick={handleClick} />

<!-- Soft button -->
<Button label="Soft" variant="soft" onClick={handleClick} />

<!-- Different sizes -->
<Button label="Small" size="sm" onClick={handleClick} />
<Button label="Medium" size="md" onClick={handleClick} />
<Button label="Large" size="lg" onClick={handleClick} />

<!-- Rounded button -->
<Button label="Rounded" rounded={true} onClick={handleClick} />

<!-- Full width button -->
<Button label="Full Width" fullWidth={true} onClick={handleClick} />

<!-- Disabled button -->
<Button label="Disabled" disabled={true} onClick={handleClick} />

<!-- Button with icon using slot -->
<Button variant="primary" onClick={handleClick}>
  <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
  </svg>
  Add Item
</Button>

<!-- Circular icon button -->
<Button circular={true} ariaLabel="Settings">
  <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
  </svg>
</Button>

Modal

A modal dialog component with backdrop.

Props:

  • show (boolean) - Controls visibility (default: false)
  • title (string) - Modal title
  • onClose (function) - Close handler

Example:

<script>
  import { Modal } from '@islandspan/span-ui';
  
  let showModal = false;
</script>

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

<Modal 
  show={showModal} 
  title="My Modal" 
  onClose={() => showModal = false}
>
  <p>Modal content goes here</p>
</Modal>

DataTable

A data table component for displaying tabular data.

Props:

  • items (array) - Array of objects with name and contact
  • onEdit (function) - Edit handler
  • onDelete (function) - Delete handler

Example:

<script>
  import { DataTable } from '@islandspan/span-ui';
  
  const items = [
    { name: 'John', contact: '[email protected]' },
    { name: 'Jane', contact: '[email protected]' }
  ];

  function handleEdit(item) {
    console.log('Edit', item);
  }

  function handleDelete(item) {
    console.log('Delete', item);
  }
</script>

<DataTable {items} onEdit={handleEdit} onDelete={handleDelete} />

Usage

Import components individually:

<script>
  import { Button, Modal, DataTable } from '@islandspan/span-ui';
</script>

Or import all components:

<script>
  import * as SpanUI from '@islandspan/span-ui';
</script>

<SpanUI.Button label="Hello" />

Development

# Install dependencies
npm install

# Build the library
npm run build

# Development mode
npm run dev

License

MIT © IslandSpan Solutions

Repository

https://github.com/islandspan-solutions/SpanUI