Typography.
Give every word its own weight.
Expressive headings. Comfortable reading. A small type system that separates visual hierarchy from semantic meaning.
Make it yours
Preparing the example…
A place to start
UsageImport the stylesheet once at your application root. This complete example reflects the properties selected above.
Loading example…
Details that make a difference
Examples & statesChange the visual scale without skipping heading levels. The example stays an h3 at every size.
The finer details
API referenceGenerated from Dixy’s local TypeScript interfaces. Native HTML attributes and refs are forwarded. The table covers Dixy’s own options.
Text
| Prop | Type / description | Default |
|---|---|---|
as | "div" | "p" | "span"The semantic HTML element. | p |
variant | TextVariantA complete semantic type style. Overrides size when supplied. | body.md |
size | "sm" | "md" | "lg"Convenience size within the body family. | md |
tone | "default" | "accent" | "muted"The text emphasis. | default |
Heading
| Prop | Type / description | Default |
|---|---|---|
as | "h1" | "h2" | "h3" | "h4" | "h5" | "h6"The semantic heading level, independent of visual size. | h2 |
variant | HeadingVariantA complete visual style, independent of the heading level. | heading.md |
size | "sm" | "md" | "lg"Convenience size within the heading family. | md |
Built from the same foundations
Styling tokensChange Theme settings above to compare appearance, accent, neutral, radius, spacing density, motion and direction. Override component aliases on a Theme root so custom properties follow portaled content too. The wrapper merges className, style, refs and render composition with its owning primitive.
| Token | Purpose |
|---|---|
--dixy-font-body-md | The component-specific starting point. |
--dixy-font-label-md | Control label font and line height; body roles remain readable in text inputs. |
--dixy-color-background-selected | Selected surfaces use semantic color across appearances. |
--dixy-color-border-focus | Focus indication remains visible independently of shadows. |
--dixy-spacing-inset-sm | Density-aware component padding. |
--dixy-motion-transition-feedback | Short state feedback, reduced by the inherited motion setting. |
Consider everyone
AccessibilityChoose the heading element for document structure, then choose its size for visual hierarchy. Keep body text readable at zoom. Font families inherit from theme tokens and can be overridden by the consuming app.
Target: WCAG 2.2 AA. Automated tests cover selected behavior; manual screen-reader, contrast, and zoom validation remain part of the release checklist.
Build it. Then understand it.
A heading’s semantic level and its visual size are independent. A component library should make correct HTML easier without imposing a page outline.
--dixy-font-body-md