{"id":50204031,"url":"https://github.com/loom-go/tess","last_synced_at":"2026-06-02T21:31:48.248Z","repository":{"id":325862548,"uuid":"1099690092","full_name":"loom-go/tess","owner":"loom-go","description":"UI layout engine for Go","archived":false,"fork":false,"pushed_at":"2026-03-27T15:43:23.000Z","size":3263,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-26T00:35:36.534Z","etag":null,"topics":["engine","go","golang","interface","layout","library","tilling","ui","user"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loom-go.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-19T10:15:27.000Z","updated_at":"2026-03-31T09:12:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/loom-go/tess","commit_stats":null,"previous_names":["anatolelucet/tess"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/loom-go/tess","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loom-go%2Ftess","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loom-go%2Ftess/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loom-go%2Ftess/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loom-go%2Ftess/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loom-go","download_url":"https://codeload.github.com/loom-go/tess/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loom-go%2Ftess/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33838215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["engine","go","golang","interface","layout","library","tilling","ui","user"],"created_at":"2026-05-26T00:05:09.194Z","updated_at":"2026-06-02T21:31:48.243Z","avatar_url":"https://github.com/loom-go.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003ccode\u003etess\u003c/code\u003e\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA layout engine for Go powered by \u003ca href=\"https://yogalayout.dev\"\u003eYoga\u003c/a\u003e.\u003c/p\u003e\n\n```go\n// Create a root Node\nroot, err := tess.NewNode()\nroot.SetWidth(tess.Point(400))\nroot.SetHeight(tess.Point(300))\nroot.SetPadding(tess.Edges{All: tess.Point(20)})\n\n// Add a child to the root Node\nchild, err := tess.NewNode()\nchild.SetWidth(tess.Percent(100))\nchild.SetHeight(tess.Point(150))\nroot.AppendChild(child)\n\n// Compute the layout to get final positions and sizes\nroot.ComputeLayout(tess.Container{})\n\n// Get computed layout for a child\nlayout := root.GetChild(0).GetLayout()\n// Use these values to render your element on screen\nlayout.Left()\nlayout.Top()\nlayout.Width()\nlayout.Height()\n```\n\n## Introduction\n\n`tess` determines the position and size of UI element using browser-style flexbox and style attributes.\n\nIt can be used to build terminal UIs, game interfaces, PDF layouts, or anything else where you need flexible box-model positioning.\n\n### Core concepts\n\n**Nodes** - are the building blocks of your layout tree. Each node represents a UI element that needs positioning and sizing.\n\n**Styles** - controls how nodes behave (width, height, padding, flex direction, etc). Think CSS properties, but for any rendering system.\n\n**Layouts** - contains the final calculated positions and sizes of nodes that you can use to render elements on screen.\n\n## Usage\n\n### Installation\n\n```bash\ngo get github.com/AnatoleLucet/tess\n```\n\n### Getting started\n\nAs a starter project, let's center a ~~div~~ node! (I know right!?)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/AnatoleLucet/tess\"\n)\n\nfunc main() {\n  // Create a 500x500 container with children aligned and justified to center\n  root, err := tess.NewNode()\n  root.SetWidth(tess.Point(500)) // Points are the base unit for all measurements (think pixels but with a scale factor applied)\n  root.SetHeight(tess.Point(500))\n  root.SetJustifyContent(tess.JustifyCenter)\n  root.SetAlignItems(tess.AlignCenter)\n\n  // Add a child of 200x200 to the container\n  child, err := tess.NewNode()\n  child.SetWidth(tess.Point(200))\n  child.SetHeight(tess.Point(200))\n  root.AppendChild(child)\n\n  root.ComputeLayout(tess.Container{})\n\n  layout := child.GetLayout()\n  layout.Left() // 150 (child is centered!)\n  layout.Top() // 150\n}\n```\n\n### Styling\n\nApply styles to nodes either by calling setter methods or passing a `Style` struct at creation.\n\n```go\nroot, err := tess.NewNode()\nroot.SetWidth(tess.Point(500))\nroot.SetHeight(tess.Point(500))\n// or\nroot, err := tess.NewNode(\u0026tess.Style{\n  Width: tess.Point(500),\n  Height: tess.Point(500),\n})\n```\n\n#### Units\n\n`tess` supports multiple unit types for sizing and positioning:\n\n```go\nnode.SetWidth(tess.Point(500))    // Absolute points\nnode.SetWidth(tess.Percent(100))  // Percentage of parent\n\nnode.SetWidth(tess.Auto())        // Automatic sizing\nnode.SetWidth(tess.Stretch())     // Stretch to fill\nnode.SetWidth(tess.MaxContent())  // Size to content\nnode.SetWidth(tess.FitContent())  // Fit content with constraints\n\nnode.SetWidth(tess.Undefined())   // Unset (use default behavior)\n```\n\n#### Edges\n\n```go\nnode.SetMargin(tess.Edges{Horizontal: tess.Point(10)})\nnode.SetMargin(tess.Edges{Start: tess.Point(10), End: tess.Point(10)})\n\nnode.SetPadding(tess.Edges{All: tess.Point(20)})\n\nnode.SetBorder(tess.Edges{Bottom: tess.Point(2)})\n```\n\n### Computing layouts\n\nAfter creating your node tree and setting styles, call `ComputeLayout()` to calculate positions and sizes:\n\n```go\nerr := root.ComputeLayout(tess.Container{})\n```\n\nThe Container parameter specifies available space constraints. Pass an empty container to use the root node's dimensions, or specify width/height to constrain the layout:\n\n```go\nerr := root.ComputeLayout(tess.Container{\n  Width: 1920,\n  Height: 1080,\n\n  Direction: tess.RTL, // You can also pass a direction for LTR support!\n})\n```\n\nCall `ComputeLayout()` again whenever you change styles or the node tree to recalculate positions.\n\n### Configuring\n\nConfigs control global layout behavior. By default, all nodes share the same config.\n\n```go\nconfig := tess.NewConfig()\n\n// Controls pixel density for layout rounding - set to your display's DPI scale\nconfig.SetPointScaleFactor(2.0) // e.g. 2x supersampling for high-DPI displays\n\n// Apply config to a node (and optionally its children if they share this config)\nroot, err := tess.NewNode()\nroot.SetConfig(config)\n```\n\n## TODOs\n\n- [x] measurement callbacks\n- [ ] baseline callbacks\n- [ ] more examples\n\n## Credits\n\n- [yoga](https://yogalayout.dev) for powering everything under the hood (_so ~~much~~ little salt in this bad boy_)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floom-go%2Ftess","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floom-go%2Ftess","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floom-go%2Ftess/lists"}