0.0.25 • Published 9 months ago

nuxt-simple-stories v0.0.25

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Nuxt Simple Stories

npm version npm downloads License Nuxt

Simple stories for Nuxt. Work on your components in isolation with zero configuration. Also enabled in your Nuxt DevTools

Getting Started

Installation

pnpm add -D nuxt-simple-stories
export default defineNuxtConfig({
  modules: [
    'nuxt-simple-stories'
  ],
  // optional configuration
  simpleStories: {
    // Set to false to deploy stories to production. (default: true)
    devOnly: true,
  }
})

Usage

Create a stories folder in the root of your Nuxt project. Create a *.story.vue file for each story you want to create. The name of the file will be used as the name of the story. Directories will be used to show a tree view in the UI.

<script setup lang="ts">
// this is just another Nuxt 3 component, so you can use all the same features like auto imports, Pinia store, etc.
</script>

<template>
  <Variant title="Base Button">
    <BaseButton variant="primary">
      Primary Button
    </BaseButton>
    <BaseButton variant="secondary">
      Secondary Buttton
    </BaseButton>
  </Variant>
  <Variant title="Disabled buttons">
    <BaseButton
      variant="primary"
      disabled
    >
      Primary Button
    </BaseButton>
    <BaseButton
      variant="secondary"
      disabled
    >
      Secondary Buttton
    </BaseButton>
  </Variant>
</template>

The Variant component can be used to group for example different states of a component. The title prop will be used as the name of the variant.

0.0.25

9 months ago

0.0.24

9 months ago

0.0.23

9 months ago

0.0.22

9 months ago

0.0.21

9 months ago

0.0.20

9 months ago

0.0.19

9 months ago

0.0.18

10 months ago

0.0.17

10 months ago

0.0.16

10 months ago

0.0.15

10 months ago

0.0.14

10 months ago

0.0.13

11 months ago

0.0.12

11 months ago

0.0.11

11 months ago

0.0.9

11 months ago

0.0.6

11 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago