0.1.0 • Published 1 year ago

react-doc-hooks v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Library for simple documentation react components

Get started

0) Create project

1) Configure entry point

In App.tsx add component <ReactDocHooks/> and init components by function createStories

Example:

const stories = createStories([
    { name: 'Button', component: ButtonStory, markdownFile: ButtonMD },
    { name: 'Input', component: InputStory, markdownString: InputStoryMarkdown },
]);

export const App = () => (
    <>
        <ReactDocHooks stories={stories} />
    </>
);

2) Add hooks

Just import hooks from library and configure some parameters

Example:

const [stringControl] = useStringControl({
    defaultValue: 'Name',
    name: 'String control',
    rowsCount: 1,
  });
  
return (
      <button>
        {stringControl}
      </button>
  );

... and start project!