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

semantic-ui-canjs

v0.0.3

Published

CanJS wrapper around SemanticUI Modules

Downloads

3

Readme

semantic-ui-canjs

CanJS wrapper around SemanticUI modules

A can.view.attr wrapper around SemanticUI modules. With can.view.attr you can add custom behavior to elements that contain a specified html attribute. Since SemanticUI is a set of jQuery plugins, can.view.attr is a natural way to invoke them in a CanJS or DoneJS application.

This wrapper allows you to use SemanticUI modules like popup or accordion with just html, no need to run jQuery plugin yourself.

SemanticUI's CSS should be imported separately. You can use semantic-ui-less package as in this demo.

Settings of an individual module can be defined as "semantic"-prefixed attributes. E.g. to define position for the popup module as bottom left you can add semantic-position="bottom left" attribute (see Usage section).

If you need to use SemanticUI Popup callbacks then you are probably a jQuery-style guy and you don't need this wrapper :)

Note: don't forget to install SemanticIO individual modules if you don't import the whole SemanticUI framework.

Demo

See the included demo /demo/demo.html (run npm install, then http-server in the project root and browse /demo/demo.html).

Popup Demo Popup Demo 2 Popup Demo 3

Installation

Install the wrapper and the desired SemanticUI modules (if you don't load the whole SemanticUI JavaScript)

$ npm install semantic-ui-canjs --save

$ npm install semantic-ui-popup semantic-ui-transition semantic-ui-accordion --save

If you import individual SemanticUI modules don't forget that some modules might require others (e.g. Popup requires Transition, etc).

Usage

   <can-import from="semantic-ui-canjs" />
   <can-import from="semantic-ui-popup/popup" />
   <can-import from="semantic-ui-transition/transition" />
   <can-import from="semantic-ui-accordion/accordion" />

   Popup module with default settings:
   <div class="ui icon button" semantic-module="popup" data-content="Add users to your feed">Add</div>

   Popup with custom settings:
   <a class="browse" semantic-module="popup"
                     semantic-inline="true"
                     semantic-on="click"
                     semantic-position="bottom left">Button</a>

   Accordion module:
   <div class="ui styled accordion" semantic-module="accordion">...</div>

API

Attributes:

  • semantic-module="<module name>" - main attribute to invoke the wrapper.
  • semantic-* - use any of module's settings with this prefix. E.g. popup's semantic-position="bottom left" or semantic-hoverable="true".

Contributing

Pull requests are welcome.

Authors