The NebuxTypography class provides a complete typography system with semantic text styles designed for different UI elements and content hierarchies.Documentation Index
Fetch the complete documentation index at: https://synapsync.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
NebuxTypography uses Google Fonts Montserrat by default and provides 10 semantic text styles, each optimized for specific use cases with appropriate font size, weight, line height, and letter spacing.Text styles
All text styles include explicitheight (line-height multiplier) and letterSpacing values aligned with Material Design 3 type scale:
Style for main headings (e.g., page titles, primary headers)
- Font size: 18px
- Font weight: 600
- Line height: 1.2
- Letter spacing: -0.5
Style for section headers (e.g., content sections)
- Font size: 14px
- Font weight: 500
- Line height: 1.25
- Letter spacing: -0.25
Style for main content text (e.g., articles, descriptions)
- Font size: 12px
- Font weight: 400
- Line height: 1.4
- Letter spacing: 0.0
Style for regular paragraph text (e.g., default content, paragraphs)
- Font size: 14px
- Font weight: 400
- Line height: 1.5
- Letter spacing: 0.15
Style for small supporting text (e.g., captions, metadata)
- Font size: 10px
- Font weight: 400
- Line height: 1.3
- Letter spacing: 0.1
Style for small labels (e.g., timestamps, status)
- Font size: 10px
- Font weight: 500
- Line height: 1.3
- Letter spacing: 0.1
Style for primary action buttons
- Font size: 14px
- Font weight: 700
- Line height: 1.2
- Letter spacing: 0.5
Style for secondary action buttons
- Font size: 14px
- Font weight: 600
- Line height: 1.2
- Letter spacing: 0.5
Style for form input text fields
- Font size: 14px
- Font weight: 400
- Line height: 1.4
- Letter spacing: 0.15
Style for placeholder text in inputs
- Font size: 14px
- Font weight: 400
- Font style: italic
- Line height: 1.4
- Letter spacing: 0.15
Standard typography
Thestandard() factory method creates a complete typography system using Google Fonts Montserrat:
Accessing typography
Use the BuildContext extension to access typography styles in your widgets:Real-world example
Here’s a complete example from the Nebux Design System showcase:The spacing constants (
heightSpace8, heightSpace4, etc.) are part of the Spacing system and provide consistent vertical spacing.Custom typography
Create custom typography with a different font family:With package font
If your font is from a package, specify the package name:Typography overrides
Override specific text styles while keeping others standard:From Material theme
Create NebuxTypography from an existing Material ThemeData:Material mapping
Nebux typography roles map to Material TextTheme:| Nebux Style | Material TextTheme | Use Case |
|---|---|---|
| heading | headlineMedium | Page titles, primary headers |
| section | titleLarge | Section headers |
| content | bodyLarge | Articles, descriptions |
| paragraph | bodyMedium | Default body text |
| caption | bodySmall | Captions, metadata |
| label | labelLarge | Small labels, status |
| primaryAction | labelLarge (w700) | Primary button text |
| secondaryAction | labelLarge (w600) | Secondary button text |
| formInput | bodyMedium | Input field text |
| placeholder | bodyMedium (italic) | Placeholder text |
Merging typography
Merge two typography schemes, with the second taking precedence:Customizing text styles
All TextStyle objects can be customized using Flutter’scopyWith method:
Typography best practices
- Content hierarchy
- Form inputs
- Accessibility
Use typography styles to establish clear content hierarchy:
- heading: Page titles and primary headers
- section: Section headers and subheadings
- paragraph: Body text and paragraphs
- content: Article content and descriptions
- caption: Supporting text and metadata
- label: Small labels and status indicators
Font size scale
NebuxTypography uses NebuxFontSize for consistent sizing:| Size Name | Value | Used In |
|---|---|---|
| small | 10px | caption, label |
| medium | 12px | content |
| large | 14px | paragraph, section, actions, forms |
| heading4 | 18px | heading |