Raxol.Core.Renderer.View.Borders (Raxol v2.0.1)

View Source

Border-related functions for the View module. Extracted from the main View module to improve maintainability.

Summary

Functions

Wraps a view with a border using a block style.

Wraps a view with a border using a bold style.

Wraps a view with a border using a double line style.

Wraps a view with a border using a rounded style.

Wraps a view with a border using a simple style.

Wraps a view with a border, optionally with a title and style.

Functions

block_border(view, opts \\ [])

Wraps a view with a border using a block style.

Parameters

  • view - The view to wrap with a border
  • opts - Options for the border
    • :title - Optional title to display in the border
    • :align - Title alignment (:left, :center, :right)

Examples

Borders.block_border(view)
Borders.block_border(view, title: "Title")

bold_border(view, opts \\ [])

Wraps a view with a border using a bold style.

Parameters

  • view - The view to wrap with a border
  • opts - Options for the border
    • :title - Optional title to display in the border
    • :align - Title alignment (:left, :center, :right)

Examples

Borders.bold_border(view)
Borders.bold_border(view, title: "Title")

double_border(view, opts \\ [])

Wraps a view with a border using a double line style.

Parameters

  • view - The view to wrap with a border
  • opts - Options for the border
    • :title - Optional title to display in the border
    • :align - Title alignment (:left, :center, :right)

Examples

Borders.double_border(view)
Borders.double_border(view, title: "Title")

rounded_border(view, opts \\ [])

Wraps a view with a border using a rounded style.

Parameters

  • view - The view to wrap with a border
  • opts - Options for the border
    • :title - Optional title to display in the border
    • :align - Title alignment (:left, :center, :right)

Examples

Borders.rounded_border(view)
Borders.rounded_border(view, title: "Title")

simple_border(view, opts \\ [])

Wraps a view with a border using a simple style.

Parameters

  • view - The view to wrap with a border
  • opts - Options for the border
    • :title - Optional title to display in the border
    • :align - Title alignment (:left, :center, :right)

Examples

Borders.simple_border(view)
Borders.simple_border(view, title: "Title")

wrap_with_border(view, opts \\ [])

Wraps a view with a border, optionally with a title and style.

Parameters

  • view - The view to wrap with a border
  • opts - Options for the border
    • :title - Optional title to display in the border
    • :style - Border style (:single, :double, :rounded, :bold, :block, :simple)
    • :align - Title alignment (:left, :center, :right)

Examples

Borders.wrap_with_border(view, style: :single)
Borders.wrap_with_border(view, title: "Title", style: :double)