@primereact/mcp 11.0.0 → 11.1.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/data/llms/headless/components/sidebar/api.json +1029 -54
- package/data/llms/headless/guides/misc/internationalization.md +282 -0
- package/data/llms/headless/guides/misc/locale.md +280 -0
- package/data/llms/llms-full.txt +9822 -1377
- package/data/llms/llms.txt +15 -0
- package/data/llms/primitive/components/sidebar/api.json +127 -33
- package/data/llms/primitive/guides/migration/updating-to-v11.md +2219 -0
- package/data/llms/primitive/guides/misc/internationalization.md +287 -0
- package/data/llms/primitive/guides/misc/locale.md +280 -0
- package/data/llms/styled/add-ons/designer/ci.md +273 -0
- package/data/llms/styled/add-ons/designer/guide.md +99 -0
- package/data/llms/styled/add-ons/designer/overview.md +194 -0
- package/data/llms/styled/add-ons/uikit/guide/v3.md +181 -0
- package/data/llms/styled/add-ons/uikit/guide/v4.md +163 -0
- package/data/llms/styled/add-ons/uikit/overview.md +204 -0
- package/data/llms/styled/components/datatable.md +8 -5
- package/data/llms/styled/components/menu.md +39 -41
- package/data/llms/styled/guides/configuration.md +198 -0
- package/data/llms/styled/guides/form/formik.md +448 -0
- package/data/llms/styled/guides/form/react-hook-form.md +503 -0
- package/data/llms/styled/guides/form/tanstack.md +502 -0
- package/data/llms/styled/guides/migration/updating-to-v11.md +2219 -0
- package/data/llms/styled/guides/misc/internationalization.md +379 -0
- package/data/llms/styled/guides/misc/locale.md +280 -0
- package/data/llms/tailwind/components/menu.md +5 -5
- package/data/llms/tailwind/components/tooltip.md +4 -13
- package/data/llms/tailwind/guides/misc/internationalization.md +287 -0
- package/data/llms/tailwind/guides/misc/locale.md +280 -0
- package/data/manifest.json +339 -24
- package/data/mcp-data.json +263 -8
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -5652,9 +5652,9 @@ function toggleFilterOverlay(
|
|
|
5652
5652
|
onToggleOverlay: (event: React.SyntheticEvent) => void,
|
|
5653
5653
|
onHideOverlay: () => void
|
|
5654
5654
|
) {
|
|
5655
|
-
if (e.value === overlayVisible) return;
|
|
5656
|
-
|
|
5657
5655
|
if (e.value) {
|
|
5656
|
+
if (overlayVisible) return;
|
|
5657
|
+
|
|
5658
5658
|
const nativeEvent = e.originalEvent;
|
|
5659
5659
|
const fakeSynthetic = {
|
|
5660
5660
|
preventDefault: () => nativeEvent?.preventDefault(),
|
|
@@ -7530,18 +7530,17 @@ import { Plus } from '@primeicons/react/plus';
|
|
|
7530
7530
|
import { Search } from '@primeicons/react/search';
|
|
7531
7531
|
import { Times } from '@primeicons/react/times';
|
|
7532
7532
|
import { Trash } from '@primeicons/react/trash';
|
|
7533
|
-
import type { DataTableColumnReorderEvent, DataTableSortEvent, SortOrder } from '@primereact/ui/datatable';
|
|
7534
|
-
import type { DataTablePaginationInstance, DataTableSelectionInstance } from '@primereact/ui/datatable';
|
|
7535
7533
|
import { Button } from '@primereact/ui/button';
|
|
7536
7534
|
import { Checkbox, type CheckboxRootChangeEvent } from '@primereact/ui/checkbox';
|
|
7535
|
+
import type { DataTableColumnReorderEvent, DataTablePaginationInstance, DataTableSelectionInstance, DataTableSortEvent, SortOrder } from '@primereact/ui/datatable';
|
|
7537
7536
|
import { DataTable } from '@primereact/ui/datatable';
|
|
7538
7537
|
import { Drawer, type DrawerRootChangeEvent } from '@primereact/ui/drawer';
|
|
7539
7538
|
import { IconField } from '@primereact/ui/iconfield';
|
|
7540
7539
|
import { InputText } from '@primereact/ui/inputtext';
|
|
7541
7540
|
import { Label } from '@primereact/ui/label';
|
|
7541
|
+
import type { MenuRadioItemGroupValueChangeEvent } from '@primereact/ui/menu';
|
|
7542
7542
|
import { Menu } from '@primereact/ui/menu';
|
|
7543
7543
|
import { Select, type SelectValueChangeEvent } from '@primereact/ui/select';
|
|
7544
|
-
import type { MenuRadioItemGroupValueChangeEvent } from '@primereact/ui/menu';
|
|
7545
7544
|
import * as React from 'react';
|
|
7546
7545
|
|
|
7547
7546
|
interface Row {
|
|
@@ -7628,11 +7627,13 @@ function PlainSelect({
|
|
|
7628
7627
|
value,
|
|
7629
7628
|
onChange,
|
|
7630
7629
|
options,
|
|
7630
|
+
size,
|
|
7631
7631
|
placeholder
|
|
7632
7632
|
}: {
|
|
7633
7633
|
value: string;
|
|
7634
7634
|
onChange: (v: string) => void;
|
|
7635
7635
|
options: { label: string; value: string }[];
|
|
7636
|
+
size?: 'small' | 'large';
|
|
7636
7637
|
placeholder?: string;
|
|
7637
7638
|
}) {
|
|
7638
7639
|
return (
|
|
@@ -7642,6 +7643,7 @@ function PlainSelect({
|
|
|
7642
7643
|
options={options}
|
|
7643
7644
|
optionLabel="label"
|
|
7644
7645
|
optionValue="value"
|
|
7646
|
+
size={size}
|
|
7645
7647
|
style={{ width: '100%' }}
|
|
7646
7648
|
>
|
|
7647
7649
|
<Select.Trigger>
|
|
@@ -8026,6 +8028,7 @@ export default function DatabaseEditorDemo() {
|
|
|
8026
8028
|
value={String(item.plan ?? 'free')}
|
|
8027
8029
|
onChange={(v) => commitCell(item.__rid, col.field, v)}
|
|
8028
8030
|
options={planOptions}
|
|
8031
|
+
size="small"
|
|
8029
8032
|
/>
|
|
8030
8033
|
) : (
|
|
8031
8034
|
<InputText
|
|
@@ -829,7 +829,7 @@ export default function InlineDemo() {
|
|
|
829
829
|
<ChevronDown className="size-3.5 transition-transform duration-200 [[data-open]>*>&]:rotate-180" />
|
|
830
830
|
</Menu.SubmenuIndicator>
|
|
831
831
|
</Menu.SubmenuTrigger>
|
|
832
|
-
<Menu.List className="ms-6! hidden! in-data-[part=
|
|
832
|
+
<Menu.List className="ms-6! hidden! in-data-[part=submenu]:in-data-open:flex!">
|
|
833
833
|
<Menu.Group>
|
|
834
834
|
<Menu.Item>
|
|
835
835
|
<Briefcase />
|
|
@@ -1082,58 +1082,47 @@ export default function TieredMenuDemo() {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
```
|
|
1084
1084
|
|
|
1085
|
-
###
|
|
1085
|
+
### Emoji Picker
|
|
1086
1086
|
|
|
1087
|
-
The Menu component can be customized
|
|
1087
|
+
The Menu component can be customized into a grid-based picker. By applying custom classes to `Menu.List` and `Menu.Item`, the menu layout becomes a categorized emoji grid, with `Menu.Label` marking each category and `Menu.Root`'s `onSelect` reporting the chosen emoji.
|
|
1088
1088
|
|
|
1089
1089
|
```tsx
|
|
1090
|
-
|
|
1091
|
-
import { Calendar } from '@primeicons/react/calendar';
|
|
1092
|
-
import { ChartLine } from '@primeicons/react/chart-line';
|
|
1093
|
-
import { Cloud } from '@primeicons/react/cloud';
|
|
1094
|
-
import { Cog } from '@primeicons/react/cog';
|
|
1095
|
-
import { Envelope } from '@primeicons/react/envelope';
|
|
1096
|
-
import { Image } from '@primeicons/react/image';
|
|
1097
|
-
import { MapMarker } from '@primeicons/react/map-marker';
|
|
1098
|
-
import { Search } from '@primeicons/react/search';
|
|
1099
|
-
import { Video } from '@primeicons/react/video';
|
|
1090
|
+
'use client';
|
|
1100
1091
|
import { Button } from '@primereact/ui/button';
|
|
1101
|
-
import { Menu } from '@primereact/ui/menu';
|
|
1092
|
+
import { Menu, type MenuItemSelectEvent } from '@primereact/ui/menu';
|
|
1102
1093
|
import * as React from 'react';
|
|
1103
1094
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
{ label: 'Maps', icon: <MapMarker />, gradient: 'from-emerald-500 to-green-600' },
|
|
1107
|
-
{ label: 'Mail', icon: <Envelope />, gradient: 'from-orange-400 to-red-500' },
|
|
1108
|
-
{ label: 'Drive', icon: <Cloud />, gradient: 'from-blue-500 to-indigo-600' },
|
|
1109
|
-
{ label: 'Calendar', icon: <Calendar />, gradient: 'from-violet-500 to-purple-600' },
|
|
1110
|
-
{ label: 'Photos', icon: <Image />, gradient: 'from-fuchsia-500 to-pink-600' },
|
|
1111
|
-
{ label: 'Videos', icon: <Video />, gradient: 'from-red-500 to-rose-600' },
|
|
1112
|
-
{ label: 'Analytics', icon: <ChartLine />, gradient: 'from-cyan-500 to-blue-600' },
|
|
1113
|
-
{ label: 'Settings', icon: <Cog />, gradient: 'from-slate-500 to-zinc-700' }
|
|
1114
|
-
];
|
|
1095
|
+
export default function EmojiPickerDemo() {
|
|
1096
|
+
const [selected, setSelected] = React.useState<string | null>(null);
|
|
1115
1097
|
|
|
1116
|
-
export default function AppsDemo() {
|
|
1117
1098
|
return (
|
|
1118
1099
|
<div className="flex justify-center">
|
|
1119
|
-
<Menu.Root>
|
|
1120
|
-
<Menu.Trigger as={Button} severity="secondary" variant="outlined"
|
|
1121
|
-
<
|
|
1100
|
+
<Menu.Root onSelect={(e: MenuItemSelectEvent) => setSelected(e.value)}>
|
|
1101
|
+
<Menu.Trigger as={Button} severity="secondary" variant="outlined" aria-label="Pick an emoji">
|
|
1102
|
+
<span className="text-lg leading-none">{selected ?? '🙂'}</span>
|
|
1103
|
+
Add reaction
|
|
1122
1104
|
</Menu.Trigger>
|
|
1123
1105
|
|
|
1124
1106
|
<Menu.Portal>
|
|
1125
|
-
<Menu.Positioner align="
|
|
1126
|
-
<Menu.Popup>
|
|
1127
|
-
<Menu.List className="grid! grid-cols-
|
|
1128
|
-
{
|
|
1129
|
-
<
|
|
1130
|
-
<
|
|
1131
|
-
|
|
1132
|
-
>
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1107
|
+
<Menu.Positioner align="start" sideOffset={12}>
|
|
1108
|
+
<Menu.Popup className="w-80">
|
|
1109
|
+
<Menu.List className="grid! grid-cols-8! gap-0.5! p-1.5! max-h-72 overflow-y-auto">
|
|
1110
|
+
{categories.map((category) => (
|
|
1111
|
+
<React.Fragment key={category.label}>
|
|
1112
|
+
<Menu.Label className="col-span-full px-1 pt-2 pb-0.5 text-xs font-medium text-surface-500 dark:text-surface-400">
|
|
1113
|
+
{category.label}
|
|
1114
|
+
</Menu.Label>
|
|
1115
|
+
{category.emojis.map((emoji) => (
|
|
1116
|
+
<Menu.Item
|
|
1117
|
+
key={emoji}
|
|
1118
|
+
value={emoji}
|
|
1119
|
+
aria-label={emoji}
|
|
1120
|
+
className="flex! items-center justify-center aspect-square p-0! text-2xl! leading-none rounded-md cursor-pointer data-focused:bg-surface-100 dark:data-focused:bg-surface-800"
|
|
1121
|
+
>
|
|
1122
|
+
{emoji}
|
|
1123
|
+
</Menu.Item>
|
|
1124
|
+
))}
|
|
1125
|
+
</React.Fragment>
|
|
1137
1126
|
))}
|
|
1138
1127
|
</Menu.List>
|
|
1139
1128
|
</Menu.Popup>
|
|
@@ -1143,6 +1132,15 @@ export default function AppsDemo() {
|
|
|
1143
1132
|
</div>
|
|
1144
1133
|
);
|
|
1145
1134
|
}
|
|
1135
|
+
|
|
1136
|
+
const categories = [
|
|
1137
|
+
{ label: 'Smileys', emojis: ['😀', '😃', '😄', '😁', '😆', '😅', '😂', '🙂', '😉', '😊', '😍', '🥰', '😘', '😎', '🤩', '🤔'] },
|
|
1138
|
+
{ label: 'Gestures', emojis: ['👍', '👎', '👌', '✌️', '🤞', '🤟', '👏', '🙌', '🙏', '💪', '👋', '🤝'] },
|
|
1139
|
+
{ label: 'Animals', emojis: ['🐶', '🐱', '🐭', '🐹', '🐰', '🦊', '🐻', '🐼', '🐨', '🐯', '🦁', '🐮'] },
|
|
1140
|
+
{ label: 'Food', emojis: ['🍎', '🍓', '🍕', '🍔', '🍟', '🌮', '🍣', '🍩', '🍪', '🎂', '🍫', '☕'] },
|
|
1141
|
+
{ label: 'Activities', emojis: ['⚽', '🏀', '🎮', '🎲', '🎸', '🎨', '🎬', '🏆', '🎯', '🎧', '🥁', '🎤'] },
|
|
1142
|
+
{ label: 'Symbols', emojis: ['❤️', '🧡', '💛', '💚', '💙', '💜', '🔥', '⭐', '✨', '🎉', '💯', '✅'] }
|
|
1143
|
+
];
|
|
1146
1144
|
```
|
|
1147
1145
|
|
|
1148
1146
|
## Related
|
|
@@ -84,6 +84,19 @@ ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
84
84
|
);
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
The same prop works on a single component, which takes precedence over the provider. This suits an application that is themed overall but has one screen styled differently.
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
<Select.Root unstyled>…</Select.Root>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
There is also a third option that does not involve the flag at all. Importing from `primereact` gives the unstyled primitives directly, so the theming layer never enters the bundle:
|
|
94
|
+
|
|
95
|
+
```tsx
|
|
96
|
+
import { Select } from '@primereact/ui/select'; // themed, opt out with `unstyled`
|
|
97
|
+
import { Select } from 'primereact/select'; // unstyled by construction
|
|
98
|
+
```
|
|
99
|
+
|
|
87
100
|
## PassThrough
|
|
88
101
|
|
|
89
102
|
Defines the shared pass through properties per component type. Visit the [Pass Through Props](/docs/passthrough) documentation for more information.
|
|
@@ -130,6 +143,53 @@ ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
130
143
|
);
|
|
131
144
|
```
|
|
132
145
|
|
|
146
|
+
## CSP
|
|
147
|
+
|
|
148
|
+
Components inject their styles as `<style>` elements at runtime. Under a Content Security Policy that restricts `style-src` to a nonce, those elements are blocked unless they carry the same nonce. The `csp.nonce` property applies it to every stylesheet PrimeReact injects.
|
|
149
|
+
|
|
150
|
+
```tsx showLineNumbers {4}
|
|
151
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
152
|
+
|
|
153
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
154
|
+
<PrimeReactProvider csp={{ nonce: 'YOUR_NONCE_VALUE' }}>
|
|
155
|
+
<App />
|
|
156
|
+
</PrimeReactProvider>
|
|
157
|
+
);
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The nonce has to match the one sent in the response header, and it is applied when a stylesheet is first created.
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Content-Security-Policy: style-src 'nonce-YOUR_NONCE_VALUE';
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Locale
|
|
167
|
+
|
|
168
|
+
Sets the language used for built-in component messages such as filter operators, month names and screen reader labels. English is registered by default, so this is only needed when another language is required. See the [Internationalization and Localization](/docs/styled/guides/misc/internationalization) documentation for registering languages, translating messages and ready-made translations.
|
|
169
|
+
|
|
170
|
+
```tsx showLineNumbers {4}
|
|
171
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
172
|
+
|
|
173
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
174
|
+
<PrimeReactProvider locale="de">
|
|
175
|
+
<App />
|
|
176
|
+
</PrimeReactProvider>
|
|
177
|
+
);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Languages other than English have to be registered before they can be selected. The `locales` property registers them and selects one in a single step.
|
|
181
|
+
|
|
182
|
+
```tsx showLineNumbers {2,5}
|
|
183
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
184
|
+
import { de } from 'primelocale/js/de.js';
|
|
185
|
+
|
|
186
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
187
|
+
<PrimeReactProvider locale="de" locales={{ de }}>
|
|
188
|
+
<App />
|
|
189
|
+
</PrimeReactProvider>
|
|
190
|
+
);
|
|
191
|
+
```
|
|
192
|
+
|
|
133
193
|
## InputVariant
|
|
134
194
|
|
|
135
195
|
Input fields come in two styles, default is `outlined` with borders around the field whereas `filled` alternative adds a background color to the field.
|
|
@@ -149,3 +209,141 @@ ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
149
209
|
</React.StrictMode>
|
|
150
210
|
);
|
|
151
211
|
```
|
|
212
|
+
|
|
213
|
+
## ZIndex
|
|
214
|
+
|
|
215
|
+
Overlays are layered automatically, and these values set the base each layer starts from. Raise them when PrimeReact overlays need to sit above other fixed elements on the page.
|
|
216
|
+
|
|
217
|
+
```tsx showLineNumbers {4-9}
|
|
218
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
219
|
+
|
|
220
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
221
|
+
<PrimeReactProvider
|
|
222
|
+
zIndex={{
|
|
223
|
+
modal: 1100,
|
|
224
|
+
overlay: 1000,
|
|
225
|
+
menu: 1000,
|
|
226
|
+
tooltip: 1100
|
|
227
|
+
}}
|
|
228
|
+
>
|
|
229
|
+
<App />
|
|
230
|
+
</PrimeReactProvider>
|
|
231
|
+
);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
| Key | Default | Applies to |
|
|
235
|
+
| --------- | ------- | ------------------------------- |
|
|
236
|
+
| `modal` | 1100 | Dialog, Drawer and other modals |
|
|
237
|
+
| `overlay` | 1000 | Select, DatePicker, Popover |
|
|
238
|
+
| `menu` | 1000 | Menu, ContextMenu |
|
|
239
|
+
| `tooltip` | 1100 | Tooltip |
|
|
240
|
+
|
|
241
|
+
## Defaults
|
|
242
|
+
|
|
243
|
+
Sets default props per component, applied everywhere that component is used. Anything passed at the call site still wins.
|
|
244
|
+
|
|
245
|
+
```tsx showLineNumbers {5-9}
|
|
246
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
247
|
+
|
|
248
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
249
|
+
<PrimeReactProvider
|
|
250
|
+
defaults={{
|
|
251
|
+
Button: { props: { size: 'small', severity: 'secondary' } },
|
|
252
|
+
InputText: { props: { variant: 'filled' } },
|
|
253
|
+
Dialog: { props: { modal: true, closeOnEscape: false } }
|
|
254
|
+
}}
|
|
255
|
+
>
|
|
256
|
+
<App />
|
|
257
|
+
</PrimeReactProvider>
|
|
258
|
+
);
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
A call site still overrides what it sets:
|
|
262
|
+
|
|
263
|
+
```tsx
|
|
264
|
+
// Renders large, not small.
|
|
265
|
+
<Button size="large">Save</Button>
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
This is the place for house style that would otherwise be repeated on every instance, or wrapped in a local component just to change a default.
|
|
269
|
+
|
|
270
|
+
### Keys
|
|
271
|
+
|
|
272
|
+
The key is the component's registered name. For compound components that name includes the part, and four spellings are accepted so the config reads the way you want it to:
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
<PrimeReactProvider
|
|
276
|
+
defaults={{
|
|
277
|
+
'Checkbox.Root': { props: { size: 'small' } }, // registered name
|
|
278
|
+
CheckboxRoot: { props: { size: 'small' } }, // without the dot
|
|
279
|
+
Checkbox: { Root: { props: { size: 'small' } } }, // nested
|
|
280
|
+
button: { props: { size: 'small' } } // lowercase
|
|
281
|
+
}}
|
|
282
|
+
>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Event handlers
|
|
286
|
+
|
|
287
|
+
Handlers work here too, and they run alongside the one at the call site rather than replacing it. This suits cross-cutting behaviour such as analytics:
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
<PrimeReactProvider defaults={{ Button: { props: { onClick: track } } }}>
|
|
291
|
+
<Button onClick={save}>Save</Button>
|
|
292
|
+
</PrimeReactProvider>
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
Clicking runs `track` and then `save`. The same chaining applies to any function prop.
|
|
296
|
+
|
|
297
|
+
### Dynamic defaults
|
|
298
|
+
|
|
299
|
+
An entry can be a function that returns the props to apply. It receives the base instance, which carries `name`, `id` and the props passed at the call site as `inProps`:
|
|
300
|
+
|
|
301
|
+
```tsx
|
|
302
|
+
<PrimeReactProvider
|
|
303
|
+
defaults={{
|
|
304
|
+
Button: (instance) => ({
|
|
305
|
+
props: { size: instance.inProps?.severity === 'danger' ? 'large' : 'small' }
|
|
306
|
+
})
|
|
307
|
+
}}
|
|
308
|
+
>
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
## FilterMatchModeOptions
|
|
312
|
+
|
|
313
|
+
Defines which match modes appear in filter menus, grouped by data type. Components such as DataTable read this when building their filter dropdowns.
|
|
314
|
+
|
|
315
|
+
```tsx showLineNumbers {2,6-9}
|
|
316
|
+
import { PrimeReactProvider } from '@primereact/core';
|
|
317
|
+
import { FilterMatchMode } from '@primereact/ui/datatable';
|
|
318
|
+
|
|
319
|
+
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
320
|
+
<PrimeReactProvider
|
|
321
|
+
filterMatchModeOptions={{
|
|
322
|
+
text: [FilterMatchMode.CONTAINS, FilterMatchMode.EQUALS],
|
|
323
|
+
numeric: [FilterMatchMode.EQUALS, FilterMatchMode.LESS_THAN],
|
|
324
|
+
date: [FilterMatchMode.DATE_IS, FilterMatchMode.DATE_BEFORE]
|
|
325
|
+
}}
|
|
326
|
+
>
|
|
327
|
+
<App />
|
|
328
|
+
</PrimeReactProvider>
|
|
329
|
+
);
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
Leaving it unset keeps the built-in list, which covers the common match modes for each type.
|
|
333
|
+
|
|
334
|
+
## Stylesheet
|
|
335
|
+
|
|
336
|
+
Collects the styles of rendered components so they can be sent with the server response instead of being injected after hydration. This is what prevents a flash of unstyled content in server-rendered applications.
|
|
337
|
+
|
|
338
|
+
```tsx showLineNumbers {2,5,9}
|
|
339
|
+
'use client';
|
|
340
|
+
import { PrimeReactProvider, PrimeReactStyleSheet } from '@primereact/core';
|
|
341
|
+
|
|
342
|
+
const styledStyleSheet = new PrimeReactStyleSheet();
|
|
343
|
+
|
|
344
|
+
export default function Provider({ children }) {
|
|
345
|
+
return <PrimeReactProvider stylesheet={styledStyleSheet}>{children}</PrimeReactProvider>;
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
The [Next.js installation guide](/docs/styled/guides/installation/nextjs) shows the full setup, including how the collected styles are flushed with `useServerInsertedHTML`.
|