← All Learning Paths

Component Design Specialist

Design components that age well: custom elements, shadow DOM isolation, event delegation, accessible composition with slots, and dialogs that return focus.

technicalbeginner10 nodes12.5h total

Path overview

好组件的检验标准是三年后还有人敢改。本路径从自定义元素与 Shadow DOM 的隔离模型讲起,经事件委托与插槽组合,覆盖从零构建设计系统的决策文章,收尾于焦点归还与实时播报等可访问性细节及 Notion 编辑器案例。

The test of a good component is whether someone dares to change it three years later. This path covers custom elements, shadow DOM, delegation, slots, focus return, and an editor case study.

  1. Compare "Design Tokens: The Single Source of Truth" with "Theming: Light, Dark, and Brand" in "Building a Design System from Scratch" and state which trade-off you would accept in components code.

    Completion criteria: Write a five-line decision note citing "Design Tokens: The Single Source of Truth" from "Building a Design System from Scratch", name the option you rejected, and attach the before/after diff of one file you changed.

    Next step: Building Accessible Web Components

    ⏱ 1h

  2. Reconstruct the reasoning behind "Building Accessible Web Components" by tracing "Keyboard Navigation: Every Interaction Operable Without a Mouse" to the failure it prevents in components systems.

    Prerequisites: Building a Design System from Scratch

    Completion criteria: Attach a one-page summary that quotes "Keyboard Navigation: Every Interaction Operable Without a Mouse", lists two trade-offs, and links the commit where you applied it.

    Next step: Custom Elements API

    ⏱ 1h

  3. Run the components snippet "Custom Elements API", capture stdout, and show which line demonstrates the documented behavior: "the CustomCounter entry point".

    Prerequisites: Building Accessible Web Components

    Completion criteria: Attach the terminal transcript for "Custom Elements API": command, exit code, and the printed result you used to confirm "the CustomCounter entry point".

    Next step: Slots for Web Component Composition

    ⏱ 0.75h

  4. Adapt "Slots for Web Component Composition" to a second input and compare the new output with the behavior described in "the CustomCard entry point".

    Prerequisites: Custom Elements API

    Completion criteria: Change one constant in "Slots for Web Component Composition", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Custom Elements API Practice

    ⏱ 0.75h

  5. Complete "Custom Elements API" by making Reusable custom component produce component rendered without hard-coding the sample.

    Prerequisites: Slots for Web Component Composition

    Completion criteria: Submit a solution that passes both samples (Reusable custom component to component rendered) and attach the failing case you fixed.

    Next step: Resolve Delegated Click Actions from an Event Path

    ⏱ 0.5h

  6. Solve "Resolve Delegated Click Actions from an Event Path": turn A JSON string with action and id keys, or null when no match exists. into {action:delete,id:42} and pass the provided samples.

    Prerequisites: Custom Elements API Practice

    Completion criteria: Attach the solution file, two passing sample runs, and one failing run whose error matches the contract for "{action:delete,id:42}".

    Next step: Track Focus Return Targets for Nested Dialogs

    ⏱ 0.5h

  7. Implement "Track Focus Return Targets for Nested Dialogs" so that A JSON string with the remaining stack and lastFocused keys. yields {stack:[menu-button],lastFocused:search-button}, including the edge case in the second sample.

    Prerequisites: Resolve Delegated Click Actions from an Event Path

    Completion criteria: Show a test command that validates "A JSON string with the remaining stack and lastFocused keys." and "{stack:[menu-button],lastFocused:search-button}" and passes after your fix.

    Next step: Build Polite Search Status Messages

    ⏱ 0.5h

  8. Complete "Build Polite Search Status Messages" by making The announcement string, with counts formatted for en-US. produce No results for grid without hard-coding the sample.

    Prerequisites: Track Focus Return Targets for Nested Dialogs

    Completion criteria: Submit a solution that passes both samples (The announcement string, with counts formatted for en-US. to No results for grid) and attach the failing case you fixed.

    Next step: Notion React Editor Architecture

    ⏱ 0.5h

  9. Map "Notion React Editor Architecture"'s React, TypeScript, prosemirror, yjs components to responsibilities and name one trade-off from "Block-based document model".

    Prerequisites: Build Polite Search Status Messages

    Completion criteria: List each React, TypeScript, prosemirror, yjs component of "Notion React Editor Architecture", its responsibility, and one trade-off, citing "Block-based document model".

    Next step: Capstone: Component Design Specialist

    ⏱ 1.5h

  10. Build "Build a Text Template Rendering Library" through its phases, keeping "Interpolate variables with a compile step that parses the template once." independently testable.

    Prerequisites: Notion React Editor Architecture

    Completion criteria: Run the project's test command for "Build a Text Template Rendering Library", paste the passing output, and attach the acceptance note for "Interpolate variables with a compile step that parses the template once." with the test name.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h