@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?
Icon for false.
falseText?
string
Text for false.
nullIcon?
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?
Icon for true.
trueText?
string
Text for true.
Returns
CheckboxFormatter
Properties
props
readonlyprops:object={}
Defined in: src/ui/formatters/checkboxformatter.tsx:24
Formatter options.
falseIcon?
optionalfalseIcon:IconClassName
falseText?
optionalfalseText:string
nullIcon?
optionalnullIcon:IconClassName
nullText?
optionalnullText:string
showHint?
optionalshowHint:boolean
showText?
optionalshowText:boolean
trueIcon?
optionaltrueIcon:IconClassName
trueText?
optionaltrueText: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.