@kyndryl-design-system/web-components v1.0.0-beta.19
Kyndryl Design System - Web Components
Contributing to this project
Read the Contributing Guide here.
Using this library in another project
Install the package
# stable/main
npm install @kyndryl-design-system/web-components -S
# beta (use until first stable release)
npm install @kyndryl-design-system/web-components@beta -S
Import the root.css to your app's global styles
The method used (JS Import, CSS import, or <style> tag) will vary based on your framework/bundler, but the stylesheet can be found in node_modules
at:
@kyndryl-design-system/web-components/root.css
Use CSS tokens/variables
You can make use of tokens/variables included in root.css such as --header-height
to pad the body for the fixed position header, --spacing-gutter
for the padding on your main container, or any of the color tokens. These are very bare-bones currently, and will need to be fleshed out later.
Start using components
See Storybook for the full components documentation.
Example:
import { Button } from '@kyndryl-design-system/web-components';
<kyn-button>Button</kyn-button>
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 with React 19, 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 reactify-wc to use these components in React.
Some options for React wrapper libraries:
Server-Side Rendering (SSR)
When using with an SSR framework like Next.js, you may encounter errors with code that only runs client-side, like window
references for example. Here is an article that provides some methods to work around this: Using Non-SSR Friendly Components with Next.js. Basically, for components that make use of something like window
, they need their rendering deferred to only happen on the client-side.
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
8 months ago
10 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago