{"id":20887940,"url":"https://github.com/canop/flex-grow","last_synced_at":"2025-11-21T06:05:00.993Z","repository":{"id":254131117,"uuid":"845605758","full_name":"Canop/flex-grow","owner":"Canop","description":"Tiny utility computing allocation of size among children, with a flex/grow logic","archived":false,"fork":false,"pushed_at":"2024-08-21T15:11:55.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T12:44:58.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Canop.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}},"created_at":"2024-08-21T15:11:00.000Z","updated_at":"2025-06-13T20:22:05.000Z","dependencies_parsed_at":"2024-08-21T16:27:46.419Z","dependency_job_id":"2b5b9e0a-13a0-482c-af8f-e2c62a53f5e1","html_url":"https://github.com/Canop/flex-grow","commit_stats":null,"previous_names":["canop/flex-grow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Canop/flex-grow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fflex-grow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fflex-grow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fflex-grow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fflex-grow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Canop","download_url":"https://codeload.github.com/Canop/flex-grow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Canop%2Fflex-grow/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285566567,"owners_count":27193546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-21T02:00:06.175Z","response_time":61,"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":[],"created_at":"2024-11-18T08:23:26.418Z","updated_at":"2025-11-21T06:05:00.977Z","avatar_url":"https://github.com/Canop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT][s2]][l2] [![Latest Version][s1]][l1] [![docs][s3]][l3] [![Chat on Miaou][s4]][l4]\n\n[s1]: https://img.shields.io/crates/v/flex-grow.svg\n[l1]: https://crates.io/crates/flex-grow\n\n[s2]: https://img.shields.io/badge/license-MIT-blue.svg\n[l2]: LICENSE\n\n[s3]: https://docs.rs/flex-grow/badge.svg\n[l3]: https://docs.rs/flex-grow/\n\n[s4]: https://miaou.dystroy.org/static/shields/room.svg\n[l4]: https://miaou.dystroy.org/3\n\n\nTiny utility computing the allocation of a size among \"children\".\n\nTypical use case: decide what columns to show in an UI, and what size to give to each column.\n\nEach child can have a min and max size, be optional with a priority, have a `grow` factor.\n\nExample:\n\n```\nuse flex_grow::{Child, Container};\n\nlet container = Container::builder_in(50)\n    .with_margin_between(1)\n    .with(Child::new(\"name\").clamp(5, 10))\n    .with(Child::new(\"price\").with_size(8).optional_with_priority(7))\n    .with(Child::new(\"quantity\").with_size(8).optional())\n    .with(Child::new(\"total\").with_size(8))\n    .with(Child::new(\"comments\").with_min(10).with_grow(2.0))\n    .with(Child::new(\"vendor\").with_size(60).optional_with_priority(9))\n    .build()\n    .unwrap();\nassert_eq!(container.sizes(), vec![7, 8, 8, 8, 15, 0]);\n```\n\nYou can give any argument to `Child::new`, it's stored in the child and returned by the `content()` method.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanop%2Fflex-grow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanop%2Fflex-grow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanop%2Fflex-grow/lists"}