FormsQuoteStep
Searchastronomic.dev# QuoteStep
For one step of a QuoteSteps form: a group of fields named by its heading. QuoteSteps shows one at a time.
Static: no JavaScript.
## Usage
```astro
import QuoteStep from "@astronomic/ui-pro/components/QuoteStep.astro";
```
## Examples
### In a QuoteSteps form
Two steps, each a fieldset named by its heading, here at h3 for a page whose section heading is an h2. QuoteSteps shows them one at a time; you only need QuoteStep inside it.
```astro
---
import Field from "@astronomic-dev/ui/components/Field.astro";
import Form from "@astronomic-dev/ui/components/Form.astro";
import Input from "@astronomic-dev/ui/components/Input.astro";
import QuoteStep from "@astronomic/ui-pro/components/QuoteStep.astro";
import QuoteSteps from "@astronomic/ui-pro/components/QuoteSteps.astro";
---
<!-- Two steps in a QuoteSteps: each a fieldset named by its heading. -->
<Form class="mx-auto w-full max-w-lg" action="#" submitLabel="Send">
<QuoteSteps>
<QuoteStep title="Where" text="The address of the job." headingTag="h3">
<Field label="ZIP code" for="qs-part-zip" required>
<Input id="qs-part-zip" name="zip" inputmode="numeric" autocomplete="postal-code" required class="max-w-40 tabular-nums" />
</Field>
</QuoteStep>
<QuoteStep title="Who" headingTag="h3">
<Field label="Email" for="qs-part-email" required>
<Input id="qs-part-email" name="email" type="email" autocomplete="email" required />
</Field>
</QuoteStep>
</QuoteSteps>
</Form>
```
## Props
### QuoteStep
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `title` | `string` | None | Required. The step's name: its heading, in the legend, and the progress line's {title}. An empty title throws at build. |
| `text` | `string` | None | A line under the heading, muted. |
| `headingTag` | `"h2" \| "h3"` | `"h2"` | The heading's level inside the legend, for the page outline. |
| `class` | `string` | None | More classes on the <fieldset>, merged with cn(), so yours win on conflicts. |
| Slot | Description |
| --- | --- |
| `default` | The step's fields. |
Any other attribute goes on the <fieldset>.
## Accessibility
- A native fieldset whose legend holds the heading, so its fields are grouped and named by the step. It is never disabled.
- The heading takes tabindex="-1": QuoteSteps moves focus to it on Next and Back. Tab never stops there.
QuoteStep
ProFor one step of a QuoteSteps form: a group of fields named by its heading. QuoteSteps shows one at a time.
- File
- QuoteStep.astro
- Group
- Forms
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
In a QuoteSteps form
Two steps, each a fieldset named by its heading, here at h3 for a page whose section heading is an h2. QuoteSteps shows them one at a time; you only need QuoteStep inside it.
This preview did not load.
main.astro
examples/quotestep/main.astro
---
import Field from "@astronomic-dev/ui/components/Field.astro";
import Form from "@astronomic-dev/ui/components/Form.astro";
import Input from "@astronomic-dev/ui/components/Input.astro";
import QuoteStep from "@astronomic/ui-pro/components/QuoteStep.astro";
import QuoteSteps from "@astronomic/ui-pro/components/QuoteSteps.astro";
---
<!-- Two steps in a QuoteSteps: each a fieldset named by its heading. -->
<Form class="mx-auto w-full max-w-lg" action="#" submitLabel="Send">
<QuoteSteps>
<QuoteStep title="Where" text="The address of the job." headingTag="h3">
<Field label="ZIP code" for="qs-part-zip" required>
<Input id="qs-part-zip" name="zip" inputmode="numeric" autocomplete="postal-code" required class="max-w-40 tabular-nums" />
</Field>
</QuoteStep>
<QuoteStep title="Who" headingTag="h3">
<Field label="Email" for="qs-part-email" required>
<Input id="qs-part-email" name="email" type="email" autocomplete="email" required />
</Field>
</QuoteStep>
</QuoteSteps>
</Form>Minimal · Light