@nvidia/foundations-css 0.0.0-stage → 1.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/LICENSE.md +203 -0
- package/NOTICE.md +62 -0
- package/README.md +61 -2
- package/dist/base/a11y.css +1 -0
- package/dist/base/all.js +1225 -0
- package/dist/base/anchor.css +1 -0
- package/dist/base/base-external.css +15 -0
- package/dist/base/base-for-aem-only.css +15 -0
- package/dist/base/base.css +15 -0
- package/dist/base/fonts-external.css +1 -0
- package/dist/base/fonts.css +1 -0
- package/dist/base/icons.css +15 -0
- package/dist/base/motion.css +1 -0
- package/dist/base/reset.css +1 -0
- package/dist/base/theme-dark.css +1 -0
- package/dist/base/theme-density.css +1 -0
- package/dist/base/theme-light.css +1 -0
- package/dist/base/theme-only-dark.css +1 -0
- package/dist/base/top-layer-reset.css +1 -0
- package/dist/base/variables.css +1 -0
- package/dist/components/accordion.css +1 -0
- package/dist/components/all.css +1 -0
- package/dist/components/all.js +16546 -0
- package/dist/components/anchor.css +1 -0
- package/dist/components/animated-chevron.css +1 -0
- package/dist/components/app-bar.css +1 -0
- package/dist/components/attachment.css +1 -0
- package/dist/components/audio.css +1 -0
- package/dist/components/autocomplete.css +1 -0
- package/dist/components/avatar-group.css +1 -0
- package/dist/components/avatar.css +1 -0
- package/dist/components/badge.css +1 -0
- package/dist/components/banner.css +1 -0
- package/dist/components/block.css +1 -0
- package/dist/components/breadcrumbs.css +1 -0
- package/dist/components/button.css +1 -0
- package/dist/components/card.css +1 -0
- package/dist/components/carousel.css +1 -0
- package/dist/components/chat-bubble.css +1 -0
- package/dist/components/checkbox.css +1 -0
- package/dist/components/code-snippet.css +1 -0
- package/dist/components/collapsible.css +1 -0
- package/dist/components/combobox.css +1 -0
- package/dist/components/command.css +1 -0
- package/dist/components/context-menu.css +1 -0
- package/dist/components/date-picker.css +1 -0
- package/dist/components/divider.css +1 -0
- package/dist/components/dropdown.css +1 -0
- package/dist/components/flex.css +1 -0
- package/dist/components/form-field.css +1 -0
- package/dist/components/grid-item.css +1 -0
- package/dist/components/grid.css +1 -0
- package/dist/components/group.css +1 -0
- package/dist/components/halo.css +1 -0
- package/dist/components/hero.css +1 -0
- package/dist/components/horizontal-nav.css +1 -0
- package/dist/components/hover-card.css +1 -0
- package/dist/components/inline-notice.css +1 -0
- package/dist/components/input-shell.css +1 -0
- package/dist/components/jump-nav.css +1 -0
- package/dist/components/kbd.css +1 -0
- package/dist/components/key-value-editor.css +1 -0
- package/dist/components/key-value-group.css +1 -0
- package/dist/components/label.css +1 -0
- package/dist/components/legend.css +1 -0
- package/dist/components/list.css +1 -0
- package/dist/components/menu.css +1 -0
- package/dist/components/meter.css +1 -0
- package/dist/components/modal.css +1 -0
- package/dist/components/notification.css +1 -0
- package/dist/components/otp-input.css +1 -0
- package/dist/components/page-header.css +1 -0
- package/dist/components/pagination.css +1 -0
- package/dist/components/panel.css +1 -0
- package/dist/components/popover.css +1 -0
- package/dist/components/primitive.css +1 -0
- package/dist/components/progress-bar.css +1 -0
- package/dist/components/radio-group.css +1 -0
- package/dist/components/range-slider.css +1 -0
- package/dist/components/rating.css +1 -0
- package/dist/components/reaction-group.css +1 -0
- package/dist/components/resizable.css +1 -0
- package/dist/components/segmented-control.css +1 -0
- package/dist/components/segmented-meter.css +1 -0
- package/dist/components/select.css +1 -0
- package/dist/components/severity.css +1 -0
- package/dist/components/side-panel.css +1 -0
- package/dist/components/skeleton.css +1 -0
- package/dist/components/slider.css +1 -0
- package/dist/components/spinner.css +1 -0
- package/dist/components/status-indicator.css +1 -0
- package/dist/components/status-message.css +1 -0
- package/dist/components/stepper.css +1 -0
- package/dist/components/switch.css +1 -0
- package/dist/components/table.css +1 -0
- package/dist/components/tabs.css +1 -0
- package/dist/components/tag-group.css +1 -0
- package/dist/components/tag.css +1 -0
- package/dist/components/terminal-line.css +1 -0
- package/dist/components/text-area.css +1 -0
- package/dist/components/text-content.css +1 -0
- package/dist/components/text.css +1 -0
- package/dist/components/toast.css +1 -0
- package/dist/components/toaster.css +1 -0
- package/dist/components/toggle-button-group.css +1 -0
- package/dist/components/toggle-button.css +1 -0
- package/dist/components/tooltip.css +1 -0
- package/dist/components/tree-nav.css +1 -0
- package/dist/components/upload.css +1 -0
- package/dist/components/vertical-nav.css +1 -0
- package/dist/css-sizes.js +1279 -0
- package/dist/index.cjs +3041 -0
- package/dist/index.d.cts +27 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +3014 -0
- package/dist/plugins/tailwind-theme.css +504 -0
- package/dist/plugins/tailwind3-theme.js +682 -0
- package/dist/plugins/variables-sass.sass +414 -0
- package/dist/themes/kui11/_theme-selectors.css +1 -0
- package/dist/themes/kui11/accordion.css +1 -0
- package/dist/themes/kui11/app-bar.css +1 -0
- package/dist/themes/kui11/avatar.css +1 -0
- package/dist/themes/kui11/badge.css +1 -0
- package/dist/themes/kui11/banner.css +1 -0
- package/dist/themes/kui11/base.css +1 -0
- package/dist/themes/kui11/breadcrumbs.css +1 -0
- package/dist/themes/kui11/button.css +1 -0
- package/dist/themes/kui11/card.css +1 -0
- package/dist/themes/kui11/checkbox.css +1 -0
- package/dist/themes/kui11/components.css +1 -0
- package/dist/themes/kui11/date-picker.css +1 -0
- package/dist/themes/kui11/form-field.css +1 -0
- package/dist/themes/kui11/hero.css +1 -0
- package/dist/themes/kui11/horizontal-nav.css +1 -0
- package/dist/themes/kui11/input-shell.css +1 -0
- package/dist/themes/kui11/label.css +1 -0
- package/dist/themes/kui11/menu.css +1 -0
- package/dist/themes/kui11/modal.css +1 -0
- package/dist/themes/kui11/notification.css +1 -0
- package/dist/themes/kui11/page-header.css +1 -0
- package/dist/themes/kui11/pagination.css +1 -0
- package/dist/themes/kui11/popover.css +1 -0
- package/dist/themes/kui11/progress-bar.css +1 -0
- package/dist/themes/kui11/radio-group.css +1 -0
- package/dist/themes/kui11/range-slider.css +1 -0
- package/dist/themes/kui11/side-panel.css +1 -0
- package/dist/themes/kui11/slider.css +1 -0
- package/dist/themes/kui11/spinner.css +1 -0
- package/dist/themes/kui11/status-message.css +1 -0
- package/dist/themes/kui11/switch.css +1 -0
- package/dist/themes/kui11/table.css +1 -0
- package/dist/themes/kui11/tabs.css +1 -0
- package/dist/themes/kui11/tag.css +1 -0
- package/dist/themes/kui11/text-area.css +1 -0
- package/dist/themes/kui11/text-input.css +1 -0
- package/dist/themes/kui11/text.css +1 -0
- package/dist/themes/kui11/toast.css +1 -0
- package/dist/themes/kui11/tooltip.css +1 -0
- package/dist/themes/kui11/vertical-nav.css +1 -0
- package/dist/themes/kui11.base.css +1 -0
- package/dist/themes/kui11.base.js +935 -0
- package/dist/themes/kui11.components.css +1 -0
- package/dist/themes/kui11.components.js +2564 -0
- package/dist/themes/kui11.css +1 -0
- package/dist/themes/theme-partials.js +456 -0
- package/dist/utilities/all.js +442 -0
- package/dist/utilities/typography-utils.css +1 -0
- package/package.json +106 -3
- package/scripts/sync-skills.mjs +237 -0
- package/skills/kaizen-ui-html-css/SKILL.md +293 -0
- package/skills/kaizen-ui-html-css/assets/color-primitives-hex.md +141 -0
- package/skills/kaizen-ui-html-css/references/blocks/chat-input.md +94 -0
- package/skills/kaizen-ui-html-css/references/blocks/notification-center.md +320 -0
- package/skills/kaizen-ui-html-css/references/blocks/timeline.md +579 -0
- package/skills/kaizen-ui-html-css/references/components/Accordion.md +88 -0
- package/skills/kaizen-ui-html-css/references/components/Anchor.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/AnimatedChevron.md +31 -0
- package/skills/kaizen-ui-html-css/references/components/AppBar.md +129 -0
- package/skills/kaizen-ui-html-css/references/components/Attachment.md +306 -0
- package/skills/kaizen-ui-html-css/references/components/Audio.md +21 -0
- package/skills/kaizen-ui-html-css/references/components/Autocomplete.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/Avatar.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/AvatarGroup.md +38 -0
- package/skills/kaizen-ui-html-css/references/components/Badge.md +121 -0
- package/skills/kaizen-ui-html-css/references/components/Banner.md +49 -0
- package/skills/kaizen-ui-html-css/references/components/Block.md +26 -0
- package/skills/kaizen-ui-html-css/references/components/Breadcrumbs.md +42 -0
- package/skills/kaizen-ui-html-css/references/components/Button.md +43 -0
- package/skills/kaizen-ui-html-css/references/components/ButtonGroup.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/Card.md +39 -0
- package/skills/kaizen-ui-html-css/references/components/Carousel.md +53 -0
- package/skills/kaizen-ui-html-css/references/components/ChatBubble.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/Checkbox.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/CodeSnippet.md +33 -0
- package/skills/kaizen-ui-html-css/references/components/Collapsible.md +56 -0
- package/skills/kaizen-ui-html-css/references/components/Combobox.md +66 -0
- package/skills/kaizen-ui-html-css/references/components/Command.md +100 -0
- package/skills/kaizen-ui-html-css/references/components/ContextMenu.md +61 -0
- package/skills/kaizen-ui-html-css/references/components/DatePicker.md +30 -0
- package/skills/kaizen-ui-html-css/references/components/Divider.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/Dropdown.md +94 -0
- package/skills/kaizen-ui-html-css/references/components/Flex.md +33 -0
- package/skills/kaizen-ui-html-css/references/components/FormField.md +35 -0
- package/skills/kaizen-ui-html-css/references/components/Grid.md +27 -0
- package/skills/kaizen-ui-html-css/references/components/Group.md +92 -0
- package/skills/kaizen-ui-html-css/references/components/Halo.md +26 -0
- package/skills/kaizen-ui-html-css/references/components/Hero.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/HorizontalNav.md +34 -0
- package/skills/kaizen-ui-html-css/references/components/HoverCard.md +23 -0
- package/skills/kaizen-ui-html-css/references/components/Inline.md +49 -0
- package/skills/kaizen-ui-html-css/references/components/InlineNotice.md +96 -0
- package/skills/kaizen-ui-html-css/references/components/InputShell.md +26 -0
- package/skills/kaizen-ui-html-css/references/components/JumpNav.md +36 -0
- package/skills/kaizen-ui-html-css/references/components/Kbd.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/KeyValueEditor.md +275 -0
- package/skills/kaizen-ui-html-css/references/components/KeyValueGroup.md +35 -0
- package/skills/kaizen-ui-html-css/references/components/Label.md +86 -0
- package/skills/kaizen-ui-html-css/references/components/Legend.md +148 -0
- package/skills/kaizen-ui-html-css/references/components/List.md +143 -0
- package/skills/kaizen-ui-html-css/references/components/Menu.md +103 -0
- package/skills/kaizen-ui-html-css/references/components/Meter.md +27 -0
- package/skills/kaizen-ui-html-css/references/components/Modal.md +60 -0
- package/skills/kaizen-ui-html-css/references/components/Notification.md +48 -0
- package/skills/kaizen-ui-html-css/references/components/NumberInput.md +15 -0
- package/skills/kaizen-ui-html-css/references/components/OtpInput.md +51 -0
- package/skills/kaizen-ui-html-css/references/components/PageHeader.md +61 -0
- package/skills/kaizen-ui-html-css/references/components/Pagination.md +63 -0
- package/skills/kaizen-ui-html-css/references/components/Panel.md +133 -0
- package/skills/kaizen-ui-html-css/references/components/Popover.md +31 -0
- package/skills/kaizen-ui-html-css/references/components/ProgressBar.md +187 -0
- package/skills/kaizen-ui-html-css/references/components/RadioGroup.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/RangeSlider.md +62 -0
- package/skills/kaizen-ui-html-css/references/components/Rating.md +69 -0
- package/skills/kaizen-ui-html-css/references/components/ReactionGroup.md +30 -0
- package/skills/kaizen-ui-html-css/references/components/Resizable.md +31 -0
- package/skills/kaizen-ui-html-css/references/components/SegmentedControl.md +36 -0
- package/skills/kaizen-ui-html-css/references/components/SegmentedMeter.md +200 -0
- package/skills/kaizen-ui-html-css/references/components/Select.md +39 -0
- package/skills/kaizen-ui-html-css/references/components/Severity.md +25 -0
- package/skills/kaizen-ui-html-css/references/components/SidePanel.md +42 -0
- package/skills/kaizen-ui-html-css/references/components/Skeleton.md +24 -0
- package/skills/kaizen-ui-html-css/references/components/Slider.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/Spinner.md +63 -0
- package/skills/kaizen-ui-html-css/references/components/Stack.md +17 -0
- package/skills/kaizen-ui-html-css/references/components/StatusIndicator.md +30 -0
- package/skills/kaizen-ui-html-css/references/components/StatusMessage.md +78 -0
- package/skills/kaizen-ui-html-css/references/components/Stepper.md +57 -0
- package/skills/kaizen-ui-html-css/references/components/Switch.md +96 -0
- package/skills/kaizen-ui-html-css/references/components/Table.md +566 -0
- package/skills/kaizen-ui-html-css/references/components/Tabs.md +67 -0
- package/skills/kaizen-ui-html-css/references/components/Tag.md +194 -0
- package/skills/kaizen-ui-html-css/references/components/TagGroup.md +32 -0
- package/skills/kaizen-ui-html-css/references/components/TerminalLine.md +69 -0
- package/skills/kaizen-ui-html-css/references/components/Text.md +27 -0
- package/skills/kaizen-ui-html-css/references/components/TextArea.md +28 -0
- package/skills/kaizen-ui-html-css/references/components/TextContent.md +61 -0
- package/skills/kaizen-ui-html-css/references/components/TextInput.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/TimeInput.md +17 -0
- package/skills/kaizen-ui-html-css/references/components/Toast.md +41 -0
- package/skills/kaizen-ui-html-css/references/components/Toaster.md +19 -0
- package/skills/kaizen-ui-html-css/references/components/ToggleButton.md +47 -0
- package/skills/kaizen-ui-html-css/references/components/ToggleButtonGroup.md +29 -0
- package/skills/kaizen-ui-html-css/references/components/Tooltip.md +45 -0
- package/skills/kaizen-ui-html-css/references/components/TreeNav.md +58 -0
- package/skills/kaizen-ui-html-css/references/components/Upload.md +90 -0
- package/skills/kaizen-ui-html-css/references/components/VerticalNav.md +65 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/CHART_DATA_COLORS.md +56 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/COLORS.md +148 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/COLOR_PRIMITIVES.md +31 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/EFFECTS_AND_LAYOUT.md +50 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/SPACING_SCALE.md +36 -0
- package/skills/kaizen-ui-html-css/references/design-tokens/TYPOGRAPHY.md +44 -0
- package/skills/kaizen-ui-html-css/references/guides/CONFIGURATION.md +51 -0
- package/skills/kaizen-ui-html-css/references/guides/HTML_STRUCTURE.md +134 -0
- package/skills/kaizen-ui-html-css/references/patterns/activity-feed.md +132 -0
- package/skills/kaizen-ui-html-css/references/patterns/confirmations.md +133 -0
- package/skills/kaizen-ui-html-css/references/patterns/data-display.md +127 -0
- package/skills/kaizen-ui-html-css/references/patterns/data-visualization.md +73 -0
- package/skills/kaizen-ui-html-css/references/patterns/element-visibility.md +83 -0
- package/skills/kaizen-ui-html-css/references/patterns/empty-states.md +116 -0
- package/skills/kaizen-ui-html-css/references/patterns/entity-cards.md +172 -0
- package/skills/kaizen-ui-html-css/references/patterns/error-states.md +163 -0
- package/skills/kaizen-ui-html-css/references/patterns/feedback.md +77 -0
- package/skills/kaizen-ui-html-css/references/patterns/filters.md +167 -0
- package/skills/kaizen-ui-html-css/references/patterns/forms.md +215 -0
- package/skills/kaizen-ui-html-css/references/patterns/key-value-display.md +195 -0
- package/skills/kaizen-ui-html-css/references/patterns/loading.md +104 -0
- package/skills/kaizen-ui-html-css/references/patterns/navigation.md +154 -0
- package/skills/kaizen-ui-html-css/references/patterns/ranked-lists.md +60 -0
- package/skills/kaizen-ui-html-css/references/patterns/search.md +46 -0
- package/skills/kaizen-ui-html-css/references/patterns/settings.md +106 -0
- package/skills/kaizen-ui-html-css/references/patterns/stat-blocks.md +71 -0
- package/skills/kaizen-ui-html-css/references/templates/browse-page.md +92 -0
- package/skills/kaizen-ui-html-css/references/templates/dashboard.md +356 -0
- package/skills/kaizen-ui-html-css/references/templates/detail-page.md +424 -0
- package/skills/kaizen-ui-html-css/references/templates/detail-placement.md +68 -0
- package/skills/kaizen-ui-html-css/references/templates/error-page.md +82 -0
- package/skills/kaizen-ui-html-css/references/templates/form-page.md +256 -0
- package/skills/kaizen-ui-html-css/references/templates/layout-principles.md +152 -0
- package/skills/kaizen-ui-html-css/references/templates/list-view.md +229 -0
- package/skills/kaizen-ui-html-css/references/templates/page-modification.md +33 -0
- package/skills/kaizen-ui-html-css/references/templates/page-shell.md +225 -0
- package/skills/kaizen-ui-html-css/references/templates/workspace-page.md +427 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Data visualization
|
|
2
|
+
|
|
3
|
+
Choosing and coloring a chart. The chart type must serve the analytical task the user is performing, not just display numbers — the most common failure is picking the type that "looks like a dashboard" instead of the one the data shape requires.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Render a chart when the prompt or data shape implies comparison, trend, distribution, or proportion:
|
|
8
|
+
|
|
9
|
+
- The prompt names a chart, or the data compares values across categories
|
|
10
|
+
- The data shows change over time, or a part-to-whole breakdown
|
|
11
|
+
- The data groups values by a shared dimension (team, region, status)
|
|
12
|
+
|
|
13
|
+
Don't use when:
|
|
14
|
+
|
|
15
|
+
- The value is a single scalar with no comparable dimension and the prompt doesn't ask for a chart — use a stat tile or inline text instead
|
|
16
|
+
- The user needs exact values, many attributes per item, or to sort/filter — a [`Table`](./data-display.md) serves precision better than a chart
|
|
17
|
+
- The chart would sit on a dashboard — read [dashboard.md](../templates/dashboard.md) first for stat-block placement, chart-grid layout, and per-dashboard micro-rules (gridlines, hero chart spanning) before applying this file's chart-type and color rules inside each chart
|
|
18
|
+
|
|
19
|
+
## Variants
|
|
20
|
+
|
|
21
|
+
Head each variant with the analytical task, not the chart's name.
|
|
22
|
+
|
|
23
|
+
| Situation | Chart | Notes |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Comparing 2–20 discrete categories | Bar | Horizontal when labels are long or there are 7+ categories. Stacked when sub-segments compose a total; grouped for 2–4 side-by-side sub-categories. |
|
|
26
|
+
| Change over time, continuous/sequential x-axis | Line | **Default for "trend" titles** — a title containing "trend," "over time," "progression," or a time range is a time series; do not default to a bar chart for it. |
|
|
27
|
+
| Volume/magnitude over time, or parts-of-a-whole over time | Area | Use sparingly — overlapping series obscure each other. Stacked area works best with 2–4 series. |
|
|
28
|
+
| Parts of a whole, 2–5 segments | Pie / donut | 6+ segments: use a horizontal bar chart instead — slices become indistinguishable. Prefer donut when a summary metric can sit in the center (value + one-word caption, `tabular-nums`); its legend sits beside it as label / value / percent rows, not bare swatches. |
|
|
29
|
+
| A single value's position in a defined range with meaningful thresholds | [`Meter`](../components/Meter.md) / [`SegmentedMeter`](../components/SegmentedMeter.md) | Not for comparing multiple values — that's a bar chart. |
|
|
30
|
+
| Compact inline trend (table row, card, stat block) | Sparkline | No axes, labels, or legends — shape and direction only. |
|
|
31
|
+
| Density/intensity across two dimensions | Heatmap | Large datasets where aggregate pattern matters more than individual points. |
|
|
32
|
+
| Relationship between two numeric variables | Scatter | Each point is an individual item, not an aggregate. |
|
|
33
|
+
|
|
34
|
+
**Bar vs. line is the highest-stakes call.** Bars imply discrete categorical comparison; lines imply continuity between points. A "Utilization trend" or "Daily active users" chart is a time series — line or area, never bars.
|
|
35
|
+
|
|
36
|
+
## Composition rules
|
|
37
|
+
|
|
38
|
+
Apply to every chart, dashboard or not.
|
|
39
|
+
|
|
40
|
+
### Tooltips are required, per-point labels usually aren't
|
|
41
|
+
|
|
42
|
+
Every chart shows a tooltip on hover/tap with the point's exact value, its label/category, and any context that makes it interpretable (date, percent of total). A small number of **selective callouts** (peak, latest point, an anomaly — 2–3 max) is fine on top of tooltips; labeling every point is the decluttering violation tooltips exist to prevent.
|
|
43
|
+
|
|
44
|
+
### Legends
|
|
45
|
+
|
|
46
|
+
Include one whenever more than one series/color is in play — render a real [`Legend`](../components/Legend.md) next to the chart rather than inventing swatches, and keep entries in the same order as the series they describe (`Legend`'s own guidance covers pinning `color` when order can change). Place it above or beside the chart, never below — below competes with axis labels.
|
|
47
|
+
|
|
48
|
+
### Axis labels
|
|
49
|
+
|
|
50
|
+
Label both axes, name the unit in the label ("Response Time (ms)", not "Response Time"), and keep tick intervals readable rather than dense.
|
|
51
|
+
|
|
52
|
+
### Text alternative (accessibility)
|
|
53
|
+
|
|
54
|
+
A chart rendered as SVG is invisible to a screen reader — its takeaway must also exist as text:
|
|
55
|
+
|
|
56
|
+
- Give the chart an `aria-label` (or `<title>`/`<desc>`) stating the takeaway, not just the name — "Cost by week, trending up ~18% over 6 weeks," not "Cost chart."
|
|
57
|
+
- Make the underlying numbers reachable as data — a "View as table" toggle, a visually-hidden `<table>`, or the row's drill destination. A tooltip is hover-only and keyboard-inaccessible, so it does not satisfy this.
|
|
58
|
+
|
|
59
|
+
## Modifiers
|
|
60
|
+
|
|
61
|
+
### Color
|
|
62
|
+
|
|
63
|
+
See [chart and data-visualization color tokens](../design-tokens/CHART_DATA_COLORS.md) for the token families and when each applies. In short: categorical for unrelated series/segments, sequential for a single quantity's intensity, trend tokens only when a value has a favorable/unfavorable direction. Never use trend (semantic) colors for arbitrary categorical differentiation, and never rely on color alone to carry meaning — pair it with a label, pattern, or shape, and keep marker/line contrast ≥ 3:1 and any label text ≥ 4.5:1 against the panel background.
|
|
64
|
+
|
|
65
|
+
## Anti-patterns
|
|
66
|
+
|
|
67
|
+
| Anti-pattern | Why it's wrong | Do this instead |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| Bar chart for a time-series title ("Utilization trend," "Daily active users") | Bars read as discrete unordered categories, hiding the continuity the user actually needs to see | Line chart, or area for cumulative volume |
|
|
70
|
+
| Pie/donut with 6+ segments | Slices become too small to differentiate, and precise comparison is impossible | Horizontal bar chart |
|
|
71
|
+
| Labeling every point/bar when tooltips already exist | Duplicates the tooltip and clutters the chart | Tooltips plus at most 2–3 selective callouts (peak/latest/anomaly) |
|
|
72
|
+
| Shipping a chart with the charting library's default white background and black axis text in a dark-themed app | Reads as visibly unfinished and fails contrast against the surrounding surface | Theme the chart explicitly — background, text, gridlines, tooltip all pulled from app tokens |
|
|
73
|
+
| A chart with no text alternative | Invisible to screen readers — the insight the chart carries doesn't reach every user | `aria-label` stating the takeaway, plus the underlying values reachable as a table |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Element Visibility & Interactivity
|
|
2
|
+
|
|
3
|
+
Decides whether an element should be **hidden**, **read-only**, or **disabled** instead of enabled. This is a judgment about informational value and path-to-action — component files cover the "how." Elements earn visibility by providing value, and earn interactivity by having a clear, achievable path to enablement.
|
|
4
|
+
|
|
5
|
+
## When to apply
|
|
6
|
+
|
|
7
|
+
Apply to every interactive or labeled element you are about to render. The output is one of: hidden, read-only, disabled, or the default enabled state.
|
|
8
|
+
|
|
9
|
+
## Decision framework
|
|
10
|
+
|
|
11
|
+
Ask in order; stop at the first decisive answer.
|
|
12
|
+
|
|
13
|
+
| # | Question | If NO | If YES |
|
|
14
|
+
| --- | --- | --- | --- |
|
|
15
|
+
| 1 | Does the user benefit from seeing this element? | **Hidden** | Continue to Q2 |
|
|
16
|
+
| 2 | Is it informational rather than interactive? | Continue to Q3 | **Read-only** |
|
|
17
|
+
| 3 | Can the user act on it right now? | Proximate path to enable? Yes → **Disabled**, No → **Hidden** | **Enabled** |
|
|
18
|
+
|
|
19
|
+
The non-obvious calls live in Q2 and Q3: read-only vs. disabled, and disabled vs. hidden. The rest is straightforward — hide what the user can't access, can't benefit from, or isn't authorized to see.
|
|
20
|
+
|
|
21
|
+
## Read-only vs. disabled
|
|
22
|
+
|
|
23
|
+
Different states with different semantics; agents routinely conflate them.
|
|
24
|
+
|
|
25
|
+
- **Read-only** = a value the user should see but cannot change. It is _not a control_. Use `readonly` / `aria-readonly`, or a display element such as `<dd>` — **never `disabled`**. Typical cases: system-generated values (IDs, timestamps, computed fields), values inherited/locked from a parent, a prior workflow step shown for reference, or context for an adjacent editable field.
|
|
26
|
+
- **Hidden** = gone for everyone: conditional rendering (preferred), the `hidden` attribute, or `display: none` — each already drops the element from the accessibility tree, so adding `aria-hidden` on top is redundant. `visibility: hidden` hides it from assistive tech too but keeps its layout space, leaving a gap. Reserve `aria-hidden="true"` for content that stays on screen, such as a decorative glyph beside its own text label, and never put it on anything focusable.
|
|
27
|
+
- **Disabled** = a control that _could_ be interactive but isn't right now — and only when there's a proximate path to enable it (below).
|
|
28
|
+
|
|
29
|
+
## Disabled requires a proximate path
|
|
30
|
+
|
|
31
|
+
Disable only when the user can discover and complete the unlock action without leaving the current task — the prerequisite is visible on the page or in the current flow.
|
|
32
|
+
|
|
33
|
+
- Submit disabled until required fields are filled (prerequisites on the same form)
|
|
34
|
+
- Deploy disabled until config validates (status shown on the same page)
|
|
35
|
+
|
|
36
|
+
**No proximate path → hide instead.** A disabled control with no discoverable unlock is interface noise — it provokes "why can't I click this?" without telling the user what to do.
|
|
37
|
+
|
|
38
|
+
### Disabled must explain itself
|
|
39
|
+
|
|
40
|
+
Pair every disabled control with an _actionable_ reason — state the prerequisite, not the restriction.
|
|
41
|
+
|
|
42
|
+
- **Tooltip or accessible description** (default for buttons, actions, standalone controls): "Select a source dataset to enable export." Not "This action is unavailable."
|
|
43
|
+
- **Inline `FormField` helper text** when the dependency is a visible parent→child field relationship: "Available after selecting a region above."
|
|
44
|
+
- Keep it to one short sentence. If the explanation needs more, the path probably isn't proximate — hide instead.
|
|
45
|
+
|
|
46
|
+
Gotcha: disabled elements can't receive focus, so a tooltip trigger may need to wrap the element (or use `aria-describedby`) to stay keyboard-accessible.
|
|
47
|
+
|
|
48
|
+
## Exceptions
|
|
49
|
+
|
|
50
|
+
### Spatial consistency
|
|
51
|
+
|
|
52
|
+
In high-frequency control surfaces (toolbars, action bars used many times per session) where users build muscle memory, you may show an element as disabled even without a proximate path, purely to keep the layout stable. All must hold:
|
|
53
|
+
|
|
54
|
+
1. The surface is used at high frequency with a stable, cross-session layout
|
|
55
|
+
2. Removing the element would reflow or shift other elements
|
|
56
|
+
3. The element is a standard, expected part of the surface (not a contextual or rare action)
|
|
57
|
+
|
|
58
|
+
A tooltip explaining the disabled state is still required. Never use this to show controls the user can _never_ access (role/permission) — hide those.
|
|
59
|
+
|
|
60
|
+
## Quick reference
|
|
61
|
+
|
|
62
|
+
| Condition | State |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| Lacks permission/role, or feature not in tier | Hidden (unless a product decision to tease the upgrade). For nav items, see [`navigation.md`](./navigation.md) |
|
|
65
|
+
| Irrelevant to current context | Hidden |
|
|
66
|
+
| No discoverable path to enable | Hidden |
|
|
67
|
+
| System-generated / inherited / prior-step / pre-filled value | Read-only |
|
|
68
|
+
| Prerequisite visible on the page | Disabled + actionable tooltip or inline hint |
|
|
69
|
+
| High-frequency toolbar item, no proximate path | Disabled + tooltip (spatial-consistency exception only) |
|
|
70
|
+
|
|
71
|
+
## Worked example: role-based access on one detail page
|
|
72
|
+
|
|
73
|
+
A model detail page rendered for three roles. Run each element through the framework:
|
|
74
|
+
|
|
75
|
+
| Element | Admin | Editor | Viewer | Why |
|
|
76
|
+
| --- | --- | --- | --- | --- |
|
|
77
|
+
| **Delete** action (in the page-header action region) | Enabled | Hidden | Hidden | Q1: a non-admin can never delete → **hide**, don't disable. A permanently-disabled Delete is noise and leaks the capability. Gate the action region by role. |
|
|
78
|
+
| **Name / config** fields | Enabled | Enabled | Read-only | Viewer benefits from seeing values (Q1 yes) but they're informational (Q2 yes) → **read-only** (native `readonly` input or key-value display), never `disabled`. |
|
|
79
|
+
| **System ID / created date** | Read-only | Read-only | Read-only | System-generated for everyone → always read-only. |
|
|
80
|
+
|
|
81
|
+
**The rule for permissions/roles: hide, never disable.** Disabled is only for a missing _proximate_ prerequisite the user can satisfy now (a required field, a pending validation) — never for a restriction the role can never lift. For a viewer's editable-by-others field, the answer is read-only, not disabled.
|
|
82
|
+
|
|
83
|
+
Visibility is resolved **before** confirmation friction: only render a destructive action for an authorized role, _then_ apply the [`confirmations.md`](./confirmations.md) level. Hiding the control and confirming the click are two separate gates.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Empty States
|
|
2
|
+
|
|
3
|
+
Empty states aren't just "nothing here" messages — they orient the user, explain the gap, and route them to a next action. A good empty state reduces confusion and prevents dead ends.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
Use an empty state when:
|
|
8
|
+
|
|
9
|
+
- A content area (page, section, table, chart, list) has no items to render
|
|
10
|
+
- The reason is reachable in normal usage — first-use, filtered/searched, no permission, no data in scope, or a recoverable error
|
|
11
|
+
- The user needs guidance, recovery, or context to understand why nothing is shown
|
|
12
|
+
|
|
13
|
+
Don't use when:
|
|
14
|
+
|
|
15
|
+
- Data is still loading — use [ProgressBar](../components/ProgressBar.md) or [Skeleton](../components/Skeleton.md) instead
|
|
16
|
+
- A hard failure would replace a full page — use the [error page template](../templates/error-page.md), not this pattern
|
|
17
|
+
- Container-level load/retry errors aren't yet scoped — see [`error-states.md`](./error-states.md); that pattern owns the scope decision (full-page vs. container vs. banner vs. inline). Use the [Something Went Wrong](#something-went-wrong-error) variant here only after `error-states.md` has resolved that the right scope is **container-level**.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Anatomy
|
|
22
|
+
|
|
23
|
+
Every empty state shares the same core slots. Variants differ in content values, not in which slots are present. In most cases the [StatusMessage](../components/StatusMessage.md) component should be used to render these slots.
|
|
24
|
+
|
|
25
|
+
### Required
|
|
26
|
+
|
|
27
|
+
| Part | Purpose |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| **Heading** | States what's empty or what this area is for ("No locations yet", "No results for 'xyz'"). |
|
|
30
|
+
| **Subheading** | 1–2 sentences explaining context, purpose, or recovery. |
|
|
31
|
+
|
|
32
|
+
### Optional
|
|
33
|
+
|
|
34
|
+
Include when the variant warrants them.
|
|
35
|
+
|
|
36
|
+
| Part | Include when |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| **Primary action** | A clear next step exists (create first item, clear filters, retry, request access). Rendered in the footer/action region. |
|
|
39
|
+
| **Secondary action** | A genuinely useful alternative path (docs link, contact support) — see [Composition rules → Action hierarchy](#action-hierarchy). Rendered in the footer/action region. |
|
|
40
|
+
| **Illustration** | First-use moments where orientation/encouragement helps. Simple, on-brand, small — never dominant. Rendered in the media region. |
|
|
41
|
+
| **Icon** | Lighter alternative to an illustration; appropriate for inline / component-level empties. Rendered in the media region. |
|
|
42
|
+
| **Active filter visibility** | A "No Results" variant — keep applied filters/search terms visible above the empty state so the user sees what's restricting results - these should be rendered outside the StatusMessage, near the filter controls themselves. |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Variants
|
|
47
|
+
|
|
48
|
+
Identify which variant applies based on **why** the content area is empty.
|
|
49
|
+
|
|
50
|
+
### First-Use / No entries yet
|
|
51
|
+
|
|
52
|
+
When the area has no items - totalCount is 0 because none exist, not because of error or applied filters. In this case provide the user with onboarding guidance. Do not render empty tables or useless filters/inputs.
|
|
53
|
+
|
|
54
|
+
The heading should speak to the collection(ex. "No clusters yet"), subheading should be 1-2 sentences answering "why would I add something here?"(ex. "Add a cluster to start running workloads, monitor usage, and manage capacity across your team."), and a prominent primary CTA for users to begin.
|
|
55
|
+
|
|
56
|
+
**Caveat**: Sometimes a first-use/onboarding step doesn't make as much sense. For example, a monitoring chart with no recent activity. In that case the subheading is less "why would I add something here" and "when would something appear here" - ex. "No activity in the last 24 hours."
|
|
57
|
+
|
|
58
|
+
### No Results (filtered or searched)
|
|
59
|
+
|
|
60
|
+
When the area has no items because active filters/search filtered results down to 0. In this case do not render an empty table, but keep rendering any filter controls.
|
|
61
|
+
|
|
62
|
+
The heading should name the miss (e.g., "No results for 'xyz'"), the subheading should suggest broadening terms or removing a filter, and there should be a single secondary [Button](../components/Button.md) labeled "Clear filters" or "Clear search". Keep applied filters/search visible so the user sees what's restricting results.
|
|
63
|
+
|
|
64
|
+
### Something Went Wrong (error)
|
|
65
|
+
|
|
66
|
+
For "something went wrong" empty states (load failures, retry-able errors), see [`error-states.md`](./error-states.md) → Container-level errors. Resolve the scope decision (full-page vs. container vs. banner vs. inline) there first; if container-level is correct, render the empty state using this variant.
|
|
67
|
+
|
|
68
|
+
### No Access / Unauthorized
|
|
69
|
+
|
|
70
|
+
When the content exists but is restricted to roles/permissions the user lacks.
|
|
71
|
+
|
|
72
|
+
The heading should state what's happening (for example, "You don't have access to this section"), the subheading should explain what permission is needed or who to contact, and, if possible, provide a "Request access" primary action when a self-service flow exists. Otherwise use an [Anchor](../components/Anchor.md) to the right admin or support channel. Use a lock icon in the media region. Hide create actions the user cannot access.
|
|
73
|
+
|
|
74
|
+
### Gotchas
|
|
75
|
+
|
|
76
|
+
- Do not show a generic "No data" graphic for both empty collections and filtered to empty, both states have different recovery actions.
|
|
77
|
+
- Do not render "0 items" in the result count while loading - hide it until data is loaded
|
|
78
|
+
- Do not use two brand-colored buttons in one StatusMessage. They compete for attention; keep one primary action per state.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Composition rules
|
|
83
|
+
|
|
84
|
+
Apply to all variants.
|
|
85
|
+
|
|
86
|
+
### Action hierarchy
|
|
87
|
+
|
|
88
|
+
When an empty state includes actions, follow this priority:
|
|
89
|
+
|
|
90
|
+
1. **Primary action** — the one thing the user most likely wants to do (create the first item, clear filters, retry loading). Use [Button](../components/Button.md) with the brand color — NVIDIA green is the CTA signal.
|
|
91
|
+
2. **Secondary action** — an alternative next step (view documentation, contact support, adjust settings). Show as an [Anchor](../components/Anchor.md) or secondary Button.
|
|
92
|
+
3. **Never more than 2 actions** — an empty state with 3+ buttons creates decision paralysis at a moment when the user is already uncertain.
|
|
93
|
+
|
|
94
|
+
### Same anatomy across variants
|
|
95
|
+
|
|
96
|
+
Every empty state in the same surface uses the same core slots (headline + supporting text, with optional action + visual). Variation comes from content **values** per variant, not from which slots are present. Don't drop the headline or supporting text to "simplify" an error or no-results state — it's the slot consistency that makes the pattern legible.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Modifiers
|
|
101
|
+
|
|
102
|
+
### Placement
|
|
103
|
+
|
|
104
|
+
| Placement | Use when |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| **Full-container** | The entire content area of a page or section is empty. Center the headline / text / CTA both horizontally and vertically within the container the content would normally occupy. |
|
|
107
|
+
| **Inline** | A specific component within a page is empty but the rest of the page has content (a chart with no data while other charts do, a "No comments yet" section on a detail page). Smaller and simpler — typically just a short message and optional action, without illustrations. |
|
|
108
|
+
| **Table** | A table has no rows to display. Show the table header (column names) so the user understands the structure; render the empty state message centered in the table body area; keep the filter/search controls above the table so the user can adjust their query. |
|
|
109
|
+
|
|
110
|
+
### Visual treatment
|
|
111
|
+
|
|
112
|
+
| Treatment | Use when |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| **Illustration** | First-use empty states where the user needs encouragement or orientation. Keep simple, on-brand, small — never dominating the empty state. Do **not** use for error or no-results states — those are functional moments, not onboarding moments. |
|
|
115
|
+
| **Icon** | Lighter alternative to an illustration (search icon for no results, warning icon for errors). Appropriate for inline empty states and component-level empties. |
|
|
116
|
+
| **No visual** | Dense/operational interfaces where empty states are frequent and expected (filtered table views in admin tools). Just the headline + supporting text + action. |
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Entity Cards
|
|
2
|
+
|
|
3
|
+
The content anatomy of a summary card that represents a single entity inside a collection. Cards trade information density for scannability and visual differentiation.
|
|
4
|
+
|
|
5
|
+
For the `Card` component's exact API, slots, interaction model, and examples, see [`Card.md`](../components/Card.md). This file is about **what content goes inside** a card in a collection.
|
|
6
|
+
|
|
7
|
+
## When to use
|
|
8
|
+
|
|
9
|
+
Applies once you've decided cards are the right display method over tables or lists. See [`data-display.md`](./data-display.md) → "When to use cards vs. tables vs. lists".
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Anatomy
|
|
14
|
+
|
|
15
|
+
Every card in a collection shares the same slot structure. Variation comes from content values, not from which slots are present.
|
|
16
|
+
|
|
17
|
+
### Mapping content to Card regions
|
|
18
|
+
|
|
19
|
+
Map the pattern's content regions to the framework-specific slots documented in [`Card.md`](../components/Card.md):
|
|
20
|
+
|
|
21
|
+
| Pattern content | Card placement |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Status (when the item has one) | Header region — up to two `Badge`s, over the media when there is one |
|
|
24
|
+
| Visual element (thumbnail/hero) | Media region |
|
|
25
|
+
| Eyebrow (publisher, then type) → title → description → tags → footer stats | Content region |
|
|
26
|
+
|
|
27
|
+
Keep status badges in the header so they scan before the title. Put the resource type in the eyebrow, never in a badge or a tag. Use only slot names documented by the target framework's Card reference.
|
|
28
|
+
|
|
29
|
+
### Required slots
|
|
30
|
+
|
|
31
|
+
| Slot | Purpose |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| **Title** | Primary identifier. Prominent and scannable. |
|
|
34
|
+
| **Supporting text / description** | 1–2 lines summarizing what this item is. Browsing context — not the full detail. |
|
|
35
|
+
|
|
36
|
+
### Optional slots
|
|
37
|
+
|
|
38
|
+
Include when the content type warrants them. If one card in a collection includes a slot, every card in that collection must include it (use a placeholder over omission — see [Composition rules](#composition-rules)).
|
|
39
|
+
|
|
40
|
+
| Slot | Include when |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| **Visual element** | Content benefits from visual differentiation (thumbnails, icons, logos) — rendered in the media region |
|
|
43
|
+
| **Metadata** | Secondary attributes (date, size, count, author, duration) help the user evaluate or compare at browsing level |
|
|
44
|
+
| **Status** | The item has a lifecycle status the system sets, such as Preview or Deprecated. Render up to two [`Badge`](../components/Badge.md)s in the header |
|
|
45
|
+
| **Tags / labels** | Topic facets go in the body tags row; **resource type** (the categorical "what kind of thing is this") goes in the eyebrow after the publisher when kinds are mixed |
|
|
46
|
+
| **Ratings / reviews** | Content supports user feedback and ratings are meaningful for the browsing decision |
|
|
47
|
+
| **Action buttons** | User needs to take a direct action without navigating to the detail view |
|
|
48
|
+
|
|
49
|
+
### Canonical slot order
|
|
50
|
+
|
|
51
|
+
When a card includes multiple slots, arrange them in this order. Deviating signals either wrong content for a card or that a different card variant is needed.
|
|
52
|
+
|
|
53
|
+
| Position | Slot | Notes |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| 1 | **Eyebrow: publisher / author / source** | **Always present.** Keep visible even when all cards share the same source — consistency outweighs the redundancy. Render small and muted so it doesn't compete with the title. **If your data model lacks this field, add one before rendering — do not drop the slot.** If genuinely unknown, render a muted placeholder ("Unknown" or the source system name). |
|
|
56
|
+
| 1a | **Resource type (when needed)** | When the grid mixes **resource kinds**, append the type to the eyebrow after the publisher, such as "NVIDIA · Model", so it scans before the title. Type describes what the item is, so it is neither a Badge nor a separate Tag. Status goes in the header Badges. |
|
|
57
|
+
| 2 | **Title** | Primary identifier. Largest text on the card. |
|
|
58
|
+
| 3 | **Supporting text / description** | 1–2 lines, truncated with ellipsis if needed. |
|
|
59
|
+
| 4 | **Topic / facet tags** | Inline row of [`Tag`](../components/Tag.md) components using the neutral gray outline treatment. Do **not** use this row for resource type; that belongs in the eyebrow. |
|
|
60
|
+
| 5 | **Footer metadata (stats)** | Bottom row. 2–3 stats recommended (4 max before noise). Stat order is a product decision, but the chosen order must be **identical across every card in the collection**. |
|
|
61
|
+
|
|
62
|
+
**Why this order:**
|
|
63
|
+
|
|
64
|
+
- **Publisher-top** matches top-down scanning and lets users contextualize "who made this" before reading the title.
|
|
65
|
+
- **Tags above footer stats** keeps categorical info near the title (for filtering decisions) and quantitative info at the bottom (for cross-card comparison).
|
|
66
|
+
- **Publisher always visible** prevents a silent anatomy change when a filter narrows the collection to a single publisher.
|
|
67
|
+
|
|
68
|
+
**Visual rhythm:**
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
┌─────────────────────────────────┐
|
|
72
|
+
│ [● Status] │ ← header: status Badges (when the item has a status)
|
|
73
|
+
├─────────────────────────────────┤
|
|
74
|
+
│ {Publisher} · {Type} │ ← content 1: eyebrow (muted; type only when mixed kinds)
|
|
75
|
+
│ {Title} │ ← content 2: title (dominant)
|
|
76
|
+
│ {1–2 line description} │ ← content 3: description
|
|
77
|
+
│ │
|
|
78
|
+
│ [Topic] [Topic] [Topic] │ ← content 4: topic tags (outline / gray)
|
|
79
|
+
│ │
|
|
80
|
+
│ {stat} · {stat} · {stat} │ ← content 5: footer stats (2–3 items)
|
|
81
|
+
└─────────────────────────────────┘
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Slot typography
|
|
85
|
+
|
|
86
|
+
Use these kinds consistently across browse, landing, and detail-page related-item cards. Do not invent alternative mappings per page.
|
|
87
|
+
|
|
88
|
+
| Slot | Text kind | Color | Notes |
|
|
89
|
+
| --- | --- | --- | --- |
|
|
90
|
+
| 1 — Publisher | `label/regular/sm` | `text-secondary` | Muted. Sentence case — never uppercase |
|
|
91
|
+
| 1a — Type (eyebrow) | Same as publisher | Same as publisher | Appended after the publisher with " · "; single categorical type only |
|
|
92
|
+
| 2 — Title | `body/bold/xl` | `text-primary` (default) | Figma default is `body/bold/2xl`; `body/bold/xl` is the common NVIDIA usage. Do NOT use `heading/*` — that kind does not exist |
|
|
93
|
+
| 3 — Description | `body/regular/sm` | `text-secondary` | 1–2 lines; truncate with ellipsis |
|
|
94
|
+
| 4 — Topic tags | `label/regular/sm` (inside Tag) | Tag default (`outline`, `gray`) | Never per-value colors (rainbow coding). See [`Tag.md`](../components/Tag.md) |
|
|
95
|
+
| 5 — Footer metadata | `label/regular/sm` | `text-placeholder` | Browse card footer stats line only — scoped exception per [`COLORS.md`](../design-tokens/COLORS.md). Elsewhere metadata stays `text-secondary`. |
|
|
96
|
+
|
|
97
|
+
### When to deviate from the canonical order
|
|
98
|
+
|
|
99
|
+
| Case | Override |
|
|
100
|
+
| --- | --- |
|
|
101
|
+
| Card is visual-led (thumbnail dominates) | Thumbnail moves to the media region above the body; all other content stays in canonical order |
|
|
102
|
+
| Card is action-led (e.g., "Create new" tile) | Use a different card variant — this anatomy doesn't apply |
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Composition rules
|
|
107
|
+
|
|
108
|
+
Apply to all variants.
|
|
109
|
+
|
|
110
|
+
### Footer metadata row: vertically centred, spread across the card
|
|
111
|
+
|
|
112
|
+
The footer (slot 5) is information, not an action row. Centre its items on one line and let the row spread them across the card's width: usage stats start-aligned, recency end-aligned. Group related stats into one dot-separated string so the row holds two anchors, not four loose values.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
Keep footer metadata in one row with `nv-flex--align-center nv-flex--justify-between`, grouping related stats with dot separators so the row holds two anchors.
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
**Color:** use `text-placeholder` for the browse **card footer stats** strip (slot 5) only, per [`COLORS.md`](../design-tokens/COLORS.md). For metadata **outside** browse cards (e.g., near forms), keep `text-secondary` — do not use `text-placeholder` next to inputs.
|
|
124
|
+
|
|
125
|
+
### Every card in a collection shares the same anatomy
|
|
126
|
+
|
|
127
|
+
All cards within a collection must:
|
|
128
|
+
|
|
129
|
+
- Use the same slot arrangement
|
|
130
|
+
- Display the same categories of information (if one card shows a download count, all cards show it — even when the value is zero)
|
|
131
|
+
- Maintain consistent row height in a grid
|
|
132
|
+
- Use the same visual treatment for tags, icons, and metadata
|
|
133
|
+
|
|
134
|
+
Variation comes from content **values**, not from card **structure**.
|
|
135
|
+
|
|
136
|
+
### Related-item cards on detail pages reuse the browse anatomy
|
|
137
|
+
|
|
138
|
+
A detail page often shows related items at the bottom. Treat the related-item collection as its own "same collection": same slots, same order as the browse cards for that entity type. Dropping a slot in related-item cards creates an unnecessary second anatomy and forces users to re-learn card reading within the same session.
|
|
139
|
+
|
|
140
|
+
**If space is constrained,** shrink the card (reduce padding, single-line description, fewer footer stats) **before** dropping a slot.
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Layout
|
|
145
|
+
|
|
146
|
+
Use a responsive grid when content is being browsed, has many items (10+), and items are roughly equal in importance.
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
Author the grid wrapper so the column count responds to available width:
|
|
154
|
+
|
|
155
|
+
```html
|
|
156
|
+
<div class="entity-card-grid">
|
|
157
|
+
<div class="nv-card-root"><div class="nv-card-content">Model A</div></div>
|
|
158
|
+
<div class="nv-card-root"><div class="nv-card-content">Model B</div></div>
|
|
159
|
+
</div>
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
```css
|
|
163
|
+
.entity-card-grid {
|
|
164
|
+
display: grid;
|
|
165
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
|
|
166
|
+
gap: var(--spacing-density-xl);
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
Vertically stack cards when each card has substantial content that benefits from full width, the list is short (<10 items), and items follow a natural sequential/chronological order or vary significantly in length.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Error states
|
|
2
|
+
|
|
3
|
+
Errors disrupt the user's task. The patterns job is to make the disruption as recoverable as possible — by picking the right scope (where the message lives), the right severity (how loud it is), and the right action (what the user can do about it).
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
This pattern resolves four overlapping concerns: page-level error chrome, container-level "something went wrong", inline form validation, and transient action failures.
|
|
8
|
+
|
|
9
|
+
Use when:
|
|
10
|
+
|
|
11
|
+
- An operation failed (network request, validation, server-side action)
|
|
12
|
+
- A resource cannot be served (route gone, no access, system outage)
|
|
13
|
+
- An async operation reached a terminal failure state
|
|
14
|
+
|
|
15
|
+
Don't use when:
|
|
16
|
+
|
|
17
|
+
- The state is "no data yet" / empty result — that's an [empty state](./empty-states.md)
|
|
18
|
+
- The state is "still loading" — render a loading state, not an error
|
|
19
|
+
- The user is inside a successful flow with non-blocking warnings — use `Banner` `status="info"` or inline help text instead
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Anatomy
|
|
24
|
+
|
|
25
|
+
The content parts of an error display.
|
|
26
|
+
|
|
27
|
+
### Required
|
|
28
|
+
|
|
29
|
+
| Part | Purpose | Notes |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| **Headline** | What didn't happen, in user-task terms | "Cluster restart didn't start." Not "Operation failed" or "Error 500." |
|
|
32
|
+
| **Affordance** | The action the user can take | Button or link; see [Modifiers → Affordance](#affordance) for which one. |
|
|
33
|
+
|
|
34
|
+
### Optional
|
|
35
|
+
|
|
36
|
+
Include when applicable.
|
|
37
|
+
|
|
38
|
+
| Part | Include when |
|
|
39
|
+
| --- | --- |
|
|
40
|
+
| **Explanation** | One sentence, plain language, what blocked the operation. **Required for terminal errors**; optional for transient ones. No stack traces. |
|
|
41
|
+
| **Error code** | See [Modifiers → Error code visibility](#error-code-visibility). If shown, place after the affordance, in muted text. |
|
|
42
|
+
| **Support link** | The user has exhausted self-service paths and the next step is a ticket. |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Variants
|
|
47
|
+
|
|
48
|
+
Pick exactly one scope. The scope determines which component and which placement.
|
|
49
|
+
|
|
50
|
+
| Variant | Use when | Placement |
|
|
51
|
+
| --- | --- | --- |
|
|
52
|
+
| **Full-page** | The user cannot do anything on the page (404, 500, 403, account suspended) | Full-page error layout |
|
|
53
|
+
| **Page-level** | Partial outage/error affecting the entire view | `Banner` above layout content |
|
|
54
|
+
| **Container-level** | A specific region failed (panel, table, list, side-panel content) | `StatusMessage` rendered inside the failed container |
|
|
55
|
+
| **Inline (field-level)** | A field's value is invalid or rejected by the server | Directly under the offending field |
|
|
56
|
+
| **Transient (action result)** | An action the user just initiated failed (the page itself is fine; the user attempt is not) | `Toast` (recoverable) or `Notification` (needs user action) |
|
|
57
|
+
|
|
58
|
+
**Decision rule:** If the route itself is unavailable → full-page. If the user should be able to but can't do anything on this rendered page because of an outage/error → page-level. If a specific region failed → container-level. If a specific input is wrong → inline. If a specific action failed → transient.
|
|
59
|
+
|
|
60
|
+
**Mixed cases:** Multiple regions failed on a dashboard? Container-level for each region, optional summary banner only if the cumulative failure changes the page's value (e.g., 5 of 7 panels failed → the dashboard is mostly broken; show a banner _and_ in-panel errors).
|
|
61
|
+
|
|
62
|
+
### Transient sub-variants (component by severity)
|
|
63
|
+
|
|
64
|
+
When the user just initiated an action and it failed, pick the transient component by severity:
|
|
65
|
+
|
|
66
|
+
| Severity | Component | When |
|
|
67
|
+
| --- | --- | --- |
|
|
68
|
+
| **Recoverable, transient** | `Toast` `status="error"` with retry action | Single API call failed; retry inline solves it |
|
|
69
|
+
| **Persistent, requires user action** | `Notification` `status="error"` | Multiple retries failed; the user needs to make a decision (escalate? change inputs? wait?) |
|
|
70
|
+
| **System-wide impact** | `Banner` at top of `<main>` | The user's action exposed a system-level issue affecting other parts of the page |
|
|
71
|
+
|
|
72
|
+
**Do not auto-dismiss errors that need a decision.** Toasts auto-dismiss; that's only safe for errors without an action. Anything requiring a choice goes in `Notification` or `Banner`. See [`./feedback.md`](./feedback.md) for the broader Toast vs. Banner vs. Notification selection if you're still unsure.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Composition rules
|
|
77
|
+
|
|
78
|
+
Apply to all variants.
|
|
79
|
+
|
|
80
|
+
### Voice: name what the user wanted, what didn't happen, what to do next
|
|
81
|
+
|
|
82
|
+
Errors are not the place for cleverness. They are the place for the truth, plus the next step. Keep the message brief.
|
|
83
|
+
|
|
84
|
+
| Do | Don't |
|
|
85
|
+
| --- | --- |
|
|
86
|
+
| "We couldn't reach the cluster." | "Your request failed." |
|
|
87
|
+
| "The cluster name is already taken — try another." | "Validation error: name field invalid." |
|
|
88
|
+
| "Restart didn't start. Try again, or check incidents." | "Something went wrong." |
|
|
89
|
+
| "You don't have access to this workspace. Switch accounts or request access." | "403 Forbidden" |
|
|
90
|
+
|
|
91
|
+
**The rule:** name what the user wanted, name what didn't happen, name what to do next. In that order.
|
|
92
|
+
|
|
93
|
+
### Never surface raw implementation details
|
|
94
|
+
|
|
95
|
+
Don't: Stack traces, HTTP method/URL, internal exception messages, framework error names.
|
|
96
|
+
Do: Render the human message; log the trace server-side or to console.
|
|
97
|
+
|
|
98
|
+
Exposing internals scares users, leaks attack surface, and offers no recovery path.
|
|
99
|
+
|
|
100
|
+
### Never show only an error code
|
|
101
|
+
|
|
102
|
+
The user has to translate it; most won't. Show the human message first, with the code (when shown) as a muted suffix.
|
|
103
|
+
|
|
104
|
+
### Match scope to impact
|
|
105
|
+
|
|
106
|
+
Don't: Page-level banner for a single panel's failure — implies the whole page is broken when only a part is.
|
|
107
|
+
Do: Container-level error in the failing panel; reserve the page banner for page-wide issues.
|
|
108
|
+
|
|
109
|
+
### Aggregate batch failures, don't stack toasts
|
|
110
|
+
|
|
111
|
+
Don't: A batch operation that emits one error toast per failed item — visual noise; user can't process them.
|
|
112
|
+
Do: One `Notification` with a count and a link to the affected items.
|
|
113
|
+
|
|
114
|
+
### Pick the affordance before writing the message
|
|
115
|
+
|
|
116
|
+
The error message resolves into exactly one of the affordances in [Modifiers → Affordance](#affordance). Pick first, then write the headline + explanation to support that affordance — not the other way around.
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Modifiers
|
|
121
|
+
|
|
122
|
+
### Recoverable vs. terminal
|
|
123
|
+
|
|
124
|
+
This drives which affordance you pick.
|
|
125
|
+
|
|
126
|
+
| State | Affordance | Examples |
|
|
127
|
+
| --- | --- | --- |
|
|
128
|
+
| **Recoverable** — user can retry from here | Retry button on the error itself | Network timeout, optimistic update conflict, transient 5xx, "we couldn't load this" |
|
|
129
|
+
| **Terminal** — user must leave | Navigation affordance (back, home, support) | 403 (no access), 404 (resource gone), account-suspended, locked-out auth |
|
|
130
|
+
| **Recoverable but elsewhere** | Link to where the user can fix it | "Quota exceeded — request more quota" (link to quota page); "Cluster locked by another deployment — view that deployment" |
|
|
131
|
+
|
|
132
|
+
A retry button on a terminal error sets a false expectation. A back-to-home button on a recoverable error gives up on the user's intent. Match the affordance to the state.
|
|
133
|
+
|
|
134
|
+
### Affordance
|
|
135
|
+
|
|
136
|
+
The error message resolves into exactly one of these affordances:
|
|
137
|
+
|
|
138
|
+
| Affordance | When | Anti-pattern |
|
|
139
|
+
| --- | --- | --- |
|
|
140
|
+
| **Retry** | Transient or recoverable failures (timeouts, conflicts, server hiccups) | Disabling retry on transient errors because "we don't know if it'll work." Retry costs the user nothing; not letting them retry costs them recovery. |
|
|
141
|
+
| **Navigate elsewhere** | Terminal errors, "the thing you wanted is somewhere else" | Sending the user to the home page when the back button would do |
|
|
142
|
+
| **Contact support** | Genuinely unrecoverable, opaque errors (system-wide outage, account-level issue) | Defaulting to "contact support" for transient errors — the user wants to retry, not file a ticket |
|
|
143
|
+
| **Wait** | Async operations the user can't influence (cluster provisioning, deployment in progress) | Showing an error when the operation is still in progress |
|
|
144
|
+
| **Acknowledge / dismiss** | Informational errors that don't require user action | Forcing dismiss on a notification the user already understands |
|
|
145
|
+
|
|
146
|
+
### Severity (within the chosen variant)
|
|
147
|
+
|
|
148
|
+
The component status dials tone within any variant. Match severity to the actual impact, not the loudness you want:
|
|
149
|
+
|
|
150
|
+
| Status | Use when |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| `status="error"` | The operation is fully broken; the user must act or leave |
|
|
153
|
+
| `status="warning"` | Partial / degraded; the page or operation is functional but reduced (e.g., "3 of 7 panels couldn't load") |
|
|
154
|
+
| `status="info"` | Informational; no user action required |
|
|
155
|
+
|
|
156
|
+
### Error code visibility
|
|
157
|
+
|
|
158
|
+
| Audience | Show error codes? |
|
|
159
|
+
| --- | --- |
|
|
160
|
+
| **Developer-facing apps** (CLI, SDK, console for ops) | Yes. Codes accelerate debugging and are part of the audience's vocabulary. Place after the human-readable message. |
|
|
161
|
+
| **End-user / customer-facing apps** | No by default. Codes confuse non-technical users without aiding recovery. **Exception:** show on a "show details" disclosure when contacting support is the affordance — the support agent will need it. |
|
|
162
|
+
|
|
163
|
+
Never show codes _instead of_ the human message. They go alongside, not in place of.
|