components/Checklist
import { … } from 'zidane-ui'ui/src/components/Checklist.tsx
Components#
ChecklistComponent#
Renders the groups as one grid of checks, or as cards.
function Checklist(props: ChecklistProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | ChecklistProps |
Returns
ElementProps
| Name | Type | Default | Description |
|---|---|---|---|
| className? | string | Extra classes on the root element. | |
| groupLabel? | string | The header over the group names in the grid, such as "Package". | |
| groups | readonly ChecklistGroup[] | The groups, in order. | |
| style? | CSSProperties | Inline styles on the root element. | |
| summary? | boolean | true | The count done, drawn large under the title. Off when a |
| title? | ReactNode | A title above the checks. |
Functions#
checklistIsGridFunction#
Whether every group has the same check labels in the same order, so the checks draw as one grid.
function checklistIsGrid(groups: readonly ChecklistGroup[]): booleanParameters
| Name | Type | Description |
|---|---|---|
| groups | readonly ChecklistGroup[] | The groups. |
Returns
booleanInterfaces#
ChecklistGroupInterface#
One group of checks: a package, a host, a step.
interface ChecklistGroupProperties
| Name | Type | Description |
|---|---|---|
| items | readonly ChecklistItem[] | The group's checks, in order. |
| label | string | The group's name. |
ChecklistItemInterface#
One check of a ChecklistGroup.
interface ChecklistItemProperties
| Name | Type | Description |
|---|---|---|
| label | string | What the check is. |
| note? | string | A short line after the label. |
| status | ChecklistStatus | How the check went. |
ChecklistPropsInterface#
Props for Checklist.
interface ChecklistPropsProperties
| Name | Type | Default | Description |
|---|---|---|---|
| className? | string | Extra classes on the root element. | |
| groupLabel? | string | The header over the group names in the grid, such as "Package". | |
| groups | readonly ChecklistGroup[] | The groups, in order. | |
| style? | CSSProperties | Inline styles on the root element. | |
| summary? | boolean | true | The count done, drawn large under the title. Off when a |
| title? | ReactNode | A title above the checks. |
Types#
ChecklistStatusType#
How one check went.
type ChecklistStatus = 'done' | 'failed' | 'pending'