Skip to content

Commit

Permalink
docs: update readme (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Aug 8, 2024
1 parent 7a86278 commit e3044c9
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 17 deletions.
7 changes: 0 additions & 7 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
69 changes: 69 additions & 0 deletions packages/astrobook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# astrobook

[![NPM version](https://img.shields.io/npm/v/astrobook?color=a1b858&label=)](https://www.npmjs.com/package/astrobook)

> A minimal and fast [Storybook](https://storybook.js.org/) alternative. Powered by [Astro](https://astro.build/).
![astrobook](https://github.com/user-attachments/assets/dbaa6243-4ce2-45da-b760-44543f59bb63)

## Quick start

> [!NOTE]
> Astrobook supports **React**, **Vue**, **Preact**, **Svelte**, **Solid** and **Astro** components out of the box. We use React as an example here. Check the [Astro docs](https://docs.astro.build/en/guides/integrations-guide/#official-integrations) for other integrations.
1. Install the packages

```bash
npm install astro astrobook @astrojs/react
```

2. Create `astro.config.mjs`

```js
import { defineConfig } from 'astro/config'
import react from '@astrojs/react'
import astrobook from 'astrobook'

// https://astro.build/config
export default defineConfig({
integrations: [react(), astrobook()],
})
```

3. Add scripts to your `package.json`

```json
"scripts": {
"dev": "astro dev",
"build": "astro build"
}
```

4. Write stories

```ts
// components/Button.stories.ts
import { Button, type ButtonProps } from './Button.tsx'

export default {
component: Button,
}

export const PrimaryButton = {
args: {
variant: 'primary',
} satisfies ButtonProps,
}

export const SecondaryButton = {
args: {
variant: 'secondary',
} satisfies ButtonProps,
}
```

5. Run `npm run dev` and open `http://localhost:4321` to see your stories.

## License

MIT
10 changes: 0 additions & 10 deletions playground/src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
html,
body {
font-family: system-ui;
margin: 0;
}

body {
padding: 2rem;
}

.counter {
display: grid;
font-size: 2em;
Expand Down

0 comments on commit e3044c9

Please sign in to comment.