Skip to content

code/editor/DiagnosticsChip

import { … } from 'zidane-ui/code/editor'ui/src/code/editor/DiagnosticsChip.tsx

Components#

DiagnosticsChipComponent#

Shows a file's check state in its header: a spinner, a check mark, counts by severity, or a dashed or warning circle when nothing checks the file or every check failed.

TypeScript
function DiagnosticsChip(props: DiagnosticsChipProps): Element
Parameters
NameTypeDescription
propsDiagnosticsChipProps

state and items pick what the chip shows; label is its tooltip; onClick its action.

Element
DiagnosticsChip props
NameTypeDescription
className?string

Extra classes on the root element.

itemsreadonly EditorDiagnostic[]

The file's findings, counted by severity.

labelstring

The tooltip and the accessible name.

onClick?() => void

Called when the chip is pressed, for example to open the findings.

stateDiagnosticsChipState

Where checking stands. Counts show only while checked.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/code/editor/DiagnosticsChip.tsx:40

Interfaces#

DiagnosticsChipPropsInterface#

Props for DiagnosticsChip.

TypeScript
interface DiagnosticsChipProps
DiagnosticsChipProps properties
NameTypeDescription
className?string

Extra classes on the root element.

itemsreadonly EditorDiagnostic[]

The file's findings, counted by severity.

labelstring

The tooltip and the accessible name.

onClick?() => void

Called when the chip is pressed, for example to open the findings.

stateDiagnosticsChipState

Where checking stands. Counts show only while checked.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/code/editor/DiagnosticsChip.tsx:19

Types#

DiagnosticsChipStateType#

running: a check is under way. checked: something checked the file (counts, or a check mark when clean). idle: nothing checks this file. failed: every check failed.

TypeScript
type DiagnosticsChipState = 'running' | 'checked' | 'idle' | 'failed'

ui/src/code/editor/DiagnosticsChip.tsx:16