Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/grkek/iu
UI framework based on the Fusion/libui.cr library, with elements from watzon/cru.
https://github.com/grkek/iu
crystal gui libui reusable-components ui user-interface
Last synced: about 1 month ago
JSON representation
UI framework based on the Fusion/libui.cr library, with elements from watzon/cru.
- Host: GitHub
- URL: https://github.com/grkek/iu
- Owner: grkek
- License: mit
- Created: 2020-08-22T18:12:18.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2024-02-19T04:35:11.000Z (10 months ago)
- Last Synced: 2024-10-25T01:28:06.421Z (about 2 months ago)
- Topics: crystal, gui, libui, reusable-components, ui, user-interface
- Language: Crystal
- Homepage:
- Size: 81.1 KB
- Stars: 72
- Watchers: 7
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - Iu - UI framework based on the [Fusion/libui.cr](https://github.com/Fusion/libui.cr) library, with custom elements and modified bindings from [hedron-crystal/hedron](https://github.com/hedron-crystal/hedron) (GUI Development)
README
[![Control gallery](https://i.ibb.co/SNRhTmH/Control-gallery.png)](https://github.com/grkek/iu/blob/develop/examples/control_gallery.cr)
# IU
UI framework based on the [Fusion/libui.cr](https://github.com/Fusion/libui.cr) library, with custom elements from [watzon/cru](https://github.com/watzon/cru).## Motivation
Currently avaliable Crystal UI frameworks are either not maintained anymore or the documentation is scarce and a single error might cause a developer to lose motivation, which is why I decided to build IU on top of the LibUI framework which is a multi-platform powerful UI toolkit.## Build status
[![Build Status](https://action-badges.now.sh/grkek/iu)](https://github.com/grkek/iu/actions)## Features
### Widgets
- Horizontal box, Vertical box, Checkbox, Combobox, Editable combobox.
- Button, Font button, Color button, Radio button.
- Datetime picker, Progress bar, Slider, Spinbox.
- Text entry, Multiline text entry.
- Form, Grid, Group, Table, Tab, Separator.
- Image, Label.
- Window, Menubar, Area.
- Many more.### Platforms
- Mac OSX
- Linux
- Windows (Once crystal will be available on Windows)## Code example
```ruby
require "iu"module Example
include Iu::Components# Ability to reuse components extracted to other classes.
class MyComponent < Iu::ReusableComponent
def initialize(@id : Int32); enddef render : Iu::Component
Group
.new(title: "MyComponent", margined: true)
.adopt(
VerticalBox
.new(padded: true)
.adopt(
Label.new(text: "Hello, World ##{@id}!"),
stretchy: true
)
.adopt(
Button.new(text: "Click Me!"),
stretchy: true
)
)
end
end# :nodoc:
class Application < Iu::Application
def initialize_component
window =
Window.new(
title: "Example",
width: 800,
height: 600,
menu_bar: false
)
window.margined = truewindow
.adopt(
HorizontalBox
.new(padded: true)
.adopt(
MyComponent.new(1),
stretchy: true
)
.adopt(
MyComponent.new(2),
stretchy: true
)
.adopt(
MyComponent.new(3),
stretchy: true
)
)window.closing.on do
exit(0)
end
window.show
end
end
endapp = Example::Application.new
app.should_quit.on do
exit(0)
endapp.start
```# Installation
1. Follow the instructions for installation laid out in [andlabs/libui](https://github.com/andlabs/libui).
2. Copy the compiled files from step 1 (i.e. files in `build/out`) to `/usr/lib` for OSX and Linux users.
3. Go to your `shard.yml` file, and enter this in:```yaml
dependencies:
iu:
github: grkek/iu
```
4. Run `shards install`.