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
TheNebuxFontSize class defines a comprehensive font size scale for the NebuX Design System. It provides 13 predefined font sizes ranging from 8px (extraSmall) to 36px (display1), ensuring consistent typography sizing across the application.
Built with Freezed for immutability and type safety, it can be customized with overrides while maintaining a standard baseline.
Source: lib/src/core/theme/font_size/nebux_font_size.dart
Class Definition
Properties
All font sizes are defined asdouble values representing pixels.
Small Sizes
Extra small font sizeDefault:
8.0 (8px)Use cases: Tiny labels, micro text, badgesSmall font sizeDefault:
10.0 (10px)Use cases: Captions, metadata, timestamps, small labelsMedium font sizeDefault:
12.0 (12px)Use cases: Dense content, list items, secondary textMedium-Large Sizes
Medium-large font size (between medium and large)Default:
13.0 (13px)Use cases: Intermediate text sizes, specialized componentsLarge font sizeDefault:
14.0 (14px)Use cases: Body text, paragraphs, buttons, form inputs (most common size)Extra large font sizeDefault:
16.0 (16px)Use cases: Emphasized body text, larger buttons, prominent labelsHeading Sizes
Heading 4 font sizeDefault:
18.0 (18px)Use cases: Small headings, card titles, section headersHeading 3 font sizeDefault:
20.0 (20px)Use cases: Medium headings, page subtitlesHeading 2 font sizeDefault:
22.0 (22px)Use cases: Large headings, main section titlesHeading 1 font sizeDefault:
24.0 (24px)Use cases: Page titles, primary headers, main headingsDisplay Sizes
Display 3 font sizeDefault:
28.0 (28px)Use cases: Small display text, hero numbersDisplay 2 font sizeDefault:
32.0 (32px)Use cases: Medium display text, prominent statisticsDisplay 1 font size (largest)Default:
36.0 (36px)Use cases: Large display text, hero headings, splash screensConstructors
NebuxFontSize (default)
Creates a newNebuxFontSize instance with all font size properties.
Factory Constructors
standard
Creates a standard set of font sizes for the NebuX design system.- extraSmall: 8px
- small: 10px
- medium: 12px
- mediumLarge: 13px
- large: 14px
- extraLarge: 16px
- heading4: 18px
- heading3: 20px
- heading2: 22px
- heading1: 24px
- display3: 28px
- display2: 32px
- display1: 36px
Example
custom
Creates a custom set of font sizes with optional overrides. Any unspecified values default to standard sizes.Custom extra small size (defaults to 8.0)
Custom small size (defaults to 10.0)
Custom medium size (defaults to 12.0)
Custom medium-large size (defaults to 13.0)
Custom large size (defaults to 14.0)
Custom extra large size (defaults to 16.0)
Custom heading 4 size (defaults to 18.0)
Custom heading 3 size (defaults to 20.0)
Custom heading 2 size (defaults to 22.0)
Custom heading 1 size (defaults to 24.0)
Custom display 3 size (defaults to 28.0)
Custom display 2 size (defaults to 32.0)
Custom display 1 size (defaults to 36.0)
Example
Instance Methods
copyWith
Creates a copy with optional property overrides. Generated by Freezed.Example
merge
Merges this font size scheme with anotherNebuxFontSize. Sizes from the other scheme take precedence.
The font size scheme to merge with. If null, returns this instance unchanged.
Example
Usage Examples
Basic Usage with TextStyle
Integration with NebuxTypography
Custom Font Scale
Responsive Font Sizing
Scaling All Sizes Proportionally
Using with Theme
Custom Size Presets
Font Size Scale Reference
| Property | Default | Common Use Cases |
|---|---|---|
extraSmall | 8px | Tiny badges, micro labels |
small | 10px | Captions, timestamps, metadata, labels |
medium | 12px | Dense content, list items |
mediumLarge | 13px | Intermediate sizes |
large | 14px | Body text, buttons, inputs (primary size) |
extraLarge | 16px | Emphasized body text, large buttons |
heading4 | 18px | Card titles, small headings |
heading3 | 20px | Section headings |
heading2 | 22px | Page subtitles |
heading1 | 24px | Page titles, main headings |
display3 | 28px | Hero numbers, statistics |
display2 | 32px | Large display text |
display1 | 36px | Hero headings, splash screens |
See Also
- NebuxTheme - Main theme integration
- NebuxColors - Color system
- NebuxTypography - Typography system that uses font sizes