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

storybook-ui5

v1.2.0

Published

Storybook for UI5: View UI5 controls in isolation with hot reloading.

Readme

Storybook for UI5


Storybook is a popular tool for developing UI components in isolation. It works with most popular frameworks, but UI5 was not one of them so far.

With Storybook, you can visualize different states of your UI components and develop them interactively. It works with hot module reloading, so you can view your changes as you're making them.

Storybook runs outside of your app, so you can develop UI components in isolation without worrying about app specific dependencies and requirements. It's a great tool for working on controls in isolation.

Getting Started

Quick start

Copy the contents of the example project to a new folder. You could clone the github project first to make copying easier.

Run npm install and run npm run storybook.

Slow start

In your node project, install the following needed dependencies:

npm install storybook-ui5 @storybook/addon-essentials@6 @babel/core@7 babel-loader@8 webpack@4

Create a .storybook folder and add a main.js file:

// .storybook/main.js
module.exports = {
  stories: [`../stories/*.stories.*`],
  addons: [
    "@storybook/addon-essentials"
  ]
};

Also add a preview.js file:

// .storybook/preview.js
export const parameters = {}

And a preview-head.html file:

<!-- .storybook/preview-head.html -->
<script id="sap-ui-bootstrap"
	src="https://openui5.hana.ondemand.com/resources/sap-ui-core.js"
	data-sap-ui-theme="sap_belize"
	data-sap-ui-libs="sap.m, sap.ui.layout, sap.tnt"
	data-sap-ui-resourceroots='{"custom": "./custom"}'
	data-sap-ui-async="true">
</script>

Next, put your custom controls in the folder components/[namespace]/[control].js, for example:

// components/custom/ReverseButton.js
sap.ui.define(["sap/m/Button"], function (Button) {
	
	return Button.extend("ReverseButton", {

		setText: function (text) {
			this.setProperty("text", text.split("").reverse().join(""));
		},

		renderer: {}
	});

});

Then, create your first story in the stories folder:

// stories/ReverseButton.stories.js
export default {
  title: 'ReverseButton',
  argTypes: {
    text: {
      control: 'text'
    }
  }
};

const Template = (args) => `<ReverseButton xmlns="custom" text="${args.text}" />`;

export const Simple = Template.bind({});

Simple.args = {
  text: "Wait, this is weird!"
}

Now you can start working on your storybook. Add two scripts to the package.json. The flag -s ./components makes sure the contents of the components folder are served as static resources in the http-server that storybook creates.

  // package.json
  "scripts": {
    "storybook": "start-storybook -s ./components -p 9001",
    "build-static": "build-storybook -s ./components"
  }

Now run UI5 storybook

npm run storybook

Hot module reload

When running npm run storybook, the browser should show the storybook.

Make your changes to existing stories or start adding new story files to the project and the changes should be reflected immediately.

Adding controls and writing stories

Add controls to the components folder and add a new file to the stories folder, using the filename of the control, but with the .stories.js filename ending.

Story functions should output XML. The outputted XML is rendered by a Fragment.load() function by storybook-ui5. Namespaces can added and changed by changing the data-sap-ui-resourceroots property in the ui5 bootstrap script in the preview-head.html file.

See the example for writing a simple story and look in the Storybook documentation for the complete instructions.

More reading

Read the storybook docs for more information on Storybook and its features. Though UI5 is not listed as a framework, most features should apply. The HTML docs are probably the most applicable.