Raxol.Core.Renderer.Views.Table (Raxol v0.3.0)

View Source

Table view component for displaying tabular data.

Features:

  • Column headers
  • Row striping
  • Column alignment
  • Border styles
  • Column resizing
  • Row selection

Summary

Functions

Handles dispatched events.

Initializes the Table component with props. Props are expected to be a map.

Called when the component is mounted.

Renders the Table component based on its current state.

Called when the component is about to be unmounted.

Handles updates to the component state.

Types

column()

@type column() :: %{
  header: String.t(),
  key: atom() | (map() -> term()),
  width: non_neg_integer() | :auto,
  align: :left | :center | :right,
  format: (term() -> String.t()) | nil
}

props()

@type props() :: %{
  columns: [column()],
  data: [map()],
  border: Raxol.Core.Renderer.View.border_style(),
  striped: boolean(),
  selectable: boolean(),
  selected: non_neg_integer() | nil,
  header_style: Raxol.Core.Renderer.View.style(),
  row_style: Raxol.Core.Renderer.View.style()
}

Functions

handle_event(event, state)

Handles dispatched events.

init(props)

Initializes the Table component with props. Props are expected to be a map.

mount(state)

Called when the component is mounted.

render(state)

Renders the Table component based on its current state.

unmount(state)

Called when the component is about to be unmounted.

update(message, state)

Handles updates to the component state.