KeyTakeaway
ExperimentalA labeled box for the closing point of an answer.
Also known as takeaway, highlight, summary point
Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.
Ending an answer
Key takeaway
Returning customers drove the gain. Look into why people left the smallest plan.
<KeyTakeaway>Returning customers drove the gain. Look into why people left the smallest plan.</KeyTakeaway>When to use it
Sets the closing point of a long answer apart, so a reader who skims still finds it. A visible label and an icon mark it, so it does not rely on color.
Made of: Icon · Label · Summary
Use it for
- The one to three sentence conclusion at the end of a long answer.
- A recommendation that follows from the facts above it.
Not for
- Warnings, limits or errors: use Callout.
- A whole overview with sources and feedback: use SummaryCard.
Do and avoid
Key takeaway
The refundable room costs 20 euros more but can be cancelled until Friday.
Key takeaway
Your passport runs out before the trip. Renew it now.
Do
- Use it once, at the end of a long answer.
- Write a full sentence that makes sense on its own.
- Keep the label visible.
- Put it after the facts it sums up.
Avoid
- Do not use it for warnings. Use Callout.
- Do not repeat the whole answer.
- Do not use several in one answer.
- Do not hide the label.
On a phone
- Fills the width of its container, and the text wraps inside the box.
- The small label is 12px on a touch screen.
Seen in products
- Our research table lists this as a labeled area. Only the accessibility rules in that table have sources.
- W3C guidance says not to rely on color alone.
Properties
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | "Key takeaway" | Visible label. Also the accessible name of the region. |
| childrenrequired | ReactNode | none | One to three sentences. |
| className | string | none | Extra classes on the section. |
"Show code under the preview gives the code for the example on the stage."
Tokens
Change one of these and every part that uses it follows.
--surface-sunken--lime--on-lime--border--radius-card
Built in
- Screen readers hear it as a section named by its visible label, so people can jump to it.
- The icon is hidden from screen readers. The label carries the meaning.
What you need to do
- Write a label that makes sense on its own, because screen readers use it as the section's name.
- Use only one per answer, so the named sections stay easy to tell apart.
Built toward WCAG 2.2 AA and checked automatically; no independent audit yet. Read the accessibility guide