Skip to content

feat: v3 release#48

Merged
Delta456 merged 70 commits intomasterfrom
v3
Feb 9, 2026
Merged

feat: v3 release#48
Delta456 merged 70 commits intomasterfrom
v3

Conversation

@Delta456
Copy link
Copy Markdown
Collaborator

@Delta456 Delta456 commented Feb 9, 2026

v3 release with the following changes

New Features in v3 (Not in v2)

  • Fluent, chainable API: Configure boxes with method chaining for clarity and brevity.
  • Strongly typed options: Use constants for box styles, alignments, and title positions (e.g., box.Single, box.Center, box.Top).
  • Improved color support: Accepts named ANSI colors, hex codes (e.g., #FF00FF), and XParseColor strings.
  • Explicit content wrapping: Easily enable/disable wrapping and set wrap limits with .WrapContent() and .WrapLimit().
  • Box copying: Use .Copy() to duplicate box configurations.
  • Better error handling: Render() returns errors for invalid configurations; MustRender() panics on error for convenience.
  • Simplified custom glyphs: Set custom border characters with dedicated methods (e.g., .TopLeft("+")).
  • Cleaner API surface: Deprecated methods and fields removed for a more focused experience.
  • Accurate rendering of emoji and custom borders: v3 ensures correct box layout even when using emojis or custom borders (where border symbols may be different for each side or corner), especially when the title is longer than the content and the title position is set to Top or Bottom.
  • New Block Box style: Render boxes with a brand new inbuilt block box style.

Breaking Changes (v2 → v3)

Area v2 Example / Behavior v3 Example / Behavior
Module Path module github.com/Delta456/box-cli-maker/v2 module github.com/box-cli-maker/box-cli-maker/v3
Import Path import box "github.com/Delta456/box-cli-maker/v2" import box "github.com/box-cli-maker/box-cli-maker/v3"
Box Construction box.New(box.Config{...}) box.NewBox().Style(...).Padding(...)...
Config Options Strings for style, alignment, etc. (Type: "Single") Strongly typed constants (.Style(box.Single))
Field Names Type, TitlePos, ContentAlign .Style(), .TitlePosition(), .ContentAlign()
Color Handling Various types and string names Only named ANSI colors, hex (#RGB, #RRGGBB), or XParseColor formats
Rendering b.String("Title", "Content") b.MustRender("Title", "Content") or b.Render(...)
Print Methods b.Print(), b.Println() Removed; use fmt.Println(b.MustRender(...))
Wrapping Implicit/less explicit .WrapContent(true), .WrapLimit(width)
Custom Glyphs Config struct fields (e.g., TopLeft: "+") Methods (e.g., .TopLeft("+"))
Cloning/Copying Assignment or manual copy .Copy() method
Deprecated/Removed Config struct, string-based config, undocumented color formats, Print methods, etc. All replaced by new API; only documented color formats and methods remain

Example

v2:

import box "github.com/Delta456/box-cli-maker/v2"

cfg := box.Config{
	Type:         "Single",
	Px:           2,
	Py:           1,
	ContentAlign: "Center",
	TitlePos:     "Top",
	Color:        "Cyan",
	TitleColor:   "BrightYellow",
}
b := box.New(cfg)
fmt.Println(b.String("Box CLI Maker", "Render highly customizable boxes\n in the terminal"))

v3:

import box "github.com/box-cli-maker/box-cli-maker/v3"

b := box.NewBox().
	Style(box.Single).
	Padding(2, 1).  // horizontal, vertical
	TitlePosition(box.Top).
	ContentAlign(box.Center).
	Color(box.Cyan).
	TitleColor(box.BrightYellow)

fmt.Println(b.MustRender("Box CLI Maker", "Render highly customizable boxes\n in the terminal"))

@Delta456 Delta456 changed the title feat: v3 feat: v3 release Feb 9, 2026
@Delta456 Delta456 merged commit 4291f90 into master Feb 9, 2026
1 check passed
@Delta456 Delta456 deleted the v3 branch February 16, 2026 16:01
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.

1 participant