Haskell wrapper for iced gui library. Very experimental, check Roadmap to see progress. There is some documentation available.
Desktops - tested on Linux, and macOS should work too. Build for Windows currently doesn't work, see related issue for more details.
Check examples for more
import Iced
import Iced.Attribute
import Iced.Attribute.Alignment
import Iced.Theme
import Iced.Widget
data Message = Inc | Dec
update :: Message -> Int -> Int
update Inc = succ
update Dec = pred
view :: Int -> Element
view value =
container [centerX Fill, centerY Fill] $
column [alignX Center, spacing 10] [
button [onPress Inc] "Increment",
text [size 50] $ show value,
button [onPress Dec] "Decrement"
]
main :: IO ()
main = Iced.run [theme GruvboxLight] "Counter" 0 update view
Beautiful Ferra
theme was built by Halloy team.
Check the complete example.
Rust toolchain is 1.84 or above. Haskell build uses cabal and supported versions
are specified in iced-hs.cabal
file. It's also possible to build with GHC alone.
Use provided bash scripts as an example.
Run the examples with cabal:
cabal run counter
Or use bash scripts:
# build `libiced_hs.a`
./build_rust.sh
# then pass it to ghc
ghc -ipath/to/this/repo path/to/libiced_hs.a main.hs
- wgpu - graphics
- winit - windowing
- tokio - runtime
- cosmic-text - multi-line text handling
Below is a list of inspiring projects
This is a research project. The api may change often. Not recommended for use in production. It still may be a good option if you need a simple way to build some ui.
- Widgets
- button
- canvas
- checkbox
- column
- comboBox
- container
- image
- keyedColumn
- markdown
- mouseArea
- paneGrid
- progressBar
- pickList
- qrCode
- radio
- responsive
- horizontalRule, verticalRule
- row
- scrollable
- slider, verticalSlider
- horizontalSpace, verticalSpace
- svg
- text
- textEditor
- textInput
- toggler
- tooltip
- Helper functions
- lazy
- themer
- focusNext, focusPrevious
- Themes
- Canvas api
- Frame methods
- drawImage
- drawSvg
- fill
- fillText
- pushTransform
- popTransform
- rotate
- scale
- stroke
- more frame methods
- Path methods
- circle, lineTo, moveTo, rectangle
- more path methods
- Frame methods
- Shader
- shader widget
- attributes
- Multi window
- Custom widgets
- Subscriptions
- subscription attribute for Application
- Time.every subscription
- Keyboard
- onKeyPress
- onKeyRelease
- PhysicalKey
- KeyCode
- NativeKeyCode
- LogicalKey
- Named
- Character
- custom subscriptions
- other events
- Task api
-
Task.perform
for RustFuture
-
Task.performBlocking
for blocking tasks
-
- Add all attributes from iced for each widget
- Styles for widgets
- button
- checkbox
- container
- pickList
- progressBar
- radio
- text
- textInput
- textEditor
- ...