Skip to content
RoxyAPI
Get API Key

Helper

Endpoint form

Schema-driven form, emits roxy-submit

<roxy-endpoint-form>

Preview and code

Loading the component...

Attributes

AttributeTypeDescription
data-endpointstringEndpoint path the form is built for and submits to, e.g. "astrology/natal-chart". The fields are derived from the spec for that operation.
method'GET' | 'POST'HTTP method of the operation. Defaults to POST.
spec-urlstringExplicit OpenAPI spec URL to build the form from. Empty resolves a version-pinned slice first, then the production spec.
submit-labelstringOverride the submit-button label. Empty derives an outcome-first label from the endpoint.
publishable-keystringBrowser-safe publishable key (pk_) forwarded to the slotted city search so a natal or synastry form can geocode.
location-urlstringWhere the slotted city search sends its request, absolute or page-relative. Set it when the page routes its API traffic through its own server. Unset, the search keeps its own default.

Sections you can hide

Pass any of these to hide-sections, or style them with ::part().

advancedfieldfield-errorgroupsubmittitlevalidation-error

Events

Each event bubbles out of the component, so listen on the element or any ancestor.

EventDescription
roxy-location-selectProvides the selected city with its coordinates and timezone.
roxy-spec-errorReports a failure to load the form schema, including the spec URL and error message.
roxy-submitProvides validated form values, the endpoint, query fields, and whether the form stays visible.
roxy-validation-errorReports missing required inputs or a refused client-side API key.