react component documentation

Design Community

Skill notes

Step 0: Gather Editorial Content

Before writing, collect the information that makes documentation useful beyond mechanical structure. Ask the user these questions — or, if they aren't available, search existing usages in the codebase (Grep for the component name across static/app/views/) to infer answers. Question · Where it surfaces in the docs When should a developer reach for this component? · Introduction or a ## When to use section

Prop triage

Not every prop needs a demo section. Ask the user: "Which props should I document, and are there any variants or values with specific intended uses?" If the user isn't available, read the component's TypeScript props and classify each: Tier · Document how · Examples Core — defines the component's primary behavior or appearance · Full ## section with live demo and semantic description of each value · priority, variant, size

Step 1: Locate the Component

Find the component source file: Read the component file to understand: Props and their types Exported named variants and sub-components (e.g., Component.SubComponent, export {TabList, TabPanels}) Available values for enum/union props

Step 2: Determine Frontmatter

Category values: Category · Components buttons · Button, ButtonBar, LinkButton forms · Input, Select, Checkbox, Radio, Slider, Switch navigation · Tabs, SegmentedControl, Disclosure

Step 3: Write Imports

Follow this import order exactly: Omit any group that isn't needed. For product components (not in @sentry/scraps), omit the type-loader lines and document props manually in a table (see Step 5). Complex export: If the component exports need filtering (e.g., to hide internal exports), use the explicit form instead of export {documentation}:

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Design
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@getsentry · no license declared
Token usage
Lean
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

Output preview react-component-documentation.preview
# Complete Example

---
title: Alert
description: Alerts provide contextual feedback messages with different severity levels.
category: status
source: '@sentry/scraps/alert'
resources:
  js: https://github.com/getsentry/sentry/blob/master/static/app/components/core/alert/index.tsx
  a11y:
    WCAG 1.4.3: https://www.w3.org/TR/WCAG22/#contrast-minimum
    WCAG 2.1.1: https://www.w3.org/TR/WCAG22/#keyboard
    WAI-ARIA Alert Pattern: https://www.w3.org/WAI/ARIA/apg/patterns/alert/
---

import {Alert} from '@sentry/scraps/alert';

import * as Storybook from 'sentry/stories';

import documentation from '!!type-loader!@sentry/scraps/alert';

export {documentation};

To create a basic alert, wrap a message in `<Alert>` and specify the appropriate type.

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.