nano-ui-sdl: SDL3 window backend for nano-ui

[ graphics, mit ] [ Propose Tags ] [ Report a vulnerability ]

Runs nano-ui views in an SDL3 window with TrueType text and native file dialogs. Requires SDL3, SDL3_ttf, and pkg-config.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
sdl

Build the SDL3 backend. Needs SDL3, SDL3_ttf, and pkg-config.

Enabled
simd

Compile the batch culler with AVX2 (x86-64 only; the binary then requires an AVX2 CPU)

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies base (>=4.22.0.0 && <4.23), bytestring (>=0.12 && <0.13), containers (>=0.8 && <0.9), dir-traverse (>=0.2.3.0 && <0.3), directory (>=1.3 && <1.4), effectful-core (>=2.6 && <2.7), file-embed (>=0.0.16 && <0.1), filepath (>=1.5 && <1.6), hashable (>=1.5 && <1.6), nano-ui (>=0.1 && <0.2), nano-ui-sdl, primitive (>=0.9 && <0.10), record-hasfield (>=1.0 && <1.1), sdl3-bindgen-sys (>=0.0.0.2 && <0.1), text (>=2.1 && <2.2), unordered-containers (>=0.2 && <0.3) [details]
License MIT
Author goolord
Maintainer zacharyachurchill@gmail.com
Uploaded by goolord at 2026-09-18T20:40:43Z
Category Graphics
Distributions
Executables nano-ui-sdl-anim
Downloads 6 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user [build log]
All reported builds failed as of 2026-09-18 [all 2 reports]

Readme for nano-ui-sdl-0.1.0.1

[back to package description]

nano-ui-sdl

SDL3 window backend for nano-ui. Text is shaped with SDL_ttf and HarfBuzz, drawn from the bundled Inter font or installed fonts looked up by family name, with fallback fonts for other scripts. The backend also opens native file dialogs.

{-# LANGUAGE OverloadedStrings #-}

import NanoUI
import NanoUI.Backend.Sdl (defaultSdlOptions, runSdlApp)

main :: IO ()
main = runSdlApp defaultSdlOptions (label "Hello")

runSdlAppReduce runs a view against a model and an update function, for use with NanoUI.Emit. SdlOptions sets the window, fonts, font size, theme, and vsync.

Running

cabal run nano-ui-sdl-anim     # tween and spring animations
cabal bench nano-ui-sdl-bench  # runFrame and SDL drawing timings

Requirements

SDL3 and SDL3_ttf 3.2 or later, and pkg-config. The backend is behind the sdl flag, which is on by default.

On x86-64, -f simd compiles the draw-batch culler with AVX2. A binary built that way needs an AVX2 CPU.