Skip to content

Commit a8e081a

Browse files
committed
feat: update UI
1 parent c9f75cc commit a8e081a

1 file changed

Lines changed: 57 additions & 2 deletions

File tree

apps/web/.storybook/welcome.stories.mdx

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,66 @@ import { Meta, Story } from '@storybook/addon-docs';
1212

1313
<br />
1414

15-
<p className="!text-base !text-foreground max-w-xl [&>p]:text-foreground [&>p]:text-base">
15+
<p className="!text-foreground [&>p]:text-foreground max-w-xl !text-base [&>p]:text-base">
1616
Here you can find the guidelines, components APIs and examples to help you build your next project with VAR-UI.
1717
</p>
1818
<br />
1919

20-
<div class="block text-xs [&>p]:text-default-400">
20+
## Install
21+
22+
The UI came with diffences package namely `@var-ui/icon` and `@var-ui/core`
23+
24+
```sh
25+
npm install @var-ui/core @var-ui/icon
26+
```
27+
28+
```sh
29+
yarn add @var-ui/core @var-ui/icon
30+
```
31+
32+
```sh
33+
pnpm i @var-ui/core @var-ui/icon
34+
```
35+
36+
## Tailwind CSS Setup
37+
38+
var-ui is built on top of Tailwind CSS, so you need to install Tailwind CSS first. You can follow the official
39+
[installation guide](https://tailwindcss.com/docs/installation) to install Tailwind CSS. Then you need to add
40+
the following code to your `tailwind.config.js` file:
41+
42+
```ts
43+
// tailwind.config.ts
44+
import { createThemes } from '@var-ui/theme';
45+
import { withTV } from 'tailwind-variants/transformer';
46+
import type { Config } from 'tailwindcss';
47+
48+
const config: Config = {
49+
darkMode: 'class',
50+
content: [
51+
'./.storybook/welcome.stories.mdx',
52+
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
53+
'./src/app/**/*.{js,ts,jsx,tsx,mdx}',
54+
'./node_modules/@var-ui/core/**/*.{js,ts,jsx,tsx}',
55+
],
56+
plugins: [createThemes()],
57+
};
58+
59+
export default withTV(config);
60+
```
61+
62+
## Use the Component
63+
64+
Now, you can use the component you installed in your application:
65+
66+
```jsx
67+
import * as React from 'react';
68+
import { Button } from '@var-ui/core';
69+
70+
function App() {
71+
return <Button>Press me</Button>;
72+
}
73+
```
74+
75+
<div class="[&>p]:text-default-400 block text-xs">
2176
Last updated on <time datetime="2023-03-07">May 9, 2024</time>
2277
</div>

0 commit comments

Comments
 (0)