Data displayProse
Searchastronomic.dev# Prose For long text from the editor, like articles and case studies. Static: no JavaScript. ## Usage ```astro import Prose from "@astronomic-dev/ui/components/Prose.astro"; ``` ## Examples ### Article text Running text in the reading role, at most 65ch wide. Prose is a container, so its h2 sizes to its own width, not the screen's. In a box that takes its content's width (an inline-flex, an auto grid track) it is 65ch wide; a set width wins. A class on an element inside it wins over Prose's rule for that element (for a link's hover or focus, a hover: or focus-visible: class). ```astro --- import Prose from "@astronomic-dev/ui/components/Prose.astro"; --- <Prose> <h2>How we run a project</h2> <p>Every project starts with a one-day workshop. We agree on goals, audience and budget, and <a href="#brief">write them down</a>.</p> <ul> <li>Two design routes, and you pick one.</li> <li>Weekly rounds, with real pages every Friday.</li> </ul> <blockquote><p>They shipped on the day they promised.</p></blockquote> </Prose> ``` ## Props ### Prose | Prop | Type | Default | Description | | --- | --- | --- | --- | | `as` | `HTMLTag` | `"div"` | The element to render, such as article. | | `class` | `string` | None | More classes, merged with cn(), so yours win on conflicts. | | Slot | Description | | --- | --- | | `default` | Plain HTML, for example from a rich-text renderer or Markdown. | Any other attribute goes on the rendered element. ## Accessibility - Only styles the HTML you put in it; it adds no roles. - Links in it show an underline and the accent focus ring. - Keep the content's headings in page order and give its images alt text.
Prose
FreeFor long text from the editor, like articles and case studies.
- File
- Prose.astro
- Group
- Data display
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
Article text
Running text in the reading role, at most 65ch wide. Prose is a container, so its h2 sizes to its own width, not the screen's. In a box that takes its content's width (an inline-flex, an auto grid track) it is 65ch wide; a set width wins. A class on an element inside it wins over Prose's rule for that element (for a link's hover or focus, a hover: or focus-visible: class).
How we run a project
Every project starts with a one-day workshop. We agree on goals, audience and budget, and write them down.
- Two design routes, and you pick one.
- Weekly rounds, with real pages every Friday.
They shipped on the day they promised.
Force statemain.astro
examples/prose/main.astro
---
import Prose from "@astronomic-dev/ui/components/Prose.astro";
---
<Prose>
<h2>How we run a project</h2>
<p>Every project starts with a one-day workshop. We agree on goals, audience and budget, and <a href="#brief">write them down</a>.</p>
<ul>
<li>Two design routes, and you pick one.</li>
<li>Weekly rounds, with real pages every Friday.</li>
</ul>
<blockquote><p>They shipped on the day they promised.</p></blockquote>
</Prose>Minimal · Light