@kyndryl-design-system/shidoka-charts
TypeScript icon, indicating that this package has built-in type declarations

1.6.6 • Public • Published

Shidoka Web Components for Applications

shidoka-charts

Contributing to this project

Read the Contributing Guide here.

Using this library in another project

Install the package

npm install @kyndryl-design-system/shidoka-charts @kyndryl-design-system/shidoka-foundation -S

Import the root stylesheet to your app's global styles

The method used (SCSS @use, CSS @import, JS import, or <style> tag) will vary based on your framework/bundler. Some examples:

SCSS

@use '~@kyndryl-design-system/shidoka-foundation/scss/root.scss';

CSS

@import '@kyndryl-design-system/shidoka-foundation/css/root.css';

JS

import '@kyndryl-design-system/shidoka-foundation/css/root.css';

Start using components

See Storybook for the full components documentation.

Example

import '@kyndryl-design-system/shidoka-charts/components/chart';
<kd-chart></kd-chart>

React usage

React does not yet support automatic interop with Web Components. This means that React treats all props passed to Web Components as string attributes. It sounds like they are planning to release it eventually, and is now available behind an @experimental flag. Until you've upgraded to a version of React that has support, you will need to use a library like @lit/react to use these components in React.

Some options for React wrapper libraries:

  1. @lit/react
  2. reactify-wc
  3. wc-react

Server-Side Rendering (SSR)

When using with an SSR framework like Next.js, you will encounter errors with code that only runs client-side, like window references for example. This is because web components cannot render on the server. Here is an article that provides some methods to work around this: Using Non-SSR Friendly Components with Next.js and How to entirely disable server-side rendering in next.js v13?. Basically, they need their rendering deferred to only happen on the client-side.

Here is some additional information about why SSR does not work for web components, and some potential polyfills/solutions to enable server rendering: https://lit.dev/docs/ssr/overview/

Readme

Keywords

none

Package Sidebar

Install

npm i @kyndryl-design-system/shidoka-charts

Weekly Downloads

1,453

Version

1.6.6

License

none

Unpacked Size

2.62 MB

Total Files

578

Last publish

Collaborators

  • jaideep08
  • tulasigudibanda
  • kumarivijeta
  • w.barbee
  • frodesigns
  • brian-patrick