Use Coral Components
Build or update React, JSX, and TSX interfaces with Coral using the local mirrored docs in this skill. Start with references/catalog.md, then open the specific component or pattern pages under references/coral-docs/.
Workflow
- Read
references/catalog.mdfirst to confirm installation, section names, common entrypoints, and deprecated replacements. - Open the matching page under
references/coral-docs/before editing code so imports, composition, and API usage come from Coral docs instead of memory. - Copy the doc's import style and compound component structure exactly when a component is built from parts.
- Use Coral theme primitives when colors, spacing, typography, dark mode, or interaction states matter.
- Check
references/coral-docs/caveats.mdand the relevant component page before passing refs or replacing wrappers around interactive components. - Avoid deprecated components. If a mirrored page is deprecated, use the replacement listed in
references/catalog.md.
Import Rules
- Import components from
@seaweb/coral/components/<Component>. - Import icons from
@seaweb/coral/icons/<IconName>. - Import styled helpers from
@seaweb/coral/hoc/styledwhen theme autocomplete or Coral theme typing matters. - Import
ThemeProvider,darkTheme,palette, and related theme helpers from@seaweb/coral/components/ThemeProviderwhen theming or token overrides are involved.
Composition Rules
- Respect compound component structures from the docs. Examples:
Selectusually pairs withSelectButtonorSelectSearch, plusSelectListandSelectOption.TabsusesTabList,Tab,TabPanels, andTabPanel.Fieldwraps inputs and centralizes label, message, invalid, and required states.
- Preserve the documented child order and nesting for compound components. If the doc shows a part rendered inside another part, keep that structure.
- If a component needs DOM access, only pass refs through Coral components, DOM nodes, class components,
React.forwardRef,React.lazy, orReact.memocomponents. Seereferences/coral-docs/caveats.md. - When docs mention custom indexes or placement props for nested options or overlays, keep those explicit props instead of simplifying them away.
Styling And Accessibility
- Prefer Coral theme tokens such as
theme.colors,theme.spacing, andtheme.typographyover hard-coded values when extending Coral UI. - Use
ThemeProviderinstead of ad hoc dark mode branching when colors or overlay behavior need to adapt across light and dark backgrounds. - Use Coral typography components and semantic
asprops when heading structure matters. - Use
Field, validation props, and built-in message patterns instead of inventing parallel form-label or error wrappers. - Preserve keyboard and screen-reader behavior implied by the documented Coral structure.
Doc Navigation
- Start with
references/catalog.mdfor:- package setup
- section inventory
- deprecated replacements
- high-signal lookup guidance
- Use these mirrored docs as common entrypoints when the right component is unclear:
references/coral-docs/get-started.mdreferences/coral-docs/components.mdreferences/coral-docs/caveats.mdreferences/coral-docs/foundation/themeprovider.mdreferences/coral-docs/input/field.mdreferences/coral-docs/input/select.md
- Use the component-specific page under
references/coral-docs/for final prop names, examples, and composition details.
Maintenance
- Refresh the mirrored Coral docs with
python scripts/sync_coral_docs.py. - The default source is an auto-detected sibling Coral docs export folder containing
output/coral-developer-markdown. - After editing the skill, run the Codex validator from the
coral-skill/repo root:python "$CODEX_HOME/skills/.system/skill-creator/scripts/quick_validate.py" ./use-coral-components.