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

sculptorjs

v1.1.2

Published

Allows you to easily 'sculpt' beautiful, cross-browser HTML dropdowns with standard CSS

Downloads

23

Readme

Sculptor JS

Build Status

What Is Sculptor JS

Sculptor JS allows you to easily 'sculpt' beautiful html dropdowns that look the same across all browsers with just CSS. The library is very lightweight and is intended to be a quick way for you to get custom styled dropdowns on a page. This is accomplished with the age old practice of creating custom html elements on top of existing native select controls and then feeding the user interaction back to those native elements.

What Sculptor JS Is Not

It is not at this point in time intended as your go-to for cross-browser styling of all native html elements. It is not a jack of all trades and will only style drop-downs that it is specifically told to style.

Installation Instructions

Sculptor JS can be installed using NPM or by cloning the repository and including the compiled js file in your website.

NPM

First you have to install the tool itself (which comes bundled with pocket-dom)

npm install sculptorjs

Javascript Example

// Just a closure
(function (w, doc) {
    "use strict"
    var myAgeSelector,
        sculptor = require("sculptorjs"); // browserify require of sculptorjs

    // On window load, get the select element that I would like to style and pass it into sculptor
    w.onload = function () {
        var myAgeSelector = doc.getElementById("age-selector");
        sculptor.init([myAgeSelector]); // Notice that an array is required even for a single element - [myAgeSelector]
    }

}(window, document));

Non-NPM

First you have to clone the repo

git clone [email protected]:ordergroove/sculptorjs.git

After cloning, you can use the compiled sculptor.js file and CSS in your website like this

<!DOCTYPE html>
<html>
    <head>
        <title>My Page</title>
        <!-- Include Sculptor JS and Base CSS files -->
        <script src="node_modules/sculptorjs/dist/sculptor.js" type="text/javascript"></script>
        <link rel="stylesheet" href="node_modules/sculptor/dist/sculptor.css" type="text/css"/>
    </head>
    <body>
        <select id="age-selector" name="age">
            <option value="1">One</option>
            <option value="2">Two</option>
        </select>
    </body>
</html>
    
// Just a closure
(function (w, doc) {
    "use strict"
    var myAgeSelector;

    // On window load, get the select element that I would like to style and pass it into sculptor
    w.onload = function () {
        myAgeSelector = doc.getElementById("age-selector");
        sculptor.init([myAgeSelector]); // Notice that an array is required even for a single element - [myAgeSelector]
    }

}(window, document));

Required Base CSS

After Sculptor JS is installed, please reference the base css in your page. This can be as simple as copy/pasting the css in node_modules/sculptorjs/dist/sculptor.css to your existing stylesheets or referencing the file directly.

NOTE: If you're running with LESS then please feel free to @import "node_modules/sculptorjs/src/sculptor.less"

Make Sure It's Working

Load up your HTML page in your favorite browser and you should no longer be seeing the native select elements but their Sculptor JS counterparts.

Issues

We love feedback! If you run into any issues while installing or using this project, please create a new issue here. If the issue is related to a specific browser(s), then please be sure to leave the browser information in the issue description.

Special Thanks to OrderGroove

We would like to take this opportunity to thank everyone at for allowing us the time to work on open sourcing this project. Without their support, this project would not exist.