JSPM

@itwin/itwinui-react

1.9.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 39457
  • Score
    100M100P100Q165742F
  • License MIT

A react implementation of our iTwinUI UX standards

Package Exports

  • @itwin/itwinui-react

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@itwin/itwinui-react) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

iTwinUI logo

iTwinUI-react

itwinui-react on npm Build status

What is iTwinUI-react?

iTwinUI-react is a library built on top of the iTwinUI library. The goal of this project is to provide React components for using the styles and components from the core iTwinUI project. Check out the demo website to see the components in action.


Installation

npm install @itwin/itwinui-react
yarn add @itwin/itwinui-react

Usage

Import the component you want and start using it!

import { Button } from '@itwin/itwinui-react';

const App = () => (
  <Button>Hello!</Button>
);

Yes, that's really all you need as you can see in this live interactive demo:

Edit Button


Theming

By default, all components use the light theme but we also provide support for switching to dark theme in two different ways:

  • Use ThemeProvider in your root component where you can pass one of the following values:
    • light (default)
    • dark
    • os (which respects the color scheme of the operating system)
import { ThemeProvider } from '@itwin/itwinui-react';

const App = () => (
  <>
    <ThemeProvider theme='dark' />
    // Your code goes here.
  </>
);
  • The useTheme hook also provides the same functionality as ThemeProvider.
import { useTheme } from '@itwin/itwinui-react';

const App = () => {
  useTheme('dark');
  return (
    <>
      // Your code goes here.
    </>
  );
};

Note: You only need to use one of these methods, and it only needs to be done once.


FAQ

For a list of frequently asked questions, visit the wiki.


Contributing

We welcome you to contribute and make this UI design system better. You can submit feature requests or bugs by creating an issue. Please read our CONTRIBUTING.md for more information.


Changelog

Read our CHANGELOG.md to find recent changes.