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

@carbon/ibm-products

v2.53.0

Published

Carbon for IBM Products

Downloads

58,515

Readme

@carbon/ibm-products

Carbon for IBM Products is an open source implementation of the closed source pattern asset library (PAL). These PAL designs build on the foundation of IBM’s open source Carbon Design System and React implementation to offer components and patterns beyond the typical component library. Carbon for IBM Products was previously known as Carbon for IBM Cloud and Cognitive (@carbon/ibm-cloud-cognitive), and this name can still be encountered in various places and historical logs.

All Contributors Licensed under the Apache License, Version 2.0 Build status Netlify status GitHub Lerna version PRs welcome

Carbon for IBM Products common UI components

🚀 Getting started

If you’re just getting started and looking to browse our React components, take a look at our Storybook.

📦 Installing Carbon for IBM Products

To use Carbon for IBM Products components, all you need to do is install the @carbon/ibm-products package.

$ yarn add @carbon/ibm-products

# or

$ npm install @carbon/ibm-products

Then you can import the component styles in your index.js.

import '@carbon/ibm-products/css/index.min.css';

Webpack 4

Our package requires support for ES modules (see #2378). In Webpack 5, these are supported by default. In Webpack 4, you will need to add the following rule to your config.

rules: [
  {
    test: /\.mjs$/,
    include: /node_modules/,
    type: 'javascript/auto',
  },
],

Peer dependencies

@carbon/ibm-products is built on top of Carbon components and has a number of dependencies which need to be installed.

Note: @carbon/elements rolls up a number of Carbon packages that could be installed independently. As this list of dependencies could change, we leave you to view package.json in ibm-products if you wish to install individual packages.

Examples

Online examples

Examples for each released component, and some that are still not quite ready, can be found here on

CodeSandbox Stackblitz

Packages

You can find example projects using the components in the examples folder.

Usage

To start using the components

import { AboutModal } from '@carbon/ibm-products';

const App = () => {
  return <AboutModal />;
};

Package prefix

The @carbon/ibm-products package uses a default prefix of c4p for CSS selectors and some IDs.

Changing the prefix

Before any @carbon/ibm-products components are loaded in script or styling ensure you have done the following.

import { pkg } from '@carbon/ibm-products/es/settings';

pkg.prefix = 'tst';

When using multiple components from the library:

@use '@carbon/ibm-products/scss' with (
  $pkg-prefix: 'tst'
);

When using individual components e.g. AboutModal:

@use '@carbon/ibm-products/scss/config' with (
  $pkg-prefix: 'tst'
);

@use '@carbon/ibm-products/scss/components/AboutModal';

See the example gallery for the most up-to-date prefix examples.

Enabling Canary components and flagged features

Components that have not yet completed the release review process are considered to be canary and require the consumer to enable via a feature flag in a config.js file.

For example, create a config.js in your src directory:

import { pkg } from '@carbon/ibm-products';

// Enable 'canary' (not yet reviewed/released) components
// that we want to make use of
pkg.component.AboutModal = true;
pkg.component.SidePanel = true;

// Live dangerously: enable all components!
pkg.setAllComponents(true);

// Enable a feature flagged examples
pkg.feature.nameOfFeature = true;
pkg.feature['Component.feature'] = true;

// Live dangerously: enable all pre-release features!
pkg.setAllFeatures(true);

The default values for component and feature flag settings can be found by running the following command.

node node_modules/@carbon/ibm-products/flags.js

Note: The above settings must happen before a component first renders or a feature is first used.

Note: 2 In the case of features implemented via hooks the feature may function without enabling. In all cases features that disabled by default will log in the console a warning if enabled via a feature flag or an error if not.

Building and running locally

To get started, run the following commands and Storybook will be built and then served on port 3000 on your local machine.

yarn install
yarn storybook

To build all the packages, run the following command.

yarn build

Browser support

This library supports the latest versions of:

  • Apple Safari
  • Google Chrome
  • Microsoft Edge
  • Mozilla Firefox

🙌 Contributing

This project is made possible by several community members who have invested their precious time to give back to the Carbon community. It will continue to be possible by having those that benefit from the package contribute back to it.

So, do not be shy. We both depend on and appreciate contributors, new and old, who help us fix bugs, build new features, improve our documentation, etc.

If you’re interested, definitely check out our Contributing Guide and Carbon’s Developer Handbook! 👀

IBM Telemetry

This package uses IBM Telemetry to collect de-identified and anonymized metrics data. By installing this package as a dependency you are agreeing to telemetry collection. To opt out, see Opting out of IBM Telemetry data collection. For more information on the data being collected, please see the IBM Telemetry documentation.

📝 License

Licensed under the Apache-2.0 License.

This site is powered by Netlify