@maxio-com/react-ui-components 9.16.0 → 9.16.1

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.
Files changed (51) hide show
  1. package/dist/skills/maxio-react/SKILL.md +68 -0
  2. package/dist/skills/maxio-react/agents/openai.yaml +4 -0
  3. package/dist/skills/maxio-react/references/components-action-list.md +92 -0
  4. package/dist/skills/maxio-react/references/components-action-menu.md +162 -0
  5. package/dist/skills/maxio-react/references/components-avatar.md +66 -0
  6. package/dist/skills/maxio-react/references/components-breadcrumbs.md +86 -0
  7. package/dist/skills/maxio-react/references/components-buttons-button.md +170 -0
  8. package/dist/skills/maxio-react/references/components-buttons-iconbutton.md +102 -0
  9. package/dist/skills/maxio-react/references/components-card.md +175 -0
  10. package/dist/skills/maxio-react/references/components-chip.md +151 -0
  11. package/dist/skills/maxio-react/references/components-data-table.md +344 -0
  12. package/dist/skills/maxio-react/references/components-drawer.md +293 -0
  13. package/dist/skills/maxio-react/references/components-flex.md +185 -0
  14. package/dist/skills/maxio-react/references/components-forms-checkbox.md +257 -0
  15. package/dist/skills/maxio-react/references/components-forms-combobox.md +250 -0
  16. package/dist/skills/maxio-react/references/components-forms-radio-group.md +202 -0
  17. package/dist/skills/maxio-react/references/components-forms-select.md +295 -0
  18. package/dist/skills/maxio-react/references/components-forms-textfield.md +253 -0
  19. package/dist/skills/maxio-react/references/components-grid.md +140 -0
  20. package/dist/skills/maxio-react/references/components-icon.md +169 -0
  21. package/dist/skills/maxio-react/references/components-link.md +180 -0
  22. package/dist/skills/maxio-react/references/components-listbox.md +205 -0
  23. package/dist/skills/maxio-react/references/components-loading-spinner.md +123 -0
  24. package/dist/skills/maxio-react/references/components-logo.md +91 -0
  25. package/dist/skills/maxio-react/references/components-notifications-alert.md +103 -0
  26. package/dist/skills/maxio-react/references/components-notifications-banner.md +173 -0
  27. package/dist/skills/maxio-react/references/components-notifications-toast.md +155 -0
  28. package/dist/skills/maxio-react/references/components-pagination.md +115 -0
  29. package/dist/skills/maxio-react/references/components-popover.md +176 -0
  30. package/dist/skills/maxio-react/references/components-progressbar.md +98 -0
  31. package/dist/skills/maxio-react/references/components-segmentedcontrol.md +292 -0
  32. package/dist/skills/maxio-react/references/components-tabs.md +193 -0
  33. package/dist/skills/maxio-react/references/components-tag.md +117 -0
  34. package/dist/skills/maxio-react/references/components-tile.md +114 -0
  35. package/dist/skills/maxio-react/references/components-toggle.md +218 -0
  36. package/dist/skills/maxio-react/references/components-tooltip.md +178 -0
  37. package/dist/skills/maxio-react/references/components-typography-body.md +101 -0
  38. package/dist/skills/maxio-react/references/components-typography-code.md +72 -0
  39. package/dist/skills/maxio-react/references/components-typography-display.md +91 -0
  40. package/dist/skills/maxio-react/references/components-typography-heading.md +88 -0
  41. package/dist/skills/maxio-react/references/components-typography-label.md +82 -0
  42. package/dist/skills/maxio-react/references/deprecated-textinput.md +250 -0
  43. package/dist/skills/maxio-react/references/foundations-dark-mode.md +85 -0
  44. package/dist/skills/maxio-react/references/foundations-design-tokens-about.md +108 -0
  45. package/dist/skills/maxio-react/references/foundations-design-tokens-colors-primitive-colors.md +33 -0
  46. package/dist/skills/maxio-react/references/foundations-design-tokens-colors-semantic-colors.md +11 -0
  47. package/dist/skills/maxio-react/references/foundations-start-here.md +128 -0
  48. package/dist/skills/maxio-react/references/patterns-auth-layout.md +318 -0
  49. package/dist/skills/maxio-react/references/patterns-side-nav.md +182 -0
  50. package/dist/skills/maxio-react/references/patterns-top-bar.md +214 -0
  51. package/package.json +2 -2
