Marketing sectionsEmergencyBanner
Searchastronomic.dev# EmergencyBanner
For a 24/7 line: a band with the number large, the arrival time and a call button.
Static: no JavaScript.
## Usage
```astro
import EmergencyBanner from "@astronomic-dev/ui/components/EmergencyBanner.astro";
```
## Examples
### Slots
The eyebrow, the heading and the line at the start, and the phone card at the end: the arrival window with your clock icon, the number large and the call button. Two columns from a 56rem banner.
```astro
---
import Badge from "@astronomic-dev/ui/components/Badge.astro";
import EmergencyBanner from "@astronomic-dev/ui/components/EmergencyBanner.astro";
import Clock from "@lucide/astro/icons/clock";
import Phone from "@lucide/astro/icons/phone";
import { plumbing } from "../_data/groundcrew.ts";
const line = plumbing.emergency ?? { label: "Emergency line", phone: plumbing.phone, arrival: "", text: "" };
---
<!-- Brassfield Plumbing & Drain's after-hours line. -->
<EmergencyBanner heading="Water where it should not be?" text={line.text} phone={line.phone} arrivalText={line.arrival} icon={Clock} callIcon={Phone}>
<Badge slot="eyebrow">{line.label}</Badge>
</EmergencyBanner>
```
### With no arrival window
Without arrivalText the card holds the number and the call button only.
```astro
---
import EmergencyBanner from "@astronomic-dev/ui/components/EmergencyBanner.astro";
import Phone from "@lucide/astro/icons/phone";
---
<!-- No arrival window: the card holds the number and the call button only. -->
<EmergencyBanner
heading="Furnace out on a cold night?"
text="Call the after-hours line. A technician calls you back to talk it through before driving out."
phone="(614) 555-0119"
callText="Call the after-hours line"
callIcon={Phone}
/>
```
## Props
### EmergencyBanner
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `heading` | `string` | None | Required. The heading, in the title role in display type. |
| `text` | `string` | None | One or two sentences under the heading: what to do first, and who answers. |
| `phone` | `string` | None | Required. The number as the page shows it, such as "(614) 555-0119". The number and the button call it (a tel: link). A value with no number in it shows as text, with no link and no button. |
| `arrivalText` | `string` | None | The arrival window, such as "Most calls: on site in 60 to 90 minutes". Without it the line is left out. |
| `callText` | `string` | `"Call the emergency line"` | The call button's words. |
| `icon` | `IconComponent` | None | Your clock icon, before the arrival line. Decoration. |
| `callIcon` | `IconComponent` | None | Your phone icon, in a tile at the end of the call button. Decoration. |
| `headingTag` | `"h2" \| "h3" \| "h4"` | `"h2"` | The heading element. |
| `class` | `string` | None | More classes for the <section>, merged with cn(), so yours win on conflicts. |
| Slot | Description |
| --- | --- |
| `eyebrow` | A short line above the heading, such as a Badge with "24/7 emergency line". |
Any other attribute goes on the <section>.
## Accessibility
- Renders a <section> named by its heading, so it is a region landmark.
- The number is a link of at least 44px that calls it, named "Call (614) 555-0119", in tabular figures.
- On the accent, text and the focus ring are the accent's own text color; on the phone card they are the accent. Each pair is checked in every preset.
- The clock and phone icons are decoration, hidden from a screen reader.
EmergencyBanner
FreeFor a 24/7 line: a band with the number large, the arrival time and a call button.
- File
- EmergencyBanner.astro
- Group
- Marketing sections
- Kind
- Static: no JavaScript
- Examples
- 2
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Slots
The eyebrow, the heading and the line at the start, and the phone card at the end: the arrival window with your clock icon, the number large and the call button. Two columns from a 56rem banner.
With no arrival window
Without arrivalText the card holds the number and the call button only.
Minimal · Light