Skip to content

@serenity-is/corelib / CheckboxFormatter

Class: CheckboxFormatter

Defined in: src/ui/formatters/checkboxformatter.tsx:9

Renders a boolean as a checkbox-like visual (with optional text). In grid display the checkbox is read-only; in header-filter context it falls back to text/icon.

Implements

Constructors

Constructor

new CheckboxFormatter(props): CheckboxFormatter

Defined in: src/ui/formatters/checkboxformatter.tsx:24

Creates a new CheckboxFormatter.

Parameters

props

Formatter options.

falseIcon?

IconClassName

Icon for false.

falseText?

string

Text for false.

nullIcon?

IconClassName

Icon for null.

nullText?

string

Text for null.

showHint?

boolean

Whether to surface text as title hint.

showText?

boolean

Whether to show text (defaults to true, or false in grid cells).

trueIcon?

IconClassName

Icon for true.

trueText?

string

Text for true.

Returns

CheckboxFormatter

Properties

props

readonly props: object = {}

Defined in: src/ui/formatters/checkboxformatter.tsx:24

Formatter options.

falseIcon?

optional falseIcon: IconClassName

falseText?

optional falseText: string

nullIcon?

optional nullIcon: IconClassName

nullText?

optional nullText: string

showHint?

optional showHint: boolean

showText?

optional showText: boolean

trueIcon?

optional trueIcon: IconClassName

trueText?

optional trueText: string


[typeInfo]

static [typeInfo]: FormatterTypeInfo<"Serenity.">

Defined in: src/ui/formatters/checkboxformatter.tsx:10

Methods

format()

format(ctx): FormatterResult

Defined in: src/ui/formatters/checkboxformatter.tsx:42

Formats the boolean value as a checkbox or icon/text markup.

Parameters

ctx

FormatterContext

Formatter context containing the cell value.

Returns

FormatterResult

Checkbox, icon, or text markup for the cell.

Implementation of

Formatter.format