NavigationCallBar
Searchastronomic.dev# CallBar
On phones, a bar at the bottom with Call and Get a quote, which never covers the page's own content.
Interactive: inline script.
## Usage
```astro
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
```
## Examples
### At the bottom on phones
Brassfield Plumbing: Call now (with a phone tile) and Get a quote. Below the md fold point the bar is fixed at the bottom, and the page gets its real height as bottom space and scroll padding, so the jumps, the footer's last line and a fixed notice with bottom-callbar all sit above it. Set the frame to 390 and scroll inside it. From 768px up it is gone.
```astro
---
import Phone from "@lucide/astro/icons/phone";
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
import { plumbing } from "../_data/groundcrew.ts";
const sections = ["Drain cleaning", "Water heaters", "Leak repair", "Sump pumps", "Sewer lines"];
const slug = (s: string) => s.toLowerCase().replaceAll(" ", "-");
---
<!-- Set the frame to 390 and scroll it: the bar stays at the bottom, and the footer's last line and the notice sit above it. -->
<div>
<div class="mx-auto grid max-w-prose gap-6 px-6 py-12">
<h2 class="m-0 font-display text-title text-balance">{plumbing.name}</h2>
<p class="m-0 text-pretty text-muted">Plumbers in {plumbing.town}, {plumbing.state}. Each service below links to itself, so a jump lands clear of the bar.</p>
<nav aria-label="Services" class="flex flex-wrap gap-x-4 gap-y-2">
{sections.map((s) => <a href={`#${slug(s)}`} class="text-fg">{s}</a>)}
</nav>
{
sections.map((s) => (
<section id={slug(s)} class="grid min-h-48 content-end rounded-card bg-surface-2 p-6">
<h3 class="m-0 text-subhead">{s}</h3>
</section>
))
}
</div>
<footer class="border-t-ui border-solid border-border px-6 py-8 text-muted">
<p class="m-0">© 2026 {plumbing.name}. {plumbing.credentials[0].value}.</p>
</footer>
<div class="fixed inset-x-4 bottom-callbar z-20 mb-4 rounded-card border-ui border-solid border-border bg-surface p-4 shadow-card">
<p class="m-0 text-pretty">A fixed notice with bottom-callbar sits above the bar, never under it.</p>
</div>
<CallBar phone={plumbing.phone} quoteHref="#quote" callIcon={Phone} />
</div>
```
### With a Navbar that folds at lg
collapse="lg", the same as the page's Navbar: the bar shows up to 1024px. Set the frame to 900 to see it.
```astro
---
import Phone from "@lucide/astro/icons/phone";
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
import { construction } from "../_data/groundcrew.ts";
const services = construction.services.map((s) => s.title);
---
<!-- collapse="lg", as a Navbar with more links: the bar shows up to 1024px. Set the frame to 900 to see it. -->
<div>
<div class="mx-auto grid max-w-prose gap-6 px-6 py-12">
<h2 class="m-0 font-display text-title text-balance">{construction.name}</h2>
<p class="m-0 text-pretty text-muted">Remodels and additions in {construction.town}, {construction.state}.</p>
{
services.map((s) => (
<div class="grid min-h-40 content-end rounded-card bg-surface-2 p-6">
<p class="m-0 font-semibold">{s}</p>
</div>
))
}
</div>
<footer class="border-t-ui border-solid border-border px-6 py-8 text-muted">
<p class="m-0">© 2026 {construction.name}. {construction.credentials[0].value}.</p>
</footer>
<CallBar phone={construction.phone} quoteHref="#estimate" quoteText="Free estimate" callIcon={Phone} collapse="lg" />
</div>
```
### Long labels
Labels wrap and balance inside each button (at least 52px tall); the bar grows, and the page's bottom room grows with it, measured, never guessed. The same holds at 200% text size.
```astro
---
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
import { cleaning } from "../_data/groundcrew.ts";
const rooms = ["Kitchens", "Bathrooms", "Bedrooms", "Living rooms", "Move-out cleans"];
---
<!-- Long labels wrap inside each button, and the page's bottom room grows to the bar's real height. -->
<div>
<div class="mx-auto grid max-w-prose gap-6 px-6 py-12">
<h2 class="m-0 font-display text-title text-balance">{cleaning.name}</h2>
<p class="m-0 text-pretty text-muted">House cleaning in {cleaning.town}, {cleaning.state}.</p>
{
rooms.map((r) => (
<div class="grid min-h-40 content-end rounded-card bg-surface-2 p-6">
<p class="m-0 font-semibold">{r}</p>
</div>
))
}
</div>
<footer class="border-t-ui border-solid border-border px-6 py-8 text-muted">
<p class="m-0">© 2026 {cleaning.name}. Bonded and insured.</p>
</footer>
<CallBar
phone={cleaning.phone}
quoteHref="#quote"
label="Call or book a cleaning"
callText="Talk to our scheduling team"
quoteText="Get a price for your home in two minutes"
/>
</div>
```
## Props
### CallBar
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `phone` | `string` | None | Required. The number as you write it ("(614) 555-0147"); the call link is its tel: form. One with no number to call throws at build. |
| `quoteHref` | `string` | None | Required. The quote page, or the contact page when the quote page is off. |
| `label` | `string` | `"Call or get a quote"` | The region's name. |
| `callText` | `string` | `"Call now"` | The call button's words. Its accessible name adds the number ("Call now: (614) 555-0147"). |
| `quoteText` | `string` | `"Get a quote"` | The quote button's words. |
| `callIcon` | `IconComponent` | None | An icon for the call button's tile, such as Lucide's phone. |
| `collapse` | `"md" \| "lg"` | `"md"` | The fold point, the same as the page's Navbar: the bar shows below it. |
| `callClass` | `string` | None | For recipes: more classes on the call button. |
| `quoteClass` | `string` | None | For recipes: more classes on the quote button. |
| `class` | `string` | None | More classes on the bar, merged with cn(), so yours win on conflicts. |
Any other attribute goes on the bar's <div>. Put one bar per page, at its end. bottom-callbar (a utility) puts any other fixed box's bottom above the bar.
## Accessibility
| Key | Action |
| --- | --- |
| Tab | Moves to Call, then to Get a quote |
- A region named by its label, with two plain links: tel: to call and the quote page. Each is at least 52px tall at every pointer, and its label wraps rather than overflow.
- With no script the bar is a plain block in the page's flow, at its end, so nothing can sit under it. The script fixes it only after it has measured the bar and given the page that room, so anchors, focused fields, error lines and the footer are never covered, at any text size.
- While a text field has focus the bar slides away and is inert (out of the tab order and of the accessibility tree); it comes back when focus leaves the fields. The slide is skipped with reduced motion.
- It keeps clear of the home indicator and side notches (the safe-area insets).
- While the bar is live the body's bottom padding is the bar's room plus --body-pad-end (default 0). A theme that gives its body bottom padding of its own sets the same value in --body-pad-end, so the bar adds to it rather than replacing it.
CallBar
ProOn phones, a bar at the bottom with Call and Get a quote, which never covers the page's own content.
- File
- CallBar.astro
- Group
- Navigation
- Kind
- Interactive: inline script
- Examples
- 3
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
At the bottom on phones
Brassfield Plumbing: Call now (with a phone tile) and Get a quote. Below the md fold point the bar is fixed at the bottom, and the page gets its real height as bottom space and scroll padding, so the jumps, the footer's last line and a fixed notice with bottom-callbar all sit above it. Set the frame to 390 and scroll inside it. From 768px up it is gone.
This preview did not load.
examples/callbar/main.astro
---
import Phone from "@lucide/astro/icons/phone";
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
import { plumbing } from "../_data/groundcrew.ts";
const sections = ["Drain cleaning", "Water heaters", "Leak repair", "Sump pumps", "Sewer lines"];
const slug = (s: string) => s.toLowerCase().replaceAll(" ", "-");
---
<!-- Set the frame to 390 and scroll it: the bar stays at the bottom, and the footer's last line and the notice sit above it. -->
<div>
<div class="mx-auto grid max-w-prose gap-6 px-6 py-12">
<h2 class="m-0 font-display text-title text-balance">{plumbing.name}</h2>
<p class="m-0 text-pretty text-muted">Plumbers in {plumbing.town}, {plumbing.state}. Each service below links to itself, so a jump lands clear of the bar.</p>
<nav aria-label="Services" class="flex flex-wrap gap-x-4 gap-y-2">
{sections.map((s) => <a href={`#${slug(s)}`} class="text-fg">{s}</a>)}
</nav>
{
sections.map((s) => (
<section id={slug(s)} class="grid min-h-48 content-end rounded-card bg-surface-2 p-6">
<h3 class="m-0 text-subhead">{s}</h3>
</section>
))
}
</div>
<footer class="border-t-ui border-solid border-border px-6 py-8 text-muted">
<p class="m-0">© 2026 {plumbing.name}. {plumbing.credentials[0].value}.</p>
</footer>
<div class="fixed inset-x-4 bottom-callbar z-20 mb-4 rounded-card border-ui border-solid border-border bg-surface p-4 shadow-card">
<p class="m-0 text-pretty">A fixed notice with bottom-callbar sits above the bar, never under it.</p>
</div>
<CallBar phone={plumbing.phone} quoteHref="#quote" callIcon={Phone} />
</div>With a Navbar that folds at lg
collapse="lg", the same as the page's Navbar: the bar shows up to 1024px. Set the frame to 900 to see it.
This preview did not load.
examples/callbar/lg-fold.astro
---
import Phone from "@lucide/astro/icons/phone";
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
import { construction } from "../_data/groundcrew.ts";
const services = construction.services.map((s) => s.title);
---
<!-- collapse="lg", as a Navbar with more links: the bar shows up to 1024px. Set the frame to 900 to see it. -->
<div>
<div class="mx-auto grid max-w-prose gap-6 px-6 py-12">
<h2 class="m-0 font-display text-title text-balance">{construction.name}</h2>
<p class="m-0 text-pretty text-muted">Remodels and additions in {construction.town}, {construction.state}.</p>
{
services.map((s) => (
<div class="grid min-h-40 content-end rounded-card bg-surface-2 p-6">
<p class="m-0 font-semibold">{s}</p>
</div>
))
}
</div>
<footer class="border-t-ui border-solid border-border px-6 py-8 text-muted">
<p class="m-0">© 2026 {construction.name}. {construction.credentials[0].value}.</p>
</footer>
<CallBar phone={construction.phone} quoteHref="#estimate" quoteText="Free estimate" callIcon={Phone} collapse="lg" />
</div>Long labels
Labels wrap and balance inside each button (at least 52px tall); the bar grows, and the page's bottom room grows with it, measured, never guessed. The same holds at 200% text size.
This preview did not load.
examples/callbar/long-labels.astro
---
import CallBar from "@astronomic/ui-pro/components/CallBar.astro";
import { cleaning } from "../_data/groundcrew.ts";
const rooms = ["Kitchens", "Bathrooms", "Bedrooms", "Living rooms", "Move-out cleans"];
---
<!-- Long labels wrap inside each button, and the page's bottom room grows to the bar's real height. -->
<div>
<div class="mx-auto grid max-w-prose gap-6 px-6 py-12">
<h2 class="m-0 font-display text-title text-balance">{cleaning.name}</h2>
<p class="m-0 text-pretty text-muted">House cleaning in {cleaning.town}, {cleaning.state}.</p>
{
rooms.map((r) => (
<div class="grid min-h-40 content-end rounded-card bg-surface-2 p-6">
<p class="m-0 font-semibold">{r}</p>
</div>
))
}
</div>
<footer class="border-t-ui border-solid border-border px-6 py-8 text-muted">
<p class="m-0">© 2026 {cleaning.name}. Bonded and insured.</p>
</footer>
<CallBar
phone={cleaning.phone}
quoteHref="#quote"
label="Call or book a cleaning"
callText="Talk to our scheduling team"
quoteText="Get a price for your home in two minutes"
/>
</div>