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

@itrocks/action-bar

v0.0.8

Published

CSS for action button bars with flexible layout and basic styling

Readme

npm version npm downloads GitHub issues discord

action-bar

CSS for action button bars with flexible layout and basic styling.

This documentation was written by an artificial intelligence and may contain errors or approximations. It has not yet been fully reviewed by a human. If anything seems unclear or incomplete, please feel free to contact the author of this package.

Installation

npm i @itrocks/action-bar

Include the generated CSS in your HTML, either directly from node_modules or via your usual bundler / asset pipeline.

<link href="./node_modules/@itrocks/action-bar/action.css" rel="stylesheet">

Usage

@itrocks/action-bar provides a small set of CSS classes to display action buttons as a flexible horizontal bar.

At its core, you:

  1. Wrap your actions in a <ul class="actions"> list.
  2. Put each action inside a <li> element.
  3. Use a clickable element (<button>, <a>, <input type="submit">, etc.) inside each <li>.

The stylesheet takes care of:

  • horizontal layout with wrapping when there is not enough space,
  • basic button look (border, background, hover effect),
  • consistent padding so there is room for an optional icon on the left.

Minimal example

<link href="./node_modules/@itrocks/action-bar/action.css" rel="stylesheet">

<ul class="actions">
	<li><button type="submit" name="save">Save</button></li>
	<li><button type="submit" name="cancel">Cancel</button></li>
</ul>

This renders two buttons side by side, with a small gap between them and a neutral default styling.

Example with general / selection bars and icons

In a typical it.rocks application you often have two distinct action bars:

  • a general bar for actions that apply to the whole page,
  • a selection bar for actions that apply to the current selection (for example selected rows in a table).
<link href="./node_modules/@itrocks/action-bar/action.css" rel="stylesheet">

<!-- General actions at the top of a page -->
<ul class="actions general">
	<li>
		<button type="button" class="new" style="background-image: url('/icons/add.svg')">
			New
		</button>
	</li>
	<li>
		<button type="submit" class="search" style="background-image: url('/icons/search.svg')">
			Search
		</button>
	</li>
</ul>

<!-- Selection‑based actions below a list or table -->
<ul class="actions selection">
	<li>
		<button type="submit" class="delete" style="background-image: url('/icons/delete.svg')">
			Delete selected
		</button>
	</li>
</ul>

Only the layout and base look (padding, border, hover background) come from @itrocks/action-bar; the icon is provided by a background-image (inline style in the example above, but most projects use dedicated CSS classes instead).

API

The package exposes a single stylesheet, action.css, which defines a few CSS selectors. There is no JavaScript API.

ul.actions

Turns an unordered list into a horizontal action bar.

  • Display: flex with wrapping enabled (flex-wrap: wrap).
  • Spacing: gap: 5px, padding: 5px, no default margin.
  • Intended children: <li> elements, each containing one clickable element.

ul.actions.general

General action bar, usually displayed at the top of a page or card.

  • Adds a bottom border: border-bottom: 1px solid #ccc.

ul.actions.selection

Selection‑based action bar, usually displayed below a list or table to act on the current selection.

  • Adds a top border: border-top: 1px solid #ccc.

.action

Generic class for standalone actions or for use on the clickable element inside an action bar.

  • Pointer cursor.
  • Base padding: 4px 8px 4px 26px (left padding keeps room for an icon).
  • Line height: 16px.

You can apply .action on:

  • a button that is not inside a .actions list but should look the same as the others;
  • an <input type="submit"> rendered by other components (for example the search submit button in the movie search form of this project).

Shared styles for .action and ul.actions > li

Both standalone actions and list items share the same visual treatment:

  • white background,
  • 1‑pixel grey border with a small radius,
  • inline‑block display,
  • smooth background hover transition,
  • support for an optional background icon:
    • background-position: left center,
    • background-repeat: no-repeat,
    • background-size: 24px.

You are expected to provide the icon yourself by setting background-image (directly or via a custom CSS class).

ul.actions > li > *

Normalises the content of each list item (typically a link, button or input):

  • same line height and padding as .action (4px 8px 4px 26px).

ul.actions > li > a

Ensures links inside an action bar behave like buttons:

  • displayed as inline-block so that padding and hover styles apply properly.

ul.actions > li > input

Resets the browser’s default styling for inputs so they match other actions:

  • transparent background,
  • no border,
  • pointer cursor.

Typical use cases

  • Grouping several form submit buttons (search, save, reset, export) into a consistent horizontal bar.
  • Displaying page‑level actions (new, duplicate, delete, back) at the top or bottom of an entity screen.
  • Providing selection actions below a table or list (delete selected, export selected, mark as read, etc.).
  • Styling a few standalone buttons with the same look as the global action bars by simply applying the .action class.
  • Integrating with the rest of the it.rocks UI stack, for example in association with @itrocks/list, @itrocks/edit or custom pages that need a compact, reusable action area.