Skip to main content
zerotal

Documentation


Documentation / @zerotal/admin / index / Entry

Class: Entry

Defined in: admin/src/infolist/Entry.ts:62

Constructors

Constructor

new Entry(key): Entry

Defined in: admin/src/infolist/Entry.ts:91

Parameters

key

string

Returns

Entry

Methods

make()

static make(key): Entry

Defined in: admin/src/infolist/Entry.ts:95

Parameters

key

string

Returns

Entry


label()

label(label): this

Defined in: admin/src/infolist/Entry.ts:102

Human label for the entry. Defaults to a title-cased key.

Parameters

label

string

Returns

this


state()

state(fn): this

Defined in: admin/src/infolist/Entry.ts:108

Derive the value from the whole record instead of record[key].

Parameters

fn

(row) => unknown

Returns

this


default()

default(value): this

Defined in: admin/src/infolist/Entry.ts:114

Value used when the record's value is null/undefined.

Parameters

value

unknown

Returns

this


placeholder()

placeholder(text): this

Defined in: admin/src/infolist/Entry.ts:120

Text shown when the resolved value is empty.

Parameters

text

string

Returns

this


format()

format(fn): this

Defined in: admin/src/infolist/Entry.ts:126

Custom value formatter (runs last in the pipeline).

Parameters

fn

Resolver<string>

Returns

this


badge()

badge(value?): this

Defined in: admin/src/infolist/Entry.ts:134

Render the value inside a colored pill.

Parameters

value?

boolean = true

Returns

this


color()

color(tone): this

Defined in: admin/src/infolist/Entry.ts:140

Badge/text tone — a fixed tone or a function of the value.

Parameters

tone

BadgeTone | Resolver<BadgeTone | null>

Returns

this


icon()

icon(name): this

Defined in: admin/src/infolist/Entry.ts:146

Leading icon (key from ui/icons), fixed or computed.

Parameters

name

string | Resolver<string | null>

Returns

this


boolean()

boolean(value?): this

Defined in: admin/src/infolist/Entry.ts:152

Render as a boolean check/cross icon (IconEntry).

Parameters

value?

boolean = true

Returns

this


copyable()

copyable(value?): this

Defined in: admin/src/infolist/Entry.ts:159

Add a click-to-copy button next to the value.

Parameters

value?

boolean = true

Returns

this


url()

url(fn): this

Defined in: admin/src/infolist/Entry.ts:165

Turn the value into a link.

Parameters

fn

Resolver<string | null>

Returns

this


html()

html(value?): this

Defined in: admin/src/infolist/Entry.ts:171

Treat the formatted value as trusted HTML (rendered as-is).

Parameters

value?

boolean = true

Returns

this


weight()

weight(weight): this

Defined in: admin/src/infolist/Entry.ts:177

Font weight.

Parameters

weight

EntryWeight

Returns

this


size()

size(size): this

Defined in: admin/src/infolist/Entry.ts:183

Text size.

Parameters

size

EntrySize

Returns

this


tooltip()

tooltip(text): this

Defined in: admin/src/infolist/Entry.ts:189

Hover tooltip.

Parameters

text

string

Returns

this


columnSpan()

columnSpan(span): this

Defined in: admin/src/infolist/Entry.ts:195

How many grid columns this entry spans within its section.

Parameters

span

number

Returns

this


limit()

limit(n): this

Defined in: admin/src/infolist/Entry.ts:201

Truncate the formatted value to n characters (adds an ellipsis).

Parameters

n

number

Returns

this


date()

date(): this

Defined in: admin/src/infolist/Entry.ts:209

Format the value as a localized date.

Returns

this


dateTime()

dateTime(): this

Defined in: admin/src/infolist/Entry.ts:215

Format the value as a localized date + time.

Returns

this


since()

since(): this

Defined in: admin/src/infolist/Entry.ts:221

Format the value as a relative time ("3 days ago").

Returns

this


money()

money(currency?): this

Defined in: admin/src/infolist/Entry.ts:227

Format the value as currency.

Parameters

currency?

string = "USD"

Returns

this


getLabel()

getLabel(): string

Defined in: admin/src/infolist/Entry.ts:234

Returns

string


circular()

circular(value?): this

Defined in: admin/src/infolist/Entry.ts:245

Render an image entry as a circle — avatars and logos.

Parameters

value?

boolean = true

Returns

this


height()

height(px): this

Defined in: admin/src/infolist/Entry.ts:251

Pixel height for an image entry (width follows the aspect ratio).

Parameters

px

number

Returns

this


language()

language(name): this

Defined in: admin/src/infolist/Entry.ts:257

Syntax label shown beside a code entry — "json", "sql", "ts".

Parameters

name

string

Returns

this


render()

render(fn): this

Defined in: admin/src/infolist/Entry.ts:272

Render this entry yourself, when no built-in kind fits — a map, a chart, a rendered diff.

textEntry("route").render((v) => )

The renderer replaces the value entirely; the label and column span still come from the entry, because those belong to the section's grid rather than to the value.

Parameters

fn

(value, row) => string | HtmlNode

Returns

this


schema()

schema(entries): this

Defined in: admin/src/infolist/Entry.ts:278

Nested entries rendered once per item of an array-valued attribute.

Parameters

entries

Entry[]

Returns

this


display()

display(row): EntryDisplay

Defined in: admin/src/infolist/Entry.ts:283

Parameters

row

Record<string, unknown>

Returns

EntryDisplay