Looking Up Components
Problem
You need to discover which @vielzeug/refine web components are available and inspect their attributes, events, slots, and CSS properties to generate correct usage code.
Solution
Call refine-list-components to enumerate tags and descriptions, then refine-get-component with the desired tag to retrieve the full CEM declaration (attributes live only in that declaration, keeping the listing small). Use refine-generate-template and refine-validate-usage to close the generate → validate loop.
List available component tags
{ "name": "refine-list-components", "arguments": {} }Result excerpt:
[
{ "tagName": "ore-button", "description": "A clickable button element." },
{ "tagName": "ore-input", "description": "A text input field." },
{ "tagName": "ore-dialog", "description": "A modal dialog." }
]Read one component declaration
{ "name": "refine-get-component", "arguments": { "tagName": "ore-button" } }The result is the full CEM declaration including attributes, members, events, slots, cssParts, and cssProperties.
Generate a starting template, then validate it
{ "name": "refine-generate-template", "arguments": { "tagName": "ore-button", "scenario": "primary call-to-action" } }{
"name": "refine-validate-usage",
"arguments": { "tagName": "ore-button", "html": "<ore-button variant=\"primary\">Submit</ore-button>" }
}refine-validate-usage returns [] when the HTML is valid, or a list of { type, message } issues for unknown attributes or slots: catching hallucinated attribute names before they reach the DOM.
Pitfalls
- The
refine-*tools are only offered when the snapshot carries Refine component metadata.prepare:datarefuses to generate a snapshot without@vielzeug/refine'scustom-elements.json, so a missing set only happens with a hand-assembled snapshot. refine-get-componentmatches ontagNameexactly. Passing a class name like"Button"instead of"ore-button"returns an error.
Related
- Refine: the
@vielzeug/refinepackage - Tool reference