Skip to main content

Starwind UI v1.15 is now available! With new prose, sidebar, and more components

Prose

Welcome to Starwind

Starwind UI is a beautiful component library designed for the modern web. It provides accessible, customizable components that work seamlessly with Astro and Tailwind CSS.

Getting Started

Installation is simple. Just run the CLI command and you're ready to go. Here's a quick example: npx starwind@latest add prose

Key Features

  • Fully accessible components following WAI-ARIA guidelines
  • Customizable via CSS variables and Tailwind classes
  • TypeScript support out of the box

Build beautiful interfaces without the complexity.

For more information, check out the documentation or join our community.

Installation

Usage

General Notes

The Prose component applies beautiful typography styles to markdown and rich text content. It handles headings, paragraphs, lists, blockquotes, code blocks, tables, and more.

Sizing is em-based, so it scales with the inherited font-size. Control overall size via Tailwind text utilities like text-sm md:text-base.

With Rendered Markdown

The Prose component works great with Astro’s content collections:

---
import { render } from "astro:content";
import { Prose } from "@/components/starwind/prose";
const { Content } = await render(entry);
---
<Prose>
<Content />
</Prose>

Custom Styling

Override default styles using CSS variables. You can apply them inline, via Tailwind arbitrary properties, or through a custom class:

Welcome to Starwind

Starwind UI is a beautiful component library designed for the modern web. It provides accessible, customizable components that work seamlessly with Astro and Tailwind CSS.

Getting Started

Installation is simple. Just run the CLI command and you're ready to go. Here's a quick example: npx starwind@latest add prose

Key Features

  • Fully accessible components following WAI-ARIA guidelines
  • Customizable via CSS variables and Tailwind classes
  • TypeScript support out of the box

Build beautiful interfaces without the complexity.

For more information, check out the documentation or join our community.

Inline Overrides

You can also override specific values using Tailwind’s arbitrary property syntax for responsive adjustments:

<Prose class="[--prose-spacing:1.5em] md:[--prose-spacing:1.25em]">
<!-- content -->
</Prose>

Or set variables on a parent element:

<div style="--prose-h1-size: 3em;">
<Prose>
<!-- content with larger h1 -->
</Prose>
</div>

Opting Out

Use the not-sw-prose class on any element to exclude it from prose styling:

<Prose>
<h1>Styled Heading</h1>
<div class="not-sw-prose">
<!-- This content won't have prose styles applied -->
<h2>Unstyled Heading</h2>
</div>
</Prose>

API Reference

Prose

A wrapper component that applies typography styles to its children.

PropTypeDefault
classstring-
<Prose class="mx-auto text-sm md:text-base">
<!-- markdown or rich text content -->
</Prose>

CSS Variables Reference

All CSS variables use the --prose- prefix. Override them to customize the appearance.

Typography & Spacing

VariableDefaultDescription
--prose-line-height1.6Base line height for text
--prose-spacing1.25emVertical spacing between block elements
--prose-heading-spacing1.5emExtra spacing before headings
--prose-code-size0.875emFont size for code elements
--prose-list-indent1.625emIndentation for lists

Colors

VariableDefaultDescription
--prose-colorforeground/80%Base text color
--prose-heading-colorforegroundHeading text color
--prose-list-marker-colormuted-foregroundList bullet/number color

Headings

VariableDefaultDescription
--prose-heading-fontinheritFont family for headings
--prose-heading-weight600Default heading font weight
--prose-heading-line-height1.25Line height for headings
--prose-h1-size2.25emH1 font size
--prose-h1-weightheading-weightH1 font weight
--prose-h2-size1.5emH2 font size
--prose-h2-weightheading-weightH2 font weight
--prose-h3-size1.25emH3 font size
--prose-h3-weightheading-weightH3 font weight
--prose-h4-size1emH4 font size
--prose-h4-weightheading-weightH4 font weight
VariableDefaultDescription
--prose-link-colorforegroundLink text color
--prose-link-decoration-colorprimary-accentLink underline color
--prose-link-hover-colorprimary-accentLink hover color

Strong/Bold

VariableDefaultDescription
--prose-strong-colorforegroundBold text color
--prose-strong-weight600Bold text font weight

Blockquotes

VariableDefaultDescription
--prose-blockquote-colorforegroundBlockquote text color
--prose-blockquote-border-colorborderBlockquote left border color
--prose-blockquote-border-width4pxBlockquote left border width

Inline Code

VariableDefaultDescription
--prose-code-bgmutedInline code background
--prose-code-colorforegroundInline code text color
--prose-code-weight500Inline code font weight
--prose-code-radiusradius-smInline code border radius

Code Blocks

VariableDefaultDescription
--prose-pre-border-colorborderCode block border color
--prose-pre-border-radiusradius-mdCode block border radius

Tables

VariableDefaultDescription
--prose-table-heading-colorforegroundTable header text color
--prose-table-border-colorborderTable border color

Media

VariableDefaultDescription
--prose-media-border-width0pxBorder width for images/video
--prose-media-border-colorborderBorder color for images/video
--prose-media-border-radius0Border radius for images/video

Highlight/Mark

VariableDefaultDescription
--prose-highlight-colorforegroundHighlighted text color
--prose-highlight-bg-colorwarning/30%Highlighted text background

Changelog

v1.0.0

  • Initial release with starwind v1.15.0