Skip to content

Commit f7fe6f3

Browse files
chore: Update README.md
1 parent 26eb72f commit f7fe6f3

File tree

1 file changed

+34
-16
lines changed

1 file changed

+34
-16
lines changed

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,50 @@
77
To install the BDP-UI library, you can use the following command:
88

99
```bash
10-
yarn add github:bitcoin-dev-project/bdp-ui
10+
yarn add @bitcoin-dev-project/bdp-ui
1111
```
1212
or
1313
```bash
14-
npm install github:bitcoin-dev-project/bdp-ui
14+
npm i @bitcoin-dev-project/bdp-ui
1515
```
1616

1717
## Usage
1818

19-
Once installed, you can import the components you need from the library:
19+
Once installed, you can import the components or icons you need from the library:
2020

21-
note: you can set up an entry point in your project config to `/dist` to fix the autocomplete and linting issues. Or in typescript you can use the `paths` property in tsconfig.json to fix the import paths.
21+
## CSS workaround
22+
Kindly import the css file to your global entry point.
23+
Usually, that is `app/layout.tsx`
2224

23-
```json
24-
{
25-
"compilerOptions": {
26-
"baseUrl": ".",
27-
"paths": {
28-
"bdp-ui/*": ["./node_modules/bdp-ui/dist/*"]
29-
}
30-
}
31-
}
25+
_note: import the css before your global css so if there are any conflicts your css takes precedence_
26+
```tsx
27+
// app/layout.tsx
28+
...
29+
import "@bitcoin-dev-project/bdp-ui/styles.css"
30+
import "./globals.css";
31+
...
32+
```
33+
34+
If you use tailwind for styling, also point your tailwind config to the library
35+
i.e
36+
```tsx
37+
// tailwind.config.ts
38+
...
39+
const config: Config = {
40+
darkMode: "class",
41+
content: [
42+
"./src/components/**/*.{js,ts,jsx,tsx,mdx}",
43+
"./src/app/**/*.{js,ts,jsx,tsx,mdx}",
44+
"node_modules/@bitcoin-dev-project/bdp-ui/dist/**/*.{js,mjs,jsx,ts,tsx}", // add it here
45+
],
46+
...
3247
```
3348
3449
### Components
50+
Here is how you can import and use components
3551
3652
```jsx
37-
import { Button } from 'bdp-ui';
53+
import { Button } from '@bitcoin-dev-project/bdp-ui';
3854

3955
function App() {
4056
return (
@@ -44,8 +60,10 @@ function App() {
4460
```
4561
4662
### Icons
63+
Here is how you can import icons
64+
4765
```jsx
48-
import { GithubIcon } from 'bdp-ui/icons';
66+
import { GithubIcon } from '@bitcoin-dev-project/bdp-ui/icons';
4967

5068
function App() {
5169
return (
@@ -56,4 +74,4 @@ function App() {
5674
5775
## License
5876
59-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
77+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

0 commit comments

Comments
 (0)