@@ -0,0 +1,103 @@
1
+ # Alert
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Alert presents contextual status feedback near the content or workflow it supports. Use it for concise messages that may include a follow-up link or a dismiss action.
8
+
9
+ #### When to Use
10
+
11
+ - Use Alert for contextual feedback tied to a specific page section, form, or workflow.
12
+ - Use Alert when the message benefits from a visible sentiment icon, short title, optional supporting copy, or follow-up link.
13
+ - Use Alert for status updates that can sit near the content they affect, such as pending verification, saved settings, warnings, or recoverable errors.
14
+
15
+ #### When Not to Use
16
+
17
+ - Do not use Alert for account-wide or system-wide announcements. Use Banner instead.
18
+ - Do not use Alert for inline field validation. Use the form field error state and error message instead.
19
+ - Do not use Alert for brief confirmation messages that should disappear automatically. Use a toast or notification pattern when available.
20
+
21
+ ### Variants
22
+
23
+ Choose the sentiment that matches the message tone and user urgency. The default `info` sentiment uses the base `.maxio-alert` styling without an additional modifier class.
24
+
25
+ | Variants | Purpose | Usage notes |
26
+ | :-------- | :------------------------------------- | :--------------------------------------------------------------------- |
27
+ | `info` | Neutral status or contextual guidance. | Use for non-blocking information, pending work, or helpful next steps. |
28
+ | `success` | Positive completion feedback. | Use when an action completed successfully and users may continue. |
29
+ | `warning` | Attention-needed status. | Use when users should review something before continuing. |
30
+ | `danger` | Error or high-risk status. | Use when a problem prevents progress or requires corrective action. |
31
+
32
+ ### Behavior
33
+
34
+ - **Mouse and touch**: link activation follows normal Link behavior. The dismiss button calls `onDismiss` when provided.
35
+ - **Keyboard**: links and dismiss buttons are included in the Tab order and activate with native keyboard behavior.
36
+ - **Focus management**: when dismissing an alert, move focus to a sensible nearby control if removing the alert would otherwise leave focus in an unstable place.
37
+ - **Dismissal or persistence**: include dismissal only for messages the user can safely hide. Keep required, blocking, or unresolved messages visible until the condition changes.
38
+ - **Layout**: use `display="inline"` for compact messages and `display="block"` when the title, message, and link need stacked spacing.
39
+
40
+ ### Accessibility
41
+
42
+ - Treat the alert as visible status content near the affected UI. Add a live region outside the component only when the message appears dynamically and must be announced.
43
+ - Keep the sentiment icon decorative with `aria-hidden="true"` so the title and message carry the accessible meaning.
44
+ - Provide a clear accessible name for the dismiss button. The React component uses `aria-label="Dismiss Notification"`.
45
+ - Do not rely on color or icon shape alone to communicate severity. Use the title and message to state the condition.
46
+ - Use a descriptive link label that explains the destination or next step.
47
+
48
+ ### Content
49
+
50
+ - Lead with the status or condition: "ACH verification is pending", "Payment method updated", "Invoice could not be sent".
51
+ - Keep the message to one short sentence when possible.
52
+ - Use link text for a concrete next step, such as "View verification status" or "Update payment method".
53
+ - Avoid repeating the sentiment in copy when the title can describe the outcome directly.
54
+
55
+ ### Related
56
+
57
+ - **[Banner](components-notifications-banner.md)**: use for page-level, account-level, or system-wide announcements.
58
+ - **[TextField](components-forms-textfield.md)**: use field-level error messaging for validation tied to one input.
59
+
60
+ ## React
61
+
62
+ ```tsx
63
+ import { Alert } from '@maxio-com/react-ui-components';
64
+ ```
65
+
66
+ ## Imports
67
+
68
+ ```tsx
69
+ import { Alert } from "@maxio-com/react-ui-components";
70
+ ```
71
+
72
+ ## Prop Types
73
+
74
+ ### Alert
75
+
76
+ | Prop | Type | Required | Default | Description | Source |
77
+ | --- | --- | --- | --- | --- | --- |
78
+ | `children` | `string` | no | - | Displays alert message | TypeLiteral |
79
+ | `className` | `string` | no | - | Additional CSS class name to be applied to the alert | TypeLiteral |
80
+ | `display` | `"inline" \| "block"` | no | `inline` | Changes the display of the alert. Defaults to `inline` | TypeLiteral |
81
+ | `href` | `string` | no | - | Sets the link target - `href` must be present to include a link | TypeLiteral |
82
+ | `linkExternal` | `boolean` | no | - | Sets the link target to '_blank' | TypeLiteral |
83
+ | `linkText` | `string` | no | - | Sets the link text - `linkText` must be present to include a link | TypeLiteral |
84
+ | `onDismiss` | `(() => void)` | no | - | A callback function to dismiss the alert | TypeLiteral |
85
+ | `sentiment` | `"danger" \| "info" \| "success" \| "warning"` | no | `info` | Changes the color and icon of the alert. Component sentiment defaults to `info` | TypeLiteral |
86
+ | `title` | `string` | no | - | Displays alert title | TypeLiteral |
87
+
88
+ ## Stories
89
+
90
+ ### Default
91
+
92
+ Use Alert for contextual feedback inside a page section or workflow. Choose the sentiment that matches the message, keep the copy short, and include a dismiss action only when the alert is not required for the user to continue.
93
+
94
+ ```tsx
95
+ const Default = () => <Alert
96
+ title="ACH verification is pending"
97
+ onDismiss={action('Alert dismissed')}
98
+ linkText="View verification status"
99
+ linkExternal={false}
100
+ href="/settings/billing"
101
+ sentiment="info"
102
+ display="inline">We will notify you when micro-deposits are ready to confirm.</Alert>;
103
+ ```
@@ -0,0 +1,173 @@
1
+ # Banner
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Banner communicates important page-level status, account, or product messages that should be noticed before the user continues their workflow.
8
+
9
+ #### When to Use
10
+
11
+ - Use Banner for important page-level notices that affect an account, product area, or workflow.
12
+ - Use Banner when the message should stay visible until the condition changes or the user dismisses a temporary notice.
13
+ - Use Banner when a message needs a sentiment icon, short title, message, and optional next-step link.
14
+
15
+ #### When Not to Use
16
+
17
+ - Do not use Banner for lightweight confirmations that can disappear automatically. Use Toast instead.
18
+ - Do not use Banner for field-level validation or inline form guidance. Use the relevant form component helper or error state instead.
19
+ - Do not use Banner as a persistent navigation or marketing surface.
20
+
21
+ ### Variants
22
+
23
+ Choose the sentiment that matches the urgency and consequence of the message.
24
+
25
+ | Sentiment | Purpose | Usage notes |
26
+ | :-------- | :------------------------------- | :-------------------------------------------------------------------------- |
27
+ | `info` | Neutral account or product note. | Use for reminders, setup prompts, and informational status. |
28
+ | `success` | Completed positive state. | Use when confirmation must stay visible beyond a transient toast. |
29
+ | `warning` | Attention needed soon. | Use for recoverable issues, missing setup, or risk that does not block use. |
30
+ | `danger` | Immediate critical attention. | Use for broken connections, failed required setup, or high-impact errors. |
31
+
32
+ ### Behavior
33
+
34
+ - **Mouse and touch**: links navigate to the provided destination; the dismiss button runs `onDismiss` when present.
35
+ - **Keyboard**: links and dismiss buttons follow native keyboard behavior through the underlying Link and IconButton components.
36
+ - **Focus management**: when a banner is dismissed, move focus only if removing the banner would otherwise strand keyboard focus.
37
+ - **Dismissal or persistence**: keep required status, error, and compliance messages persistent. Add dismissal only for temporary guidance.
38
+
39
+ ### Accessibility
40
+
41
+ - Use the banner for important page-level status updates and keep the message concise enough to be announced clearly.
42
+ - Keep the visible title and message meaningful without relying on the sentiment icon or color alone.
43
+ - Use a specific accessible name for dismiss controls when building equivalent HTML.
44
+ - Keep links descriptive so the destination or next step is clear out of context.
45
+ - Avoid stacking multiple assertive live-region banners unless each message truly needs immediate announcement.
46
+
47
+ ### Content
48
+
49
+ - Lead with the condition or outcome: "Billing reminder", "Domain verification needed", "Collections interrupted".
50
+ - Keep messages direct and actionable. Include a link only when there is a clear next step.
51
+ - Avoid vague titles such as "Notice" or "Update".
52
+ - Use dismissible banners for guidance users can safely hide, not for required account or error states.
53
+
54
+ ### Related
55
+
56
+ - **[Toast](components-notifications-toast.md)**: use for transient success, warning, or error feedback that can disappear automatically.
57
+ - **[Alert](components-notifications-alert.md)**: use for contextual notices inside a smaller surface when a full-width banner is too prominent.
58
+ - **[Link](components-link.md)**: use for inline navigation outside the banner pattern.
59
+
60
+ ## React
61
+
62
+ ```tsx
63
+ import { Banner } from '@maxio-com/react-ui-components';
64
+ ```
65
+
66
+ ## Imports
67
+
68
+ ```tsx
69
+ import { Banner } from "@maxio-com/react-ui-components";
70
+ ```
71
+
72
+ ## Prop Types
73
+
74
+ ### Banner
75
+
76
+ | Prop | Type | Required | Default | Description | Source |
77
+ | --- | --- | --- | --- | --- | --- |
78
+ | `children` | `string` | yes | - | Displays banner message | TypeLiteral |
79
+ | `className` | `string` | no | - | Additional CSS class name to be applied to the banner | TypeLiteral |
80
+ | `display` | `"inline" \| "block"` | no | `inline` | Changes the display of the banner. Defaults to `inline` | TypeLiteral |
81
+ | `href` | `string` | no | - | Sets the link target - `href` must be present to include a link | TypeLiteral |
82
+ | `linkExternal` | `boolean` | no | - | Sets the link target to '_blank' | TypeLiteral |
83
+ | `linkText` | `string` | no | - | Sets the link text - `linkText` must be present to include a link | TypeLiteral |
84
+ | `onDismiss` | `(() => void)` | no | - | A callback function to dismiss the banner | TypeLiteral |
85
+ | `sentiment` | `"danger" \| "info" \| "success" \| "warning"` | no | `info` | Changes the color and icon of the banner. Component sentiment defaults to `info` | TypeLiteral |
86
+ | `title` | `string` | no | - | Displays banner title | TypeLiteral |
87
+
88
+ ## Stories
89
+
90
+ ### Default
91
+
92
+ Use an info banner for neutral page-level notices that should be visible before the user continues.
93
+
94
+ ```tsx
95
+ const Default = (args) => {
96
+ const bannerProps = {
97
+ ...args,
98
+ onDismiss: args.onDismiss,
99
+ };
100
+
101
+ return <Banner {...bannerProps}></Banner>;
102
+ };
103
+ ```
104
+
105
+ ### Success
106
+
107
+ Use success when a completed account or workflow state still needs visible confirmation outside a toast.
108
+
109
+ ```tsx
110
+ const Success = () => <Banner
111
+ title="Payment method verified"
112
+ onDismiss={undefined}
113
+ linkText={undefined}
114
+ linkExternal={false}
115
+ href={undefined}
116
+ sentiment="success">Your payment method was verified and future invoices are ready.</Banner>;
117
+ ```
118
+
119
+ ### Warning
120
+
121
+ Use warning for messages that need attention soon but do not block the current page.
122
+
123
+ ```tsx
124
+ const Warning = () => <Banner
125
+ title="Domain verification needed"
126
+ onDismiss={undefined}
127
+ linkText="Verify domain"
128
+ linkExternal={false}
129
+ href="/settings/email-domain"
130
+ sentiment="warning">Some invoice emails are paused until your sending domain is verified.</Banner>;
131
+ ```
132
+
133
+ ### Danger
134
+
135
+ Use danger for critical account or product states that need immediate attention before work can continue confidently.
136
+
137
+ ```tsx
138
+ const Danger = () => <Banner
139
+ title="Collections interrupted"
140
+ onDismiss={undefined}
141
+ linkText="Reconnect gateway"
142
+ linkExternal={false}
143
+ href="/settings/payment-gateways"
144
+ sentiment="danger">Automatic collections are disabled because your payment gateway is disconnected.</Banner>;
145
+ ```
146
+
147
+ ### Dismissible
148
+
149
+ Use a dismissible banner only for temporary messages the user can safely hide without losing required status or error context.
150
+
151
+ ```tsx
152
+ const Dismissible = () => <Banner
153
+ title="New metrics available"
154
+ onDismiss={action('Banner dismissed')}
155
+ linkText="Review dashboard"
156
+ linkExternal={false}
157
+ href="/analytics">The dashboard has been updated with new subscription metrics.</Banner>;
158
+ ```
159
+
160
+ ### Block Layout
161
+
162
+ Use block display when title, message, and link text need more room to wrap clearly in narrow or content-heavy layouts.
163
+
164
+ ```tsx
165
+ const BlockLayout = () => <Banner
166
+ title="Manual review recommended"
167
+ onDismiss={undefined}
168
+ linkText="Open failed invoices"
169
+ linkExternal={false}
170
+ href="/invoices/failed"
171
+ display="block"
172
+ sentiment="warning">Review each failed invoice before retrying collection so customers do not receive duplicate notices.</Banner>;
173
+ ```
@@ -0,0 +1,155 @@
1
+ # Toast
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Toast displays short-lived feedback about a background or just-completed action.
8
+
9
+ #### When to Use
10
+
11
+ - Use Toast to confirm that a user action completed successfully without interrupting the workflow.
12
+ - Use Toast for short, time-sensitive updates that are useful immediately but do not need to remain on the page.
13
+ - Use Toast for background process feedback when the user can continue working.
14
+
15
+ #### When Not to Use
16
+
17
+ - Do not use Toast for information the user must review before continuing. Use Alert or Banner instead.
18
+ - Do not use Toast for validation errors tied to a form field. Place the error with the field.
19
+ - Do not use Toast for persistent system status, onboarding instructions, or long-form content.
20
+
21
+ ### Sentiments
22
+
23
+ Use sentiment to match the tone of the message. The sentiment changes the icon color and icon choice.
24
+
25
+ | Sentiment | Purpose | Usage notes |
26
+ | :-------- | :-------------------------------- | :-------------------------------------------------------------------------- |
27
+ | `info` | Neutral update or default notice. | Use for general status changes or background updates. |
28
+ | `success` | Completed or successful outcome. | Use after saving, creating, importing, or completing a requested action. |
29
+ | `warning` | Recoverable issue or caution. | Use when the user may need to check something but can keep working. |
30
+ | `danger` | Failed action or important error. | Use for failures that do not block the entire page or require a modal flow. |
31
+
32
+ ### Behavior
33
+
34
+ - **Mouse and touch**: users can dismiss closable toasts with the dismiss button.
35
+ - **Keyboard**: the dismiss button follows native button keyboard behavior with Tab, Enter, and Space.
36
+ - **Focus management**: do not move focus into a toast automatically. Keep focus in the user’s current workflow.
37
+ - **Queueing**: use `ToastQueue` to limit visible toasts and preserve ordering.
38
+ - **Dismissal or persistence**: keep toasts closable by default. Use timeouts only when the message can safely disappear.
39
+
40
+ ### Accessibility
41
+
42
+ - Use the React toast providers so React Aria can create the toast region and announcement semantics.
43
+ - Keep toast copy short enough to be announced clearly.
44
+ - Provide a visible title, a message, or both. Do not rely on the sentiment icon alone to communicate the outcome.
45
+ - Give the dismiss control an accessible name.
46
+ - Do not move keyboard focus to transient feedback unless the toast contains a critical recovery action.
47
+
48
+ ### Content
49
+
50
+ - Lead with the outcome: "Invoice created", "Payment failed", or "Customer imported".
51
+ - Keep the message to one concise sentence when possible.
52
+ - Use links only for a direct follow-up action, such as viewing the created object.
53
+ - Avoid stacking multiple toasts for the same event. Update the existing flow or use page-level feedback instead.
54
+
55
+ ### Related
56
+
57
+ - **[Alert](components-notifications-alert.md)**: use for contextual page feedback that should stay near related content.
58
+ - **[Banner](components-notifications-banner.md)**: use for important page-level or system-level messages.
59
+
60
+ ## React
61
+
62
+ ```tsx
63
+ import {
64
+ GlobalToastProvider,
65
+ ToastQueue,
66
+ useToast,
67
+ } from '@maxio-com/react-ui-components';
68
+ ```
69
+
70
+ ### Provider Setup
71
+
72
+ Create a `ToastQueue` and place `GlobalToastProvider` once near the application root.
73
+
74
+ ```tsx
75
+ const toastQueue = new ToastQueue({ maxVisibleToasts: 5 });
76
+
77
+ <GlobalToastProvider toastQueue={toastQueue}>
78
+ <App />
79
+ </GlobalToastProvider>;
80
+ ```
81
+
82
+ ### Triggering Toasts
83
+
84
+ Use `useToast` inside the provider tree. Keep the toast content short and reserve links for direct follow-up actions.
85
+
86
+ ```tsx
87
+ const { addToast, removeAllToasts } = useToast();
88
+
89
+ addToast({
90
+ title: 'Invoice created',
91
+ message: 'The invoice is ready to review and send.',
92
+ link: {
93
+ text: 'View invoice',
94
+ href: '/invoices/123',
95
+ },
96
+ sentiment: 'success',
97
+ });
98
+ ```
99
+
100
+ ### Legacy Provider
101
+
102
+ `ToastProvider` is still available for existing implementations, but new work should use `GlobalToastProvider`, `ToastQueue`, and `useToast`.
103
+
104
+ ## Imports
105
+
106
+ ```tsx
107
+ import { Button, GlobalToastProvider, Toast, ToastProvider } from "@maxio-com/react-ui-components";
108
+ ```
109
+
110
+ ## Prop Types
111
+
112
+ ### Toast
113
+
114
+ | Prop | Type | Required | Default | Description | Source |
115
+ | --- | --- | --- | --- | --- | --- |
116
+ | `className` | `string` | no | - | Additional classes to apply to the ToastRegion | ToastRegionProps |
117
+ | `state` | `ToastState<ToastContent>` | yes | - | The state for the toast provider | ToastRegionProps |
118
+ | `toast` | `QueuedToast<ToastContent>` | yes | - | To add content to a toast | ToastProps |
119
+
120
+ ## Stories
121
+
122
+ ### Default
123
+
124
+ Use the global toast API for new work. Place `GlobalToastProvider` once near the application root, then call `useToast().addToast(...)` from flows that need transient feedback.
125
+
126
+ ```tsx
127
+ const Default = () => {
128
+ const toastQueue = new ToastQueue({ maxVisibleToasts: 5 });
129
+ return (
130
+ <GlobalToastProvider toastQueue={toastQueue}>
131
+ <GlobalToastTrigger />
132
+ </GlobalToastProvider>
133
+ );
134
+ };
135
+ ```
136
+
137
+ ### Visible Toast
138
+
139
+ Use this story to inspect the toast anatomy. Product code should create this state by adding content to a `ToastQueue`, not by rendering `Toast` directly.
140
+
141
+ ```tsx
142
+ const VisibleToast = () => <VisibleToastExample />;
143
+ ```
144
+
145
+ ### Legacy Toast Provider
146
+
147
+ Legacy `ToastProvider` remains available for existing implementations. Use `GlobalToastProvider` and `useToast` for new screens.
148
+
149
+ ```tsx
150
+ const LegacyToastProvider = () => {
151
+ return (
152
+ <ToastProvider>{(state) => <ToastTrigger state={state} />}</ToastProvider>
153
+ );
154
+ };
155
+ ```
@@ -0,0 +1,115 @@
1
+ # Pagination
2
+
3
+ ## Usage Guidelines
4
+
5
+ ### Overview
6
+
7
+ Use Pagination to help users move through a paged dataset and adjust how many rows or records are shown at once.
8
+
9
+ #### When to Use
10
+
11
+ - Use Pagination when a table, activity feed, or search result list is split across pages.
12
+ - Use Pagination when users need to change the number of records shown per page.
13
+ - Use manual page input for very large result sets where a page select would create too many options.
14
+
15
+ #### When Not to Use
16
+
17
+ - Do not use Pagination for short lists where all results can be scanned comfortably on one page.
18
+ - Do not use Pagination for progressive loading or continuous feeds. Use a loading pattern that matches that experience instead.
19
+ - Do not use Pagination without updating the connected dataset when page or page size changes.
20
+
21
+ ### Behavior
22
+
23
+ - **Mouse and touch**: users can choose an items-per-page value, choose or type a page number, and move one page at a time with previous and next buttons.
24
+ - **Keyboard**: the selects, manual page input, and navigation buttons are reachable in tab order. Native selects, inputs, and buttons keep their browser keyboard behavior.
25
+ - **Focus management**: focus stays on the control the user activated while the paged content updates.
26
+ - **State changes**: changing items per page resets the current page to `1`; changing page reports the selected page and current page size through `onChange`.
27
+ - **Manual input**: typed values are validated on blur or Enter and clamped to the available page range.
28
+
29
+ ### Accessibility
30
+
31
+ - Use semantic form controls for the items-per-page selector and page selector or page input.
32
+ - Keep visible labels for items per page and descriptive accessible names for page selection, previous, and next controls.
33
+ - Disable previous and next controls when users are already on the first or last page.
34
+ - Keep the displayed item range, total item count, and total page count accurate after every dataset update.
35
+ - Do not rely on the chevron icons alone; preserve accessible button names for previous and next navigation.
36
+
37
+ ### Related
38
+
39
+ - **[DataTable](components-data-table.md)**: use with Pagination when tabular data needs paging, sorting, or selection.
40
+ - **[Select](components-forms-select.md)**: use for standalone option selection outside of a paging control.
41
+ - **[TextInput](deprecated-textinput.md)**: use for standalone typed values outside of a paging control.
42
+
43
+ ## React
44
+
45
+ ```tsx
46
+ import { Pagination } from '@maxio-com/react-ui-components';
47
+ ```
48
+
49
+ ### State Management
50
+
51
+ Pagination manages its selected page and page size internally, then reports changes through `onChange`.
52
+ Use `onChange` to request or filter the dataset that appears next to the component.
53
+
54
+ ```tsx
55
+ const [pageInfo, setPageInfo] = React.useState({
56
+ currentPage: 1,
57
+ itemsPerPage: 10,
58
+ });
59
+
60
+ <Pagination
61
+ totalItems={125}
62
+ pageSizeOptions={[10, 25, 50, 100]}
63
+ currentPage={pageInfo.currentPage}
64
+ itemsPerPage={pageInfo.itemsPerPage}
65
+ onChange={setPageInfo}
66
+ />;
67
+ ```
68
+
69
+ ## Imports
70
+
71
+ ```tsx
72
+ import { Pagination } from "@maxio-com/react-ui-components";
73
+ ```
74
+
75
+ ## Prop Types
76
+
77
+ ### Pagination
78
+
79
+ | Prop | Type | Required | Default | Description | Source |
80
+ | --- | --- | --- | --- | --- | --- |
81
+ | `currentPage` | `number` | no | `1` | Current page index | TypeLiteral |
82
+ | `itemsPerPage` | `number` | no | `30` | Number of items shown per page | TypeLiteral |
83
+ | `manualPageInput` | `boolean` | no | `false` | Use manual page input instead of dropdown for extremely large datasets | TypeLiteral |
84
+ | `onChange` | `((pageInfo: PageInfo) => void)` | no | - | Export of currentPage and itemsPerPage data as an object | TypeLiteral |
85
+ | `pageSizeOptions` | `number[]` | yes | - | Options for how many items are shown per page | TypeLiteral |
86
+ | `size` | `"sm" \| "md" \| "lg"` | no | `md` | Modifier for the size of Pagination component | TypeLiteral |
87
+ | `totalItems` | `number` | no | `0` | Total items returned from the API | TypeLiteral |
88
+
89
+ ## Stories
90
+
91
+ ### Pagination
92
+
93
+ Use Pagination when a table or list has more results than should appear on one screen. Keep the page size choices short and update the adjacent dataset when `onChange` reports a new page or item count.
94
+
95
+ ```tsx
96
+ const Default = () => <Pagination
97
+ totalItems={125}
98
+ pageSizeOptions={[10, 25, 50, 100]}
99
+ itemsPerPage={10}
100
+ currentPage={1} />;
101
+ ```
102
+
103
+ ### Pagination with manual page input
104
+
105
+ Use manual page input when the number of pages is large enough that rendering every page as a select option would hurt browser performance. Validate typed values and clamp them to the available page range.
106
+
107
+ ```tsx
108
+ const WithManualPageInput = () => <Pagination
109
+ totalItems={150}
110
+ pageSizeOptions={[10, 25, 50, 100]}
111
+ itemsPerPage={10}
112
+ currentPage={5}
113
+ size="lg"
114
+ manualPageInput />;
115
+ ```