Complete reference for every class, function, and parameter in the Nib Python SDK. Each page documents the constructor, properties, methods, and includes working code examples.
Sections¶
| Section | Description |
|---|---|
| Core | Entry points, app lifecycle, menus, state management, settings, and file dialogs |
| Views -- Controls | Interactive and display controls: Text, Button, TextField, Toggle, Slider, Image, and more |
| Views -- Layout | Layout containers: VStack, HStack, ZStack, ScrollView, List, Grid, NavigationStack |
| Views -- Shapes | Shape primitives: Rectangle, Circle, Ellipse, Capsule, Path, and Gradients |
| Views -- Charts | Swift Charts integration: Chart, LineMark, BarMark, AreaMark, SectorMark, and more |
| Views -- Effects | Visual effects: VisualEffectBlur, Canvas |
| Draw Module | Canvas drawing primitives, paint, gradients, path elements, and image/text rendering |
| Types & Enums | Color, Font, Animation, Transition, TextStyle, alignment and style enums |
| Services | System services: Battery, Connectivity, Screen, Keychain, Camera, LaunchAtLogin, Permissions |
| Notifications | macOS notification system: Notification, NotificationManager, sounds, and actions |
| Modifiers | View modifiers for layout, appearance, typography, and effects |
Quick Example¶
import nib
def main(app: nib.App):
app.title = "My App"
app.icon = nib.SFSymbol("star.fill")
app.width = 300
app.height = 200
counter = nib.Text("0", font=nib.Font.TITLE)
def increment():
counter.content = str(int(counter.content) + 1)
app.build(
nib.VStack(
controls=[counter, nib.Button("Add", action=increment)],
spacing=8,
padding=16,
)
)
nib.run(main)