vty-ui-1.0: An interactive terminal user interface library for Vty



This module provides a table layout widget capable of laying out columns of widgets with various padding and alignment properties. For complete details, please see the Vty-ui User's Manual.



data TableCell Source

The wrapper type for all table cells; stores the widgets themselves in addition to alignment and padding settings. Alignment and padding settings on a cell override the column- and table-wide defaults.

data ColumnSize Source

The type of column size policies.


ColFixed Int

The column has the specified fixed width in columns.


The column's width is a function of space available to the table at rendering time.

data BorderStyle Source

The border configuration of a table.


BorderPartial [BorderFlag] 

A partial set of border flags.


Don't draw any borders anywhere.

data BorderFlag Source

The types of borders we can have in a table.



Borders between rows.


Borders between columns.


Borders around the outside edges of the table.

class RowLike a Source

The class of types whose values can be used to construct table rows.


RowLike TableRow 
RowLike TableCell 
RowLike a => RowLike [a] 
Show a => RowLike (Widget a) 

data TableError Source



A row added to the table did not have the same number of widgets as the table has columns.


The image rendered by a cell widget exceeded the size permitted by the cell.

BadTableWidgetSizePolicy Int

A table cell contains a widget which grows vertically, which is not permitted.

data ColumnSpec Source

The specification of a column's settings. The alignment and padding of a column specification override the table-wide default.

data Alignment Source

Column alignment values.


class Alignable a whereSource

The class of types whose values can be aligned.


align :: a -> Alignment -> aSource

(.|.) :: (RowLike a, RowLike b) => a -> b -> TableRowSource

Row constructor using RowLike instances.

newTable :: MonadIO m => [ColumnSpec] -> BorderStyle -> m (Widget Table)Source

Create a table widget using a list of column specifications and a border style.

setDefaultCellAlignment :: MonadIO m => Widget Table -> Alignment -> m ()Source

Set the default table-wide cell alignment.

setDefaultCellPadding :: MonadIO m => Widget Table -> Padding -> m ()Source

Set the default table-wide cell padding.

addRow :: (MonadIO m, RowLike a) => Widget Table -> a -> m ()Source

Add a row to the table. Use RowLike instances to populate the row. Throws BadTableWidgetSizePolicy if any widgets in the row grow vertically; throws ColumnCountMismatch if the row's number of columns does not match the table's column count.

column :: ColumnSize -> ColumnSpecSource

Create a column.

customCell :: Show a => Widget a -> TableCellSource

Create a custom TableCell to set its alignment and/or padding settings.

emptyCell :: TableCellSource

Create an empty table cell.