@kofile/gds-react
v1.4.7
Published
This package is designed to help you streamline your development process and create beautiful user interfaces.
Maintainers
Keywords
Readme
Welcome to GDS React
This package is designed to help you streamline your development process and create beautiful user interfaces.
Getting Started
To get started with GDS React, please refer to our documentation on Storybook. Storybook provides an interactive and visual way to explore and understand how to use our components and features.
Server-Side Rendering (SSR) Compatibility
Our design system components are categorized by their SSR compatibility to help you choose the right components for your rendering strategy.
✅ SSR Compatible Components
These components render purely static HTML and work perfectly with server-side rendering:
Basic UI Components:
Button- Pure HTML button with data attributesBadge- Simple span element with styling propsCard- Basic div container with data attributesLoader- Static div elementDivider- Uses Radix Separator (SSR compatible)Avatar- Uses Radix Avatar (SSR compatible)Banner- Static div with role="status"Navigation- Pure HTML nav structure with compound componentsTable- Standard HTML table elements with data attributesInput- UsesReact.useId()but renders static HTMLLabel- Basic label elementFormLabel- Basic label elementFieldMessage- Static div for form messagesLink- Basic anchor elementLogo- Image elementIconWrap- Static wrapper elementEmptyState- Static content container
Form Components:
Checkbox- Uses Radix Checkbox (SSR compatible)Switch- Uses Radix Switch (SSR compatible)RadioGroup- Uses Radix RadioGroup (SSR compatible)Slider- Uses Radix Slider (SSR compatible)Progress- Uses Radix Progress (SSR compatible)
⚠️ SSR with Hydration Required
These components need client-side JavaScript to function but can be server-rendered with hydration:
Interactive Components:
Accordion- Uses Radix Accordion, needs hydration for expand/collapseTabs- Uses Radix Tabs, needs hydration for tab switchingCollapsible- Uses Radix Collapsible, needs hydration for show/hideSelect- Uses Radix DropdownMenu, needs hydration for dropdown behaviorMenu- Uses Radix DropdownMenu, needs hydration for menu interactionsPopover- Uses Radix Popover, needs hydration for positioning and show/hideTooltip- Uses Radix Tooltip, needs hydration for hover/focus behavior
Overlay Components:
Dialog- Uses Radix Dialog, needs hydration for portal rendering and focus managementModal- Uses Radix Dialog, needs hydration for portal rendering and focus managementAlertDialog- Uses Radix AlertDialog, needs hydration for portal renderingToast- Uses Radix Toast, needs hydration for portal rendering and auto-dismiss
❌ CSR Only Components
These components require client-side only features and cannot be server-rendered:
Complex Interactive Components:
Table.AdjustmentBar- UsesuseEffectfor lifecycle management and complex stateTable.ColumnMenu- Complex state management and DOM manipulationTable.IndeterminateCheckbox- Complex checkbox state management
Components with Browser APIs:
- Navigation demos - Use custom hooks like
useIsMobileanduseLockBodyScrollthat depend onwindowobject - Select demos - Use
useEffectwith event listeners and DOM manipulation - Table demos - Use
useReactTablehook with complex state management
Usage Recommendations
- For SSR: Use the SSR-compatible components directly
- For SSR with Hydration: Use Next.js
dynamicimports withssr: falsefor overlay components - For CSR Only: These should only be used in client-side rendered applications
- Testing: Test SSR compatibility by disabling JavaScript in your browser to see which components still function
Features
GDS React offers a range of features that can enhance your development workflow. Feel free to browse through the Storybook documentation to discover what our package can do for you.
If you encounter any issues or have questions, please don't hesitate to reach out to our support team or contribute to the project on GitHub.
Happy coding!
