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 🙏

© 2024 – Pkg Stats / Ryan Hefner

svercle

v0.1.1

Published

This is the Svercle. A small svelte component that produces a configurable superellipse approximation similar to a squircle. The component is based on this [REPL](https://svelte.dev/repl/2319271d93c34981aafce411f8345be8?version=3.18.2) (I have yet to find

Downloads

8

Readme

Svercle

svercle-example

This is the Svercle. A small svelte component that produces a configurable superellipse approximation similar to a squircle. The component is based on this REPL (I have yet to find the author, but would like to thank them for all the work).

Use this as buttons, cards, or any other element that you would like apply a funny shape to. The squircle is, after all, the cutest of all the shapes.

Why an approximation you ask? In order to keep the generated svg small and reusable I decided to use an eight point approximation (see the REPL link above) which also allows for creating some truly interesting shapes.

Install

#Grab the package from npm:
npm install svercle

Usage

This library exports two components. A Svercle component and a SvercleContainer component.

  • The SvercleContainer component is a simple wrapper around the Svercle component equipped with a grid and a slot for your content (makes it easy to use as a button).

  • The Svercle component is the actual component that you can use. It takes a config object as a prop.

The config object has the following properties: curve, anchor, and fill.

  • The curve property is a number between 0 and 10 that determines the curvature of the superellipse.

  • The anchor property is a number between 0 and 10 that determines the corner sharpness.

  • The fill property is a string that determines the color of the superellipse. All properties are optional, and the curve, and anchor default to 5 and 0 respectively. While fill defaults to #fff.

Example:

<script>
	import { SvercleContainer } from 'svercle';

	let config = {
		curve: 6,
		anchor: 0.2,
		fill: '#e13c6e'
	};
</script>

<button>
	<SvercleContainer {config}><span>Click me!</span></SvercleContainer>
</button>

<style>
	button {
		padding: 0;
		border: none;
		background: none;
		cursor: pointer;
	}
	span {
		padding: 1rem 2rem;
	}
</style>

License

This component is licensed under the MIT License (MIT).