Skip to content
Cynosurev0.5.0
SearchStorybookGitHubnpmColour mode: System. Switch to Light

Components / Feedback and display

Prose

Gives long-form HTML that you do not style element by element (rendered Markdown, release notes, help pages) Cynosure's typography: headings, paragraphs, lists, links, quotes, code, tables and images.

Headings step down in size

When to useLink to "When to use"

  • Content from Markdown or a CMS: plain elements without classes.

Use something else when:

  • you write the markup yourself: compose components (Stack, Card, DescriptionList) instead
  • you need a single line of styled text: it does not need Prose

UsageLink to "Usage"

tsx
Copy
import { Prose } from "@arshad-shah/cynosure";

<Prose as="article">
  <div dangerouslySetInnerHTML={{ __html: html }} />
</Prose>

Only render HTML you trust or have sanitised: Prose styles content, it does not clean it.

Components insideLink to "Components inside"

Cynosure components inside Prose keep exactly their own styles, so MDX or a renderer can mix them in.

Components inside keep their styles

PropsLink to "Props"

Every prop of Prose
PropWhat it doesTypeDefault
size
Body text size; headings scale from it.Size
as
Neutral element to render. Use article for a standalone piece of writing."div" | "section" | "article"
className
Added to the root element, for layout.string
style
Layout only. Restyle through --cy-prose-* tokens.CSSProperties
children
Rendered Markdown or other long-form HTML. Cynosure components inside keep their own styles.ReactNode

Generated from the type definitions in @arshad-shah/cynosure 0.5.0.

Behaviour and accessibilityLink to "Behaviour and accessibility"

  • Scope: the rules apply to plain elements and stop at any Cynosure component (CSS @scope with a lower boundary).
  • Host CSS: rules have the lowest specificity. They beat tag resets such as Tailwind preflight because they are scoped, and your own classes (a syntax highlighter's) still win.
  • Reading: lines stop at about 70 characters; headings step down in size from h1 to h4; lists keep their bullets and numbers.
  • Links: underlined and in the accent text colour, with a focus ring for keyboard users.
  • Code: monospaced; code blocks wrap long lines instead of scrolling, so there is no scroll region that keyboard users cannot reach.
  • Contrast: text, links, quotes and code keep 4.5:1 in light and dark modes.
  • Direction: list indents and the quote rule follow the text direction.
Readable in light and dark

ThemingLink to "Theming"

Tokens: --cy-prose-measure, --cy-prose-flow, --cy-prose-link and --cy-prose-code-background.

ts
Copy
createTheme({ components: { prose: { measure: "60ch", flow: "1.25em" } } });

Kbd · CopyButton · Link

These examples run Cynosure 0.5.0 (commit 50ce30b), the version on npm.

Getting started
Theming
Icons
Accessibility
Code editors and highlighters
Using Cynosure without React
Build-tool adapters
Components
Accordion
AppShell
AspectRatio
Breadcrumbs
Calendar
Card
Container
Disclosure
Divider
DocumentViewport
Grid
Inline
PageHeader
PanZoomCanvas
ScrollArea
SideNav
SortableList
SplitPane
Stack
StatusBar
Tabs
TitleBar
Toolbar
Tree
VirtualList
ZoomControls
Announcer
Avatar
Badge
CodeBlock
DescriptionList
EmptyState
ErrorBoundary
Field
Heading
IconTile
Image
Kbd
List
LoadingDots
Notice
ProgressBar
Prose
Skeleton
Stat
Steps
Table
Text
Button
Checkbox
Checklist
ColorField
ColorSwatches
Combobox
CompareSlider
CopyButton
DateField
FileDrop
IconButton
KeyValueEditor
Link
NumberField
Pagination
PathField
RadioGroup
SearchField
SegmentedControl
Select
SelectionFrame
SignaturePad
Slider
Switch
TagInput
TextArea
TextField
ThemeToggle
TimeField
ButtonBase
ChoiceBase
DialogBase
FileInputBase
HiddenValue
Icon
InputBase
LinkBase
LiveRegion
TextAreaBase
ChatMessage
Choice
DataGrid
DeviceFrame
HighlightedText
HotkeyField
ListRow
OptionList
OverlayFrame
QRCode
RowActions
Section
SiteFooter
SiteHeader
SkipLink
SortButton
VisuallyHidden
CommandPalette
ContextMenu
Dialog
FloatingToolbar
HoverCard
Menu
Menubar
Popover
ProgressOverlay
Sheet
Toast
Tooltip
Changelog