LayoutPanel
Searchastronomic.dev# Panel
To set a block of the page apart: an inset, rounded panel on a light fill, a dark fill, or a photo.
Static: no JavaScript.
## Usage
```astro
import Panel from "@astronomic-dev/ui/components/Panel.astro";
```
## Examples
### A light panel
An inset, rounded box on the light page fill, around a Section: the section space above and below, the panel inset at the sides and below.
```astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
---
<Panel aria-labelledby="panel-studio">
<Container size="md">
<SectionHead id="panel-studio" heading="The studio" text="Nine people in a former print shop. We take on eight to ten projects a year, so the people you meet are the ones who make the work." />
<div class="mt-blocks"><Button variant="secondary" href="#studio">Meet the studio</Button></div>
</Container>
</Panel>
```
### A dark panel
tone="inverse": dark on a light page, light on a dark page. Text on it names the inverse colors (text-on-inverse, text-on-inverse-muted), Buttons take tone="inverse", and the focus ring follows.
```astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
---
<!-- Dark on a light page, light on a dark page. Text names the inverse colors; Buttons take tone="inverse". -->
<Panel tone="inverse" aria-labelledby="panel-services">
<Container size="md">
<SectionHead id="panel-services" heading="Services" text="Brand identity, websites, motion and design systems, by the same small team." headingClass="text-on-inverse" leadClass="text-on-inverse-muted" />
<div class="mt-blocks flex flex-wrap gap-3">
<Button tone="inverse" href="#start">Start a project</Button>
<Button tone="inverse" variant="secondary" href="#services">See the services</Button>
</div>
</Container>
</Panel>
```
### A photo panel
tone="image": your photo in the media slot, under the text and the scrim. Dark in both modes; Buttons take tone="image".
```astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
// Your own image file.
import shelves from "../../photos/studio-shelves.webp";
---
<!-- A photo panel: dark in both modes. The photo goes in the media slot, under the text and its scrim. -->
<Panel tone="image" aria-labelledby="panel-reel" contentClass="pt-group">
<img slot="media" src={shelves.src} width={shelves.width} height={shelves.height} alt="Shelves of books, folders and plants in the studio" class="size-full object-cover" />
<Container size="md">
<h2 id="panel-reel" class="m-0 text-title display-face">Our 2026 reel</h2>
<p class="m-0 mt-item max-w-lead text-lead">Ninety seconds of the year's work, from identity to launch.</p>
<div class="mt-blocks"><Button tone="image" href="#reel">Watch the reel</Button></div>
</Container>
</Panel>
```
### Panels in a row
Each panel keeps the section space above and below, so two in a row never lose their top padding.
```astro
---
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
---
<!-- Panels one after another: each keeps the section space above and below, and the inset between them. -->
<div>
<Panel aria-labelledby="panel-a">
<Container size="md"><SectionHead id="panel-a" heading="Work" text="Selected projects from the last two years." /></Container>
</Panel>
<Panel tone="inverse" aria-labelledby="panel-b">
<Container size="md"><SectionHead id="panel-b" heading="Services" text="Five things, done by the same small team." headingClass="text-on-inverse" leadClass="text-on-inverse-muted" /></Container>
</Panel>
<Panel aria-labelledby="panel-c">
<Container size="md"><SectionHead id="panel-c" heading="Recognition" text="Clients since 2014, and a few awards." /></Container>
</Panel>
</div>
```
## Props
### Panel
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `tone` | `"surface" \| "inverse" \| "image"` | `"surface"` | surface: the light page fill, with the page's text. inverse: dark on a light page, light on a dark page; text on it names the inverse colors (text-on-inverse, text-on-inverse-muted, text-on-inverse-mark), and Buttons take tone="inverse". image: a photo panel, dark in both modes; put the photo in the media slot, and give Buttons tone="image". |
| `as` | `HTMLTag` | `"section"` | The inner Section's element, such as div when the panel has no heading. |
| `contentClass` | `string` | None | For recipes and themes: classes on the inner Section, such as more space above the text on a photo. |
| `class` | `string` | None | More classes on the panel's box, merged with cn(), so yours win on conflicts. |
| Slot | Description |
| --- | --- |
| `default` | The content, usually a Container. |
| `media` | With tone="image": the photo, filling the panel under the text. Ignored on the other tones. |
Any other attribute goes on the inner Section, such as aria-labelledby with the id of its heading.
## Accessibility
- The panel's box is a plain <div>; the inner Section is the <section>. Pass aria-labelledby with the id of its heading to make it a region landmark.
- Text on the inverse panel uses its own colors in every preset; the focus ring follows.
- On a photo panel the text sits on the scrim, and the focus ring is the one for images, so both read on any picture.
Panel
FreeTo set a block of the page apart: an inset, rounded panel on a light fill, a dark fill, or a photo.
- File
- Panel.astro
- Group
- Layout
- Kind
- Static: no JavaScript
- Examples
- 4
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
A light panel
An inset, rounded box on the light page fill, around a Section: the section space above and below, the panel inset at the sides and below.
The studio
Nine people in a former print shop. We take on eight to ten projects a year, so the people you meet are the ones who make the work.
examples/panel/main.astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
---
<Panel aria-labelledby="panel-studio">
<Container size="md">
<SectionHead id="panel-studio" heading="The studio" text="Nine people in a former print shop. We take on eight to ten projects a year, so the people you meet are the ones who make the work." />
<div class="mt-blocks"><Button variant="secondary" href="#studio">Meet the studio</Button></div>
</Container>
</Panel>A dark panel
tone="inverse": dark on a light page, light on a dark page. Text on it names the inverse colors (text-on-inverse, text-on-inverse-muted), Buttons take tone="inverse", and the focus ring follows.
Services
Brand identity, websites, motion and design systems, by the same small team.
examples/panel/inverse.astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
---
<!-- Dark on a light page, light on a dark page. Text names the inverse colors; Buttons take tone="inverse". -->
<Panel tone="inverse" aria-labelledby="panel-services">
<Container size="md">
<SectionHead id="panel-services" heading="Services" text="Brand identity, websites, motion and design systems, by the same small team." headingClass="text-on-inverse" leadClass="text-on-inverse-muted" />
<div class="mt-blocks flex flex-wrap gap-3">
<Button tone="inverse" href="#start">Start a project</Button>
<Button tone="inverse" variant="secondary" href="#services">See the services</Button>
</div>
</Container>
</Panel>A photo panel
tone="image": your photo in the media slot, under the text and the scrim. Dark in both modes; Buttons take tone="image".

