Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hashrock/fresh-stories

Fresh storybook alternative
https://github.com/hashrock/fresh-stories

Last synced: 3 months ago
JSON representation

Fresh storybook alternative

Awesome Lists containing this project

README

        

# Fresh stories

Storybook alternative for Fresh

image

# Usage

1. import plugin

```ts
// fresh.config.ts
import { defineConfig } from "$fresh/server.ts";
import tailwind from "$fresh/plugins/tailwind.ts";
+ import storiesPlugin from "https://deno.land/x/[email protected]/stories-plugin.ts";

export default defineConfig({
+ plugins: [tailwind(), storiesPlugin()],
});
```

2. Create story file

```tsx
// islands/stories/Button.story.tsx

import { Button } from "../../components/Button.tsx";

export default function Stories() {
return (



MyButton


);
}
```

3. Open http://localhost:8000/stories

# Story files

The Story file is a simple tsx file summarizing the usage of components.

- Story files need to be created with the name `*.story.tsx`.
- Story files need to be placed inside the islands folder.

# Example

https://github.com/hashrock/fresh-stories-example