layout
Version, currently 0.1.02 versions
- 0.2.0latestJan 8, 2021
- 0.1.0not indexedJan 17, 2021
github.com/da1nerd/layout.cr
A constraint based layout framework
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
layout:
github: da1nerd/layout.cr
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
layout
This is a constraint based layout framework. Or more simply put, this generates the measurements for a visual layout which could then be used for:
- Positioning things on a PDF
- Drawing objects in a UI toolkit
Installation
- Add the dependency to your
shard.yml:
dependencies:
layout:
github: da1nerd/layout.cr
- Run
shards install
Usage
require "layout"
screen = Layout::Block.new(Layout::Direction::COLUMN)
screen.width = 300f64
screen.height = 300f64
screen.x = 0f64
screen.y = 0f64
top_block = Layout::Block.new
top_block.height = 100f64
bottom_block = Layout::Block.new
screen.children = [top_block, bottom_block]
Layout.solve(screen)
# go use the calculated dimensions!
bottom_block.height.value # => 200f64
With the above code you'd have all the necessary dimensions to draw this stack of blocks.

Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/da1nerd/layout.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Joel Lonbeck - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Jan 17, 2021
- Commit
984d11eeda6e- Indexed
- not yet
Dependents
Repository
github.com/da1nerd/layout.cr
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 2