examples/panel/image.astro
---
import Button from "@astronomic-dev/ui/components/Button.astro";
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
// Your own image file.
import shelves from "../../photos/studio-shelves.webp";
---
<!-- A photo panel: dark in both modes. The photo goes in the media slot, under the text and its scrim. -->
<Panel tone="image" aria-labelledby="panel-reel" contentClass="pt-group">
<img slot="media" src={shelves.src} width={shelves.width} height={shelves.height} alt="Shelves of books, folders and plants in the studio" class="size-full object-cover" />
<Container size="md">
<h2 id="panel-reel" class="m-0 text-title display-face">Our 2026 reel</h2>
<p class="m-0 mt-item max-w-lead text-lead">Ninety seconds of the year's work, from identity to launch.</p>
<div class="mt-blocks"><Button tone="image" href="#reel">Watch the reel</Button></div>
</Container>
</Panel>Panels in a row
Each panel keeps the section space above and below, so two in a row never lose their top padding.
Work
Selected projects from the last two years.
Services
Five things, done by the same small team.
Recognition
Clients since 2014, and a few awards.
examples/panel/stacked.astro
---
import Container from "@astronomic-dev/ui/components/Container.astro";
import Panel from "@astronomic-dev/ui/components/Panel.astro";
import SectionHead from "@astronomic-dev/ui/components/SectionHead.astro";
---
<!-- Panels one after another: each keeps the section space above and below, and the inset between them. -->
<div>
<Panel aria-labelledby="panel-a">
<Container size="md"><SectionHead id="panel-a" heading="Work" text="Selected projects from the last two years." /></Container>
</Panel>
<Panel tone="inverse" aria-labelledby="panel-b">
<Container size="md"><SectionHead id="panel-b" heading="Services" text="Five things, done by the same small team." headingClass="text-on-inverse" leadClass="text-on-inverse-muted" /></Container>
</Panel>
<Panel aria-labelledby="panel-c">
<Container size="md"><SectionHead id="panel-c" heading="Recognition" text="Clients since 2014, and a few awards." /></Container>
</Panel>
</div>