Skip to content

Commit d42a6d2

Browse files
Update design-system.md
1 parent 2163499 commit d42a6d2

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

docs/design-system.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
23
---
34
id: design-system
45
title: Design System Integration
@@ -8,13 +9,15 @@ sidebar_label: Design System Integration
89
## Introduction
910
A consistent design system is integrated to the all of the app types by using `nextui` and `theme.js` file which can be generated by using the structure defined by [nextui create theme](https://nextui.org/docs/theme/typescript#create-theme) docs and using nextui `createTheme` method.
1011

11-
`nextui` is a library that uses stitches internally to style components in the react ecosystem. It allows users to write styles in css within the js files. It also has components and provides customized theming. To know more about nextui visit [nextui org](https://nextui.org/docs/guide/getting-started) docs.
12+
`nextui` is a library that uses [stitches](https://stitches.dev/) internally to style components in the react ecosystem. It allows users to write styles in css within the js files. It also has components and provides customized theming. To know more about nextui visit [nextui org](https://nextui.org/docs/guide/getting-started) docs.
1213

13-
`nextui` provides `<NextUIProvider>` which is a theme provider component which accepts a `theme` prop (created using createTheme nextui method and json) which overrides the nextui default theme. The `<NextUIProvider>` is kept at the highest level in the component chain. This allows all of the components within it to inherit the `theme` prop. In case of our Next.js app the `<NextUIProvider>` is added in `src/pages/_app.js`.
14+
`nextui` provides `<NextUIProvider>` which is a theme provider component which accepts a `theme` prop (created using createTheme nextui method and json) which overrides the nextui default theme.
1415

1516
## How to use
16-
1. Create a theme using the structure defined by [nextui create theme](https://nextui.org/docs/theme/typescript#create-theme) and store it as `src/themes/theme.js`.
17-
2. Now in all `nextui` styled components, theme prop is available to use as following:
17+
1. The `<NextUIProvider>` is kept at the highest level in the component chain. This allows all of the components within it to inherit the `theme` prop. In case of our Next.js app the `<NextUIProvider>` is added in `src/pages/_app.js`.
18+
2. `nextui` provides a default theme that can be used out of the box.
19+
3. To customize, create a theme using the structure defined by [nextui create theme](https://nextui.org/docs/theme/typescript#create-theme) and wrap it in `createTheme` nextui method and store it as `src/themes/theme.js`.
20+
4. Now in all `nextui` styled components, theme props is available to use as following:
1821
```jsx
1922
export const Button = styled('button', {
2023
fontSize: '$3',
@@ -24,8 +27,13 @@ export const Button = styled('button', {
2427
border: '2px solid black',
2528
borderRadius: '$1',
2629
display: 'block',
27-
length: '1' // this property is added temporarily for the issue of nextui styled method with typescript v4.6.2. Will not be required once the issue is resolved.
30+
length: '1'
2831
});
2932
```
3033

34+
## Know Issue
35+
The `length` property used in styled method is added temporarily for the issue of nextui styled method with typescript v4.6.2. Will not be required once the issue is resolved.
36+
Issue: https://github.com/modulz/stitches/issues/947
37+
38+
---
3139
More about cutomizing theming can be found in [nextui customize theme](https://nextui.org/docs/theme/customize-theme) docs.

0 commit comments

Comments
 (0)