Skip to content

Commit f7d9e2b

Browse files
committed
readme
1 parent 16cd8f5 commit f7d9e2b

1 file changed

Lines changed: 27 additions & 6 deletions

File tree

docs/content/2.guide/3.storybook.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Storybook is a development environment for UI components that helps catch UI cha
44

55
- **Accessibility tests** - Built-in a11y checks
66
- **Visual tests** - Compare JPG screenshots
7-
- **Vitest tests** - Use stories directly in your unit tests
7+
- **Vitest tests** - Use stories directly in the unit tests
88

99
## Component Categories
1010

1111
The plan is to organize components into 3 categories.
1212

1313
### UI Library Components
1414

15-
Generic and reusable components used throughout your application.
15+
Generic and reusable components used throughout the application.
1616

1717
- Examples: Button, Input, Modal, Card
1818
- **Testing focus:** Props, variants, accessibility
@@ -42,9 +42,9 @@ TBD
4242

4343
## Project Conventions
4444

45-
### Place a `.stories.ts` file next to your component
45+
### Place `.stories.ts` files next to the component
4646

47-
```
47+
```sh
4848
components/
4949
├── Button.vue
5050
└── Button.stories.ts
@@ -70,6 +70,27 @@ export const Default: Story = {
7070
}
7171
```
7272

73+
### JSDocs Annotation
74+
75+
The component should include descriptive comments.
76+
77+
```ts
78+
// Button.vue
79+
<script setup lang="ts">
80+
const props = withDefaults(
81+
defineProps<{
82+
/** Whether the button is disabled */
83+
disabled?: boolean
84+
/**
85+
* HTML button type attribute
86+
* @default "button"
87+
- `autodocs` usage is discouraged at this time, as it is buggy.
88+
type?: 'button' | 'submit'
89+
// ...
90+
}>)
91+
</script>
92+
```
93+
7394
## Configuration
7495
7596
Stories can be configured at three levels:
@@ -84,6 +105,6 @@ Global application settings are added to the Storybook toolbar for easy testing
84105
85106
## Known Limitations
86107
87-
- `autodocs` usage is discouraged as it is buggy.
88108
- Changing `i18n` in the toolbar doesn't update the language. A manual story reload is required.
89-
- `storybook` fails to build.
109+
- `autodocs` currently is non-functional due bugs, its usage is discouraged at this time.
110+
- `storybook` currently fails to build and must be viewed in the dev environment.

0 commit comments

Comments
 (0)