{"id":24922421,"url":"https://github.com/radioactive-labs/phlexi-field","last_synced_at":"2026-03-03T18:32:29.139Z","repository":{"id":257247675,"uuid":"853902207","full_name":"radioactive-labs/phlexi-field","owner":"radioactive-labs","description":"A field component framework for Ruby applications that provides a unified field abstraction across forms, displays, and tables.","archived":false,"fork":false,"pushed_at":"2025-05-19T16:33:51.000Z","size":119,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-18T18:30:01.236Z","etag":null,"topics":["fields","forms","phlex","rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/radioactive-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2024-09-07T21:15:59.000Z","updated_at":"2025-10-09T08:45:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"7d8747ab-ee1b-4327-82d2-ac08be0571b6","html_url":"https://github.com/radioactive-labs/phlexi-field","commit_stats":null,"previous_names":["radioactive-labs/phlexi-field"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/radioactive-labs/phlexi-field","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactive-labs%2Fphlexi-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactive-labs%2Fphlexi-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactive-labs%2Fphlexi-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactive-labs%2Fphlexi-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/radioactive-labs","download_url":"https://codeload.github.com/radioactive-labs/phlexi-field/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/radioactive-labs%2Fphlexi-field/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30054601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T18:21:05.932Z","status":"ssl_error","status_checked_at":"2026-03-03T18:20:59.341Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fields","forms","phlex","rails"],"created_at":"2025-02-02T11:19:37.981Z","updated_at":"2026-03-03T18:32:29.098Z","avatar_url":"https://github.com/radioactive-labs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phlexi::Form \n\nPhlexi::Form is a flexible and powerful form builder for Ruby applications. It provides a more customizable and extensible way to create forms compared to traditional form helpers.\n\n[![Ruby](https://github.com/radioactive-labs/phlexi-form/actions/workflows/main.yml/badge.svg)](https://github.com/radioactive-labs/phlexi-form/actions/workflows/main.yml)\n\n## Features\n\n- Customizable form components (input, select, checkbox, radio button, etc.)\n- Automatic field type and attribute inference based on model attributes\n- Built-in support for validations and error handling\n- Flexible form structure with support for nested attributes\n- Works with Phlex or erb views\n- Extract input from parameters that match your form definition. No need to strong paramters.\n- Rails compatible form inputs\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'phlexi-form'\n```\n\nAnd then execute:\n\n```\n$ bundle install\n```\n\nOr install it yourself as:\n\n```\n$ gem install phlexi-form\n```\n\n## Usage\n\nThere are 2 ways to use Phlexi::Form:\n\n### Direct Usage\n\n```ruby\nPhlexi::Form(User.new) do\n  field(:name) do |name|\n    render name.label_tag\n    render name.input_tag\n  end\n\n  field(:email) do |email|\n    render email.label_tag\n    render email.input_tag\n  end\n\n  nest_one(:address) do |address|\n    address.field(:street) do |street|\n      render street.label_tag\n      render street.input_tag\n    end\n\n    address.field(:city) do |city|\n      render city.label_tag\n      render city.input_tag\n    end\n  end\n\n  render submit_button\nend\n```\n\n\u003e **Important**\n\u003e\n\u003e If you are rendering your form inline e.g. \n\u003e ```ruby\n\u003e render Phlexi::Form(User.new) {\n\u003e   render field(:name).label_tag\n\u003e   render field(:name).input_tag\n\u003e }\n\u003e ```\n\u003e\n\u003e Make sure you use `{...}` in defining your block instead of `do...end`\n\u003e This might be fixed in a future version.\n\n### Inherit form\n\n```ruby\nclass UserForm \u003c Phlexi::Form::Base\n  def form_template\n    field(:name) do |name|\n      render name.label_tag\n      render name.input_tag\n    end\n\n    field(:email) do |email|\n      render email.label_tag\n      render email.input_tag\n    end\n\n    nest_one(:address) do |address|\n      address.field(:street) do |street|\n        render street.label_tag\n        render street.input_tag\n      end\n\n      address.field(:city) do |city|\n        render city.label_tag\n        render city.input_tag\n      end\n    end\n\n    render submit_button\n  end\nend\n\n\n# In your view or controller\nform = UserForm.new(User.new)\n\n# Render the form\nrender form\n\n# Extract params\nform.extract_input({\n  name: \"Brad Pitt\",\n  email: \"brad@pitt.com\",\n  address: {\n    street: \"Plumbago\",\n    city: \"Accra\",\n  }\n})\n```\n\n## Advanced Usage\n\n### Custom Components\n\nYou can create custom form components by inheriting from `Phlexi::Form::Components::Base`:\n\n```ruby\nclass CustomInput \u003c Phlexi::Form::Components::Base\n  def template\n    div(class: \"custom-input\") do\n      input(**attributes)\n      span(class: \"custom-icon\")\n    end\n  end\nend\n\n# Usage in your form\nfield(:custom_field) do |field|\n  render CustomInput.new(field)\nend\n```\n\n### Theming\n\nPhlexi::Form supports theming through a flexible theming system:\n\n```ruby\nclass ThemedForm \u003c Phlexi::Form::Base\n  class FieldBuilder \u003c FieldBuilder\n    private\n    \n    def default_theme\n      {\n        input: \"border rounded px-2 py-1\",\n        label: \"font-bold text-gray-700\",\n        # Add more theme options here\n      }\n    end\n  end\nend\n```\n\n\u003c!-- ## Configuration\n\nYou can configure Phlexi::Form globally by creating an initializer:\n\n```ruby\n# config/initializers/phlexi_form.rb\nPhlexi::Form.configure do |config|\n  config.default_theme = {\n    # Your default theme options\n  }\n  # Add more configuration options here\nend\n``` --\u003e\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/radioactive-labs/phlexi-form.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradioactive-labs%2Fphlexi-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fradioactive-labs%2Fphlexi-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fradioactive-labs%2Fphlexi-field/lists"}