
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Codedocs is a Storybook replacement that's designed for the professional application developer. It presumes you've already set up a React application build pipeline, that you're happy with it, and you just want to document your components.
If you're a beginner, you can still use Codedocs, but you may want to start with a scaffold like Confgen. Confgen can generate a React app for you with Codedocs preconfigured.
Design choices in Codedocs have been made to address some places where Storybook missed. Each of these issues has influenced Codedocs design:
| Storybook | Codedocs | |
|---|---|---|
| 1 | Storybook error handling is atrocious. Stories just silently won't load | Codedocs uses your existing build pipeline |
| 2 | MDX files don't have type checking, and TSX files can't do proper prose documentation. | Everything is in TSX files, fully typed. And you just drop your demos and API references into your prose JSX block |
| 3 | Storybook has its own special build environment that's different from your app's. It adds a whole layer of debugging. | It uses your existing build pipeline |
| 4 | The default Storybook layout is not very good for a public demonstration site. | It's designed as public documentation site first |
| 5 | Your documentation uses Storybook's design system, not YOUR design system that you worked so hard to create. | The UI is 100% swappable for your own |
| 6 | It's slow to start up and hot reloading is unreliable. | Startup time is as fast as you can make your build pipeline go |
| 6 | Adding types to your stories is... optional. Each new story is a new chance for someone to decide not to type anything. | Everything is in TSX files, fully typed |
Your documentation files can still live alongside your code, but they just export JSX elements:
// Button.docs.tsx
import React from "react"
import { Doc, Demo } from "codedocs"
import { Button } from "./Button"
export default (
<Doc path="/Controls/Button">
The Button is meant to be used for everything that can be tapped, whether or
not it has a background.
</Doc>
)
export const BasicButton = (
<Demo>
<Button>Save</Button>
</Demo>
)
Then, you can go ahead and use create-react-app or install Vite and throw an index.html somewhere,
that's up to you. To get the site working, all you need to do is render <DocsApp> in there:
import * as ButtonDocs from "./Button.docs"
import { DocsApp } from "codedocs"
import React from "react"
import { render } from "react-dom"
render(<DocsApp docs={[ButtonDocs]} />, document.getElementById("root"))
I can't instruct you on how to start that, because you can set up the build however you want. That's the point, you can just use the same build infrastructure you've surely already set up to build your Design System.
codedocs package provides some React components that make it easy to turn
documentation files into site.The other thing is doesn't do is have any dependencies. You provide React and React Router as peerDependencies, and that's it.
If you're maintaining a design system, or just a component library, you likely have:
That are required by your components. You can provide a provider that sets those up:
import { Global, ThemeProvider } from '@emotion/react'
import React from 'react'
import reset from 'emotion-reset';
<DocsApp
docs={...}
DesignSystemProvider={({ children }) => (
<ThemeProvider theme={...}>
<Global styles={reset} />
<Global styles={`
body {
font-family: 'sans-serif'
}
...
`} />
{children}
</ThemeProvider>
)}
...
/>
If you want to render the Codedocs UI yourself, within your own Design System, you may override any or all of its components. You can copy/paste the originals in /lib/components to get started and make sure you're following the same API:
<DocsApp
docs={...}
Columns={({ children }) => ...}
LeftColumn={({ children }) => ...}
MainColumn={({ children }) => ...}
NavList={({ children }) => ...}
NavHeading={({ children }) => ...}
NavItem={({ children }) => ...}
NavLink={({ children, to }) => ...}
PageHeading={({ children }) => ...}
DemoHeading={({ children }) => ...}
/>
For an example, check out Codedocs own docs in /docs. You can see these running at https://codedocs.ambic.app.
The general philosophy of Codedocs is
Things that will probably happen:
<Doc> block so you can lay out those pages explicitly<API> helper component for documenting component apisThings that might happen:
FAQs
[](https://codedocs.ambic.app/)
We found that codedocs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.