Skip to content
cccskills
FreePublished on GitHub

component-mdx

Use when writing or editing Storybook MDX docs (*.mdx) — the two-tab Overview/Implementation structure, story-backed `<Source>` examples, and doc table guidelines.

The English summary is being prepared. Showing the original description.

See how to install

Files included (2)

  • SKILL.md3.9 KB
  • references/tables.md1.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Documentation Guidelines

MDX Documentation Structure

Component documentation MUST use the two-tab structure with Overview and Implementation tabs.

Overview Tab

Intent: Provide designers and developers with a comprehensive understanding of the component's purpose, behavior, and usage patterns.

Include:

  • Introduction and Figma link
  • Anatomy with visual breakdown
  • Properties (appearance, size, states, etc.)
  • Responsive behavior
  • Accessibility considerations
  • Interactive examples

Implementation Tab

Intent: Give developers practical, copy-paste ready code examples and integration patterns.

Include:

  • Installation instructions (<SetupNote /> where applicable)
  • Code examples via <Source of={ComponentStories.StoryName} /> — not hand-written fenced code blocks when a matching story exists
  • Advanced patterns (icons, routing, custom styling) — prefer <Source> linked to the relevant story; use fenced blocks only when no story covers the snippet (e.g. one-off prop combinations)

Use <Source> for story-backed examples:

import { Meta, Canvas, Controls, Source } from '@storybook/addon-docs/blocks';
import * as ComponentStories from './Component.stories';

<Tab label='Implementation'>
  <SetupNote />

  ### Basic Usage

  <Source of={ComponentStories.Base} />

  ### With icon

  <Source of={ComponentStories.WithIcon} />
</Tab>
  • Pair each <Source> with a real story export.
  • Do not duplicate story code as manual ```tsx blocks in the Implementation tab.

See the component-stories skill for story setup (Base + args, naming conventions).

Required Structure

import { Meta, Canvas, Controls, Source } from '@storybook/addon-docs/blocks';
import * as ComponentStories from './Component.stories';
import { CustomTabs, Tab, SetupNote } from '../../../../.storybook/components';

<Meta title='Core/Component' of={ComponentStories} />

# Component Name

<CustomTabs>
  <Tab label='Overview'>
    ## Introduction
    <Canvas of={ComponentStories.Base} />
    <Controls of={ComponentStories.Base} />
  </Tab>

  <Tab label='Implementation'>
    <SetupNote />
    ### Basic Usage
    <Source of={ComponentStories.Base} />
    ### Advanced Patterns
    <Source of={ComponentStories.WithFeature} />
  </Tab>
</CustomTabs>
  • Every component page has <Controls of={ComponentStories.Base} /> in the Overview tab (under "Properties"), and Base must have args that its render applies, so the controls are live (see component-stories, "Controls"). Do not replace it with <ArgTypes />. Subcomponent tabs inside the Controls block always show "Setup controls"; that is expected.

Example: See Button.mdx in ui-react or ui-rnative for reference implementation.

Tables in docs

When a doc needs a table, use the copy-paste markup template in references/tables.md — it carries the container/header/body classnames and the design-system typography, colour, spacing and border tokens to use.

Review checks

Rules verifiable from a diff.

CheckApplies toDetectSkip
Doc doesn't use the two-tab Overview / Implementation structure.mdxmissing <Tab label='Overview'> / 'Implementation'RN charts under Components/visualization/ (no .mdx)
Implementation example is a hand-written ```tsx block where a story exists.mdxfenced code duplicating a story instead of <Source of={…} />snippets no story covers
Doc references a removed/renamed prop or a stale default.mdxprop names vs current types.ts—
Table uses raw Tailwind palette instead of tokens.mdxtext-gray-, arbitrary sizes in table markup—

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Creates and maintains Figma Code Connect files (`*.figma.tsx`) that map Figma components to code via the parser-based `figma.connect()` API. Use when the user mentions Code Connect, Figma component mapping, design-to-code translation, or asks to create/update .figma.tsx files.

The English summary is being prepared. Showing the original description.

LedgerHQ/lumen23Updated Oct 17, 2026

Use when creating, naming, or placing a file or folder in libs/*, or when modifying or adding a file to an existing component (even when the barrel isn't touched) — component vs utility naming, the one-responsibility-per-file layout, when a folder needs an `index.ts` barrel (public API only), and the required set of files a component needs per lib. Load this before scaffolding or restructuring a component so the layout matches the codebase.

The English summary is being prepared. Showing the original description.

LedgerHQ/lumen23Updated Oct 17, 2026

Use when designing or changing a component's public API, its composition, or its state model in libs/ui-react or libs/ui-rnative — layering (core vs internal vs primitives), BaseProps/Props splits, converting a component to compound / changing its composition with createSafeContext, controlled/uncontrolled state, prop-naming conventions, and cross-platform API parity. Load this before shaping a new component, changing its props, or refactoring its composition.

The English summary is being prepared. Showing the original description.

LedgerHQ/lumen23Updated Oct 17, 2026

Use when creating or editing Storybook stories (*.stories.tsx, React or React Native) — story layout, controls, and export naming conventions.

The English summary is being prepared. Showing the original description.

LedgerHQ/lumen23Updated Oct 17, 2026

Use when building or styling a component in libs/ui-react or libs/ui-rnative — the cross-platform styling principles, plus routing to the platform mechanics: Tailwind + cva + cn on web, useStyleSheet + themeJS + lx on React Native. Load this before writing component styles.

The English summary is being prepared. Showing the original description.

LedgerHQ/lumen23Updated Oct 17, 2026

Use when writing or editing component tests in libs/ui-react or libs/ui-rnative — shared structure and coverage conventions, plus the per-platform runner: Vitest + React Testing Library on web, Jest + React Native Testing Library on RN. Load this before writing tests.

The English summary is being prepared. Showing the original description.

LedgerHQ/lumen23Updated Oct 17, 2026

See all skills by LedgerHQ

Report a problem with this skill