SoybeanUI Component Development
Quick start
- Classify the task before editing:
- component pattern: multi-slot base, compact aggregation, or single-class
- scenario: new component, migration or normalization, or standards alignment
- delivery scope: headless only, UI only, or full surface
- Read the source of truth for the touched slice:
- always start from
.github/copilot-instructions.md - then load
soybean-ui-component-overview.instructions.md - add headless, ui-layer, accessibility-rtl, playground, docs, or testing instructions only when the task touches those surfaces
- always start from
- Reuse before adding anything new:
headless/src/composables/headless/src/shared/headless/src/types/@vueuse/coreif the repository has no suitable composable
Example: "migrate a compound widget into SoybeanUI" usually means migration scenario + multi-slot or compact pattern + full delivery surface.
Workflows
New or migrated component
- Build headless first:
types.tscontext.ts- base slot SFCs
- optional
{Name}Compact index.ts
- Build UI second:
variants.tstypes.ts- wrapper
.vue index.ts
- Complete exports and generated surfaces:
- update
headless/src/index.tsandsrc/index.ts - run
pnpm sui headless - run
pnpm sui ui
- update
- Complete delivery surfaces unless the user explicitly narrows scope:
playground/examples/{component}/docs/src/docs/en/components/{component}.mddocs/src/docs/zh-CN/components/{component}.mddocs/src/constants/menus.tstest/specs/components/{component}.spec.ts- run
pnpm sui apiand locale translation when public API changes
Existing component fix or extension
- Decide whether the change belongs to headless logic or UI wrapping.
- Preserve the boundary:
- no styles in headless
- no ARIA,
role,tabindex, or keyboard semantics in UI - no reverse dependency from
headlesstosrc
- Check whether playground, docs, tests, exports, or generated API data must move with the change.
- If a new composable, helper, or type is introduced, explain why existing repository utilities and
@vueuse/corewere insufficient.
Guardrails
- Headless owns logic, state, accessibility, structure, and compact aggregation.
- UI owns variants, UnoCSS classes,
uiinjection, and wrapper composition. - Do not hand-edit generated files; update source exports and rerun scripts.
- Use
soybean-ui-checklist.instructions.mdonly after implementation is complete.
Advanced features
See REFERENCE.md for phase details, instruction mapping, and repository-specific delivery rules.
Source: soybeanjs/soybean-ui — distributed by TomeVault.