Skip to content

feat(components): add visual checkbox component using shapes#547

Merged
johnfercher merged 1 commit intojohnfercher:feat/checkboxfrom
vamshi1188:master
Mar 15, 2026
Merged

feat(components): add visual checkbox component using shapes#547
johnfercher merged 1 commit intojohnfercher:feat/checkboxfrom
vamshi1188:master

Conversation

@vamshi1188
Copy link
Copy Markdown

Introduces a new Checkbox component rendered using shapes instead of Unicode
characters or PDF form fields.

This component is visual-only by design and aligns with Maroto v2 layout philosophy.

Description

Maroto currently does not provide a native way to render checkbox-style
selections (e.g. gender, marital status). Unicode-based approaches are unreliable
due to font limitations, and interactive PDF form fields are outside Maroto’s
scope.

This PR introduces a deterministic, layout-safe Checkbox component implemented
using shapes and text, ensuring consistent rendering across PDF viewers while
respecting Maroto’s component-based design.

Related Issue

Checklist

  • Wrote unit tests for new/changed features.
  • Updated example_test.go.
  • New public methods/structs/interfaces have comments explaining their responsibilities.

Introduces a new Checkbox component rendered using shapes instead of
Unicode characters or PDF form fields.

- Adds checkbox component and props
- Implements rendering in gofpdf provider
- Includes unit tests, examples, and golden tests
- Addresses issue johnfercher#488

This component is visual-only by design and aligns with Maroto v2 layout philosophy.
@johnfercher
Copy link
Copy Markdown
Owner

Thanks! I will merge it to a develop branch and then to master.

@johnfercher johnfercher changed the base branch from master to feat/checkbox March 15, 2026 00:56
@johnfercher johnfercher merged commit b3b4a00 into johnfercher:feat/checkbox Mar 15, 2026
@johnfercher
Copy link
Copy Markdown
Owner

There is a problem with the implementation with the grid system: #552

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is there any way to add check boxes for gender selection or marital status selection

2 participants