0.1.29 • Published 10 months ago

kex-component-library v0.1.29

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

To deploy to Firebase, follow these steps:

  1. Make sure you have Firebase CLI installed. If not, run npm install -g firebase-tools to install it globally.

  2. Open your terminal and navigate to the root directory of your project.

  3. Run firebase login to authenticate with your Firebase account.

  4. Once you are logged in, run yarn deploy to build the Storybook static files and deploy them to Firebase.

  5. Firebase will provide you with a URL where you can access your deployed application.

That's it! Your project should now be deployed to Firebase using the firebase login and yarn deploy commands.

To structure and build stories in your project, you can follow these steps:

  1. Create a new directory called stories in the root directory of your project.
  2. Inside the stories directory, create a new file for each component you want to create a story for. For example, if you have a Button component, create a file called Button.stories.js.
  3. In each story file, import the necessary dependencies and the component you want to create a story for. For example:
import React from "react";
import Button from "../components/Button";

export default {
  title: "Components/Button",
  component: Button,
};
  1. Define different variations of your component by creating different "stories" using the add function. For example:
export const Primary = () => <Button variant="primary">Primary Button</Button>;

export const Secondary = () => (
  <Button variant="secondary">Secondary Button</Button>
);

export const Disabled = () => <Button disabled>Disabled Button</Button>;
  1. Customize each story by passing different props to your component. This allows you to showcase different states or variations of your component.

  2. To view your stories, run yarn storybook in your terminal. This will start the Storybook development server and open a browser window where you can navigate through your stories.

That's it! You have now learned how to structure and build stories for your components using Storybook.

To install this component library through npm, follow these steps:

  1. Open your terminal and navigate to the root directory of your project.
  2. Run the following command to install the component library:
npm install kex-component-library
  1. Wait for the installation to complete. This will download and install the component library and its dependencies into your project.
  2. Once the installation is finished, you can import and use the components from the library in your project.

That's it! You have now successfully installed the component library through npm.