TodoItem
One to-do: a link to the view that answers it (#view/tab), drawn as the mock's .todo row: a tinted icon square, the sentence, an arrow. A link, not a button: it goes somewhere, and keeps the component pure.
import { TodoItem } from '@ergasti/bricks';Examples
To-do list
Links that say what needs attention; each has an icon and a tone.
Code
import { TodoItem, TodoItems } from '@ergasti/bricks';
function Todo() {
return (
<div style={{ maxWidth: 520 }}>
<TodoItems>
<TodoItem icon="wallet" tone="rasp" href="#">Your wallet is <b>low (17% left)</b>. Top up so coupons keep working.</TodoItem>
<TodoItem icon="mail" tone="sky" href="#"><b>17 invites</b> are waiting for a creator’s reply</TodoItem>
<TodoItem icon="user" tone="lime" href="#"><b>6 join requests</b> are with the TRNDR team for review</TodoItem>
<TodoItem icon="flag" tone="butter" href="#"><b>1 challenge request</b> is waiting for TRNDR approval</TodoItem>
</TodoItems>
</div>
);
}Props
Prop
Type
Design guidance
How the BRICKS design system uses TodoItem. Written in docs/content/components/TodoItem.md; the props above are read from the code, which wins where the two disagree.
One row of Home's "What needs you" list: a tinted icon square, a sentence and an arrow, linking to the view that answers it; put several inside TodoItems in a card.
It is the mock's .todo row (padding 12 14, 1px line, radius 16, white). Each item is a link, not a button: it goes to the screen and tab that resolve it (#payments/wallet, #creators/requests). TodoItems is the <ul> around them with 10px gaps.
Anatomy
- List:
ul.kit-todos(fromTodoItems), flex column, 10px gap. - Row link:
a.kit-todo, flex, 14px gap,--lineborder, radius 16,--card. - Icon square:
.kit-ic, 38px, radius 12, tint + ink fromtone, 18px stroke icon. - Sentence: your children; bold the count or the key fact.
- Arrow:
.kit-todo-go"→",--ink-3,aria-hidden, mirrored in RTL.
Variants
tone | Icon square | When to use |
|---|---|---|
rasp | --rasp-50 / --rasp | Money or urgent (wallet low). |
sky | --sky / --sky-ink | Waiting on someone else (invites). |
lime | --lime-50 / --olive | Growth (join requests). |
butter | --butter / --butter-ink | Pending approval (challenge requests). |
States
| State | Trigger |
|---|---|
| Default | — |
| Hover | border --rasp-100, background #FFFBFC. |
| Pressed | moves 1px down (none under reduced motion). |
| Focus-visible | kit focus ring. |
| Long text | wraps; icon and arrow stay centred. |
Types
TodoItems: children: ReactNode (required).
Usage
// Brand › Home › To-do card
<Card title="What needs you">
<TodoItems>
<TodoItem icon="wallet" tone="rasp" href="#payments/wallet">Your wallet is <b>low (17% left)</b>. Top up so coupons keep working.</TodoItem>
<TodoItem icon="mail" tone="sky" href="#creators/invitations"><b>17 invites</b> are waiting for a creator’s reply</TodoItem>
<TodoItem icon="user" tone="lime" href="#creators/requests"><b>6 join requests</b> are with the TRNDR team for review</TodoItem>
<TodoItem icon="flag" tone="butter" href="#motivation"><b>1 challenge request</b> is waiting for TRNDR approval</TodoItem>
</TodoItems>
</Card>Where it appears
- Brand › Home › To-do list card (BrandHome).
Guidelines
Do
- One sentence per item, the count in bold, the consequence after it.
- Order by urgency; hide items with nothing to do.
Don't
- Don't use a TodoItem to run an action in place; link to the screen that does it.
- Don't show more than ~5 items.
RTL and Arabic
- Icon at the inline start, arrow at the end and flipped (
scaleX(-1)) in RTL.
Tokens
--card, --line, --ink, --ink-3, --rasp-100, --focus-ring; tone pairs --rasp-50/--rasp, --sky/--sky-ink, --lime-50/--olive, --butter/--butter-ink.
Accessibility
- Each row is a real link inside a list item; its name is the sentence (icon and arrow are decorative).
- Visible focus ring; hover and press feedback are not the only cue.
Found in the source
- ARIA attributes set:
aria-hidden.
Read from the component's source and tests. See Accessibility for the patterns the library follows.
Related
Card: the container.NotificationsMenu: event notifications in the header.RowItems: lists of entities, not tasks.
See also: Icon · TodoItems · Accordion · HeroCard · KeyValue
Source
src/kit/patterns/TodoItem.tsx (line 19) on GitHub.