FormsQuotePicker
Searchastronomic.dev# QuotePicker
For a hero or a sidebar: tick the jobs you need and start a quote with them ticked. A plain form that works with no script.
Static: no JavaScript.
## Usage
```astro
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
```
## Examples
### Tick the jobs, start the quote
Four services as option chips and one button, in a Card. Sending it opens the action with each pick in the query (?service=deep-cleaning&service=move-in-move-out), where the quote form starts with them ticked. It posts to #quote here.
```astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { cleaning } from "../_data/groundcrew.ts";
const options = cleaning.services.slice(0, 4).map((s) => ({ value: s.slug, label: s.title }));
---
<!-- Tick a service or two, then send: the picks land on /quote?service=…&service=…, where the quote form starts with them ticked. -->
<Card class="mx-auto w-full max-w-md">
<QuotePicker heading="What do you need cleaned?" legend="Pick one or more" options={options} action="#quote" />
</Card>
```
### Over a hero photo
Inside Panel tone="image", the picker sits in a Card, so it keeps the page's colors and focus ring on any picture.
```astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { landscaping } from "../_data/groundcrew.ts";
// Your own photo file.
import yard from "../../photos/ranch-yard-after.webp";
const options = landscaping.services.slice(0, 4).map((s) => ({ value: s.slug, label: s.title }));
---
<!-- Over a hero photo the picker sits in a Card, so it keeps the page's colors and ring on any picture. -->
<Panel tone="image" aria-labelledby="qp-hero" contentClass="py-group">
<img slot="media" src={yard.src} width={yard.width} height={yard.height} alt="A brick ranch house with trimmed evergreens and a green lawn" class="size-full object-cover" />
<Container size="md" class="grid gap-blocks">
<h1 id="qp-hero" class="m-0 max-w-head text-title text-balance display-face">{landscaping.name}</h1>
<Card class="w-full max-w-md">
<QuotePicker heading="What should we start on?" legend="Pick one or more" options={options} action="#quote" />
</Card>
</Container>
</Panel>
```
### Six services in a sidebar
In a narrow column the chips wrap onto new lines and never scroll. headingTag="h3" and submitText set the heading level and the button's words.
```astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { construction } from "../_data/groundcrew.ts";
const options = construction.services.map((s) => ({ value: s.slug, label: s.title }));
---
<!-- Six services in a sidebar column: the chips wrap onto new lines and never scroll. -->
<Card class="mx-auto w-full max-w-xs">
<QuotePicker heading="Plan your project" headingTag="h3" legend="Pick one or more" options={options} action="#quote" submitText="Get my estimate" />
</Card>
```
### On the band
tone="band": the form takes the band's surface, edge and focus ring, and the button the band tone. A long submitText wraps onto more lines, here with an arrow in a tile (submitIconTile).
```astro
---
import ArrowRight from "@lucide/astro/icons/arrow-right";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { landscaping } from "../_data/groundcrew.ts";
const options = landscaping.services.slice(0, 4).map((s) => ({ value: s.slug, label: s.title }));
---
<!-- tone="band": the form takes the band's surface, edge and focus ring. A long button label wraps onto a second line in a narrow column. -->
<div class="mx-auto w-full max-w-sm">
<QuotePicker tone="band" heading="What should we start on?" legend="Pick one or more" options={options} action="#quote" submitText="Send my picks and book a free site visit" submitIconTile={ArrowRight} />
</div>
```
### With an emergency line
The note slot under the button: a line for a job that cannot wait, with the 24/7 number as a tel link.
```astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import { telHref } from "@astronomic-dev/ui/lib/phone.ts";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { plumbing } from "../_data/groundcrew.ts";
const options = plumbing.services.slice(0, 5).map((s) => ({ value: s.slug, label: s.title }));
const emergency = plumbing.emergency!;
---
<!-- The note slot under the button: an urgent job skips the form and calls the 24/7 line. -->
<Card class="mx-auto w-full max-w-md">
<QuotePicker heading="What needs fixing?" legend="Pick one or more" options={options} action="#quote">
<p slot="note" class="m-0 rounded-card bg-surface-2 px-3 py-2">
<strong class="block">Burst pipe or sewer backup?</strong>
Call the 24/7 line: <a href={telHref(emergency.phone)} class="inline-flex min-h-11 items-center font-semibold tabular-nums">{emergency.phone}</a>
</p>
</QuotePicker>
</Card>
```
## Props
### QuotePicker
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | Required. The heading ("What do you need done?"). It names the form. |
| `legend` | `string` | None | Required. The group's visible name, read before the options ("Pick one or more"). |
| `options` | `{ value: string; label: string }[]` | None | Required. The services. Each value is URL-safe text, such as a slug, and appears once: a duplicate throws at build. With none, nothing renders (and a warning shows in dev). |
| `action` | `string` | `"/quote"` | The page the picks go to: the quote page, or the contact page when the quote page is off. |
| `name` | `string` | `"service"` | The query name each pick is sent as. QuoteSteps reads service to tick the same services. |
| `headingTag` | `"h2" \| "h3"` | `"h2"` | The heading's level. |
| `submitText` | `string` | `"Start my quote"` | The button's words. |
| `submitIconTile` | `IconComponent` | None | An icon component (an arrow) in a tile at the button's end, as Button's iconTile. |
| `submitTileMotion` | `"turn" \| "slide"` | `"turn"` | How the tile's icon moves on hover and focus, as Button's tileMotion. |
| `tone` | `"page" \| "band"` | `"page"` | The surface it sits on: page (on the page, or in a Card over a photo) or band (the band's colors, with its own edge and padding; the button takes tone="band"). |
| `headingClass` | `string` | None | For recipes: more classes on the heading. |
| `chipsClass` | `string` | None | For recipes: more classes on the row of chips. |
| `actionClass` | `string` | None | For recipes: more classes on the box that holds the button and the note. |
| `class` | `string` | None | More classes on the form, merged with cn(), so yours win on conflicts. |
| Slot | Description |
| --- | --- |
| `note` | A short line under the button, such as an emergency number. |
Any other attribute goes on the <form>. method and action are the part's own.
## Accessibility
- A plain GET form named by its heading (aria-labelledby). It works the same with no script: nothing is added by JavaScript.
- The services are one fieldset with a visible legend. Each is a native checkbox inside its label, so a screen reader reads its name and state, and Space toggles it. The checkbox is visually hidden; the focus ring is drawn on the chip.
- A checked chip shows a check in its box as well as the accent fill, so the state is not color alone. Its text is in the accent's own text color.
- Each chip is at least 44px tall at every pointer, and the chips wrap onto new lines at any width.
QuotePicker
ProFor a hero or a sidebar: tick the jobs you need and start a quote with them ticked. A plain form that works with no script.
- File
- QuotePicker.astro
- Group
- Forms
- Kind
- Static: no JavaScript
- Examples
- 5
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Tick the jobs, start the quote
Four services as option chips and one button, in a Card. Sending it opens the action with each pick in the query (?service=deep-cleaning&service=move-in-move-out), where the quote form starts with them ticked. It posts to #quote here.
This preview did not load.
examples/quotepicker/main.astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { cleaning } from "../_data/groundcrew.ts";
const options = cleaning.services.slice(0, 4).map((s) => ({ value: s.slug, label: s.title }));
---
<!-- Tick a service or two, then send: the picks land on /quote?service=…&service=…, where the quote form starts with them ticked. -->
<Card class="mx-auto w-full max-w-md">
<QuotePicker heading="What do you need cleaned?" legend="Pick one or more" options={options} action="#quote" />
</Card>Over a hero photo
Inside Panel tone="image", the picker sits in a Card, so it keeps the page's colors and focus ring on any picture.
This preview did not load.
examples/quotepicker/on-photo.astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { landscaping } from "../_data/groundcrew.ts";
// Your own photo file.
import yard from "../../photos/ranch-yard-after.webp";
const options = landscaping.services.slice(0, 4).map((s) => ({ value: s.slug, label: s.title }));
---
<!-- Over a hero photo the picker sits in a Card, so it keeps the page's colors and ring on any picture. -->
<Panel tone="image" aria-labelledby="qp-hero" contentClass="py-group">
<img slot="media" src={yard.src} width={yard.width} height={yard.height} alt="A brick ranch house with trimmed evergreens and a green lawn" class="size-full object-cover" />
<Container size="md" class="grid gap-blocks">
<h1 id="qp-hero" class="m-0 max-w-head text-title text-balance display-face">{landscaping.name}</h1>
<Card class="w-full max-w-md">
<QuotePicker heading="What should we start on?" legend="Pick one or more" options={options} action="#quote" />
</Card>
</Container>
</Panel>Six services in a sidebar
In a narrow column the chips wrap onto new lines and never scroll. headingTag="h3" and submitText set the heading level and the button's words.
This preview did not load.
examples/quotepicker/many.astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { construction } from "../_data/groundcrew.ts";
const options = construction.services.map((s) => ({ value: s.slug, label: s.title }));
---
<!-- Six services in a sidebar column: the chips wrap onto new lines and never scroll. -->
<Card class="mx-auto w-full max-w-xs">
<QuotePicker heading="Plan your project" headingTag="h3" legend="Pick one or more" options={options} action="#quote" submitText="Get my estimate" />
</Card>On the band
tone="band": the form takes the band's surface, edge and focus ring, and the button the band tone. A long submitText wraps onto more lines, here with an arrow in a tile (submitIconTile).
This preview did not load.
examples/quotepicker/on-band.astro
---
import ArrowRight from "@lucide/astro/icons/arrow-right";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { landscaping } from "../_data/groundcrew.ts";
const options = landscaping.services.slice(0, 4).map((s) => ({ value: s.slug, label: s.title }));
---
<!-- tone="band": the form takes the band's surface, edge and focus ring. A long button label wraps onto a second line in a narrow column. -->
<div class="mx-auto w-full max-w-sm">
<QuotePicker tone="band" heading="What should we start on?" legend="Pick one or more" options={options} action="#quote" submitText="Send my picks and book a free site visit" submitIconTile={ArrowRight} />
</div>With an emergency line
The note slot under the button: a line for a job that cannot wait, with the 24/7 number as a tel link.
This preview did not load.
examples/quotepicker/with-note.astro
---
import Card from "@astronomic-dev/ui/components/Card.astro";
import { telHref } from "@astronomic-dev/ui/lib/phone.ts";
import QuotePicker from "@astronomic/ui-pro/components/QuotePicker.astro";
import { plumbing } from "../_data/groundcrew.ts";
const options = plumbing.services.slice(0, 5).map((s) => ({ value: s.slug, label: s.title }));
const emergency = plumbing.emergency!;
---
<!-- The note slot under the button: an urgent job skips the form and calls the 24/7 line. -->
<Card class="mx-auto w-full max-w-md">
<QuotePicker heading="What needs fixing?" legend="Pick one or more" options={options} action="#quote">
<p slot="note" class="m-0 rounded-card bg-surface-2 px-3 py-2">
<strong class="block">Burst pipe or sewer backup?</strong>
Call the 24/7 line: <a href={telHref(emergency.phone)} class="inline-flex min-h-11 items-center font-semibold tabular-nums">{emergency.phone}</a>
</p>
</QuotePicker>
</Card>