Types Reference¶
Nib provides a set of types, dataclasses, and enums used to configure views, styling, animations, and layout. All types are importable directly from the nib module.
import nib
color = nib.Color(hex="#4287f5")
font = nib.Font.system(16, nib.FontWeight.BOLD)
animation = nib.Animation.spring()
Type Classes¶
| Type | Description |
|---|---|
| Color | Color values: named, hex, RGB, RGBA |
| Font | Font configuration: system fonts and custom font files |
| Animation | Animation timing curves and spring configurations |
| Transition | View appearance/disappearance animations and content transitions |
| TextStyle & AttributedString | Rich text styling and multi-segment attributed strings |
| Offset & CornerRadius | Position offsets and per-corner radius configuration |
Enums¶
Enums lists every enum below with its members and string values. Each enum has its own heading on that page.
| Group | Enums |
|---|---|
| Alignment | HorizontalAlignment, VerticalAlignment, Alignment, ScrollAxis |
| Image and text | SymbolScale, SymbolRenderingMode, ContentMode, TruncationMode, TextCase |
| Menu | MenuItemState |
| Style | ButtonStyle, ButtonRole, BorderShape, ControlSize, LabelStyle, ToggleStyle, TextFieldStyle, EditorStyle, PickerStyle, ProgressStyle, FormStyle |
| Blend | BlendMode |
Other enums and style types are documented with the type they belong to:
FontWeight: FontFontDesign: FontTransition: TransitionContentTransition: TransitionTransitionConfig: TransitionCustomTransitionBuilder: TransitionTextEditorStyle: TextEditor