Skip to content

Commit

Permalink
docs: inform about using with typescript (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
josokinas authored Feb 17, 2021
1 parent c33736f commit 043d616
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,7 @@ Or using the Sass helper:
```html
<button class="ods-button -action--primary round">Round Button</button>
```

Components have basic types exported so that you could create your own JS/TS variations using any renderer chosen (for example, Vue or Angular).

Please note that the `@onfido/castor-icons` package is a peer dependency and is required to be installed for **types** to work properly. Yarn and newer versions of npm (using lockfile v2) will resolve it, otherwise it must be installed manually even if you don't plan to use icons.
8 changes: 8 additions & 0 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ You may wish to configure your bundler to transpile to a different module syntax

For example, you might choose UMD module syntax targeting ES5 if your app needs to support IE11 (please note that Castor is not tested in Internet Explorer).

### Use with TypeScript

Components extend base prop types with JSX additions.

When using with TypeScript, always import types from `@onfido/castor-react`.

Please note that the `@onfido/castor-icons` package is a peer dependency and is required to be installed for **types** to work properly. Yarn and newer versions of npm (using lockfile v2) will resolve it, otherwise it must be installed manually even if you don't plan to use icons.

### Make custom styled components

You should use props for each component modifier, but it is also possible to create custom styled components.
Expand Down

0 comments on commit 043d616

Please sign in to comment.