### Installation and Setup Source: https://context7.com/koobiq/react-components/llms.txt Instructions on how to install the Koobiq React Components library and its peer dependencies using npm, pnpm, or yarn. ```APIDOC ## Installation and Setup Instructions on how to install the Koobiq React Components library and its peer dependencies. ### Method ```bash # Using npm npm install @koobiq/react-components @koobiq/design-tokens # Using pnpm pnpm add @koobiq/react-components @koobiq/design-tokens # Using yarn yarn add @koobiq/react-components @koobiq/design-tokens ``` ``` -------------------------------- ### Installation Source: https://github.com/koobiq/react-components/blob/main/packages/icons/README.md Instructions for installing the @koobiq/react-icons package using npm, yarn, or pnpm. ```APIDOC ## Installation Depending on your preference, run one of the following in your terminal: ```sh # With npm npm install @koobiq/react-icons # With yarn yarn add @koobiq/react-icons # With pnpm pnpm add @koobiq/react-icons ``` ``` -------------------------------- ### Setup Koobiq React Theme and Provider Source: https://github.com/koobiq/react-components/blob/main/docs/0-welcome.mdx Example of setting up the Koobiq React theme and Provider in a React application. It demonstrates importing necessary CSS tokens and components, and wrapping the application with the Provider for theme access. ```tsx // General tokens for all themes import '@koobiq/design-tokens/web/css-tokens.css'; // Tokens for a light theme, use .kbq-light import '@koobiq/design-tokens/web/css-tokens-light.css'; // Tokens for a dark theme, use .kbq-dark import '@koobiq/design-tokens/web/css-tokens-dark.css'; // Component styles import '@koobiq/react-components/style.css'; import { Provider, Typography } from '@koobiq/react-components'; export default function App() { return (
Hello, Koobiq React!
); } ``` -------------------------------- ### Install @koobiq/react-icons Source: https://github.com/koobiq/react-components/blob/main/packages/icons/README.md Commands to install the package using common Node.js package managers like npm, yarn, or pnpm. ```shell npm install @koobiq/react-icons yarn add @koobiq/react-icons pnpm add @koobiq/react-icons ``` -------------------------------- ### Install Koobiq React Dependencies Source: https://context7.com/koobiq/react-components/llms.txt Commands to install the core component library and design tokens using common package managers like npm, pnpm, and yarn. ```bash # Using npm npm install @koobiq/react-components @koobiq/design-tokens # Using pnpm pnpm add @koobiq/react-components @koobiq/design-tokens # Using yarn yarn add @koobiq/react-components @koobiq/design-tokens ``` -------------------------------- ### Start Next.js Development Server Source: https://github.com/koobiq/react-components/blob/main/templates/nextjs/template/README.md Commands to launch the local development environment. These commands monitor file changes and automatically update the application in the browser. ```bash npm run dev yarn dev pnpm dev bun dev ``` -------------------------------- ### Button as a Link Example Source: https://github.com/koobiq/react-components/blob/main/packages/primitives/src/components/Button/Button.mdx Shows how to render the Button component as an anchor (``) tag using the `as` prop, maintaining button-like interaction states while functioning as a link. ```tsx ``` -------------------------------- ### Basic List Usage (TypeScript) Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/List/List.mdx Shows a basic example of rendering a List with items and sections. It includes List.Item, List.ItemText, and List.Section components. ```tsx import { List } from '@koobiq/react-components'; label label ; ``` -------------------------------- ### Using Icons and Item Details Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Select/Select.mdx Examples of incorporating icons and additional details within Select items. ```APIDOC ## With icons See the example below how to use [icons](?path=/docs/icons--docs) in items of the component. ## With item details See the example below for using details in items of the component. ``` -------------------------------- ### useHideOverflowItems Examples Source: https://github.com/koobiq/react-components/blob/main/packages/core/src/hooks/useHideOverflowItems/useHideOverflowItems.mdx Examples demonstrating the usage of the useHideOverflowItems hook for different overflow scenarios. ```APIDOC ## useHideOverflowItems Examples ### Start Example: hides overflow items from the start. ### End Example: hides overflow items from the end. ### Center Example: hides overflow items from the center. ### Pinned Example: hides overflow items from the end and keeping the first visible. ``` -------------------------------- ### Install Koobiq React Components Source: https://github.com/koobiq/react-components/blob/main/docs/0-welcome.mdx Command to add Koobiq design tokens and React components to an existing project using pnpm. This is the first step to integrate the design system. ```bash pnpm add @koobiq/design-tokens @koobiq/react-components ``` -------------------------------- ### Loading Button Example Source: https://github.com/koobiq/react-components/blob/main/packages/primitives/src/components/Button/Button.mdx Illustrates how to display a loading state for the Button component using the `isLoading` prop, which disables interactions while remaining focusable and providing accessibility feedback. ```tsx ``` -------------------------------- ### SkeletonBlock Component Usage Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/SkeletonBlock/SkeletonBlock.mdx Documentation for the SkeletonBlock component, including props and implementation examples. ```APIDOC ## SkeletonBlock Component ### Description SkeletonBlock is a preview placeholder component used to indicate that content is loading, which helps reduce user frustration during data fetching. ### Props - **children** (ReactNode) - Optional - The content to be wrapped by the skeleton. - **variant** (string) - Optional - Defines the style variant of the skeleton (e.g., 'stable'). ### Usage Example ```jsx ``` ### Example 1: Wrapping Components Wrap your existing components with SkeletonBlock to show a loading state. ### Example 2: Modeling Skeletons Use the component to model specific skeleton layouts that match your component's structure. ``` -------------------------------- ### Alert Component Examples Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Alert/Alert.mdx Provides various examples of the Alert component showcasing different functionalities and customization options. These include basic usage, status variations, colored backgrounds, compact view, close buttons, actions, hidden icons, and custom icons. ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` ```tsx ``` -------------------------------- ### Install Fontsource Packages Source: https://github.com/koobiq/react-components/blob/main/docs/5-fonts.mdx Use pnpm to install the required Inter and JetBrains Mono font packages from Fontsource. This is the recommended approach for local font management. ```bash pnpm add @fontsource/inter @fontsource/jetbrains-mono ``` -------------------------------- ### Position Grid Item Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Grid/Grid.mdx Explains how to position a Grid.Item at a specific column start using 'colStart' or a specific row start using 'rowStart'. ```tsx ... ... ``` -------------------------------- ### Basic Navbar Usage (React) Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Navbar/Navbar.mdx Demonstrates the fundamental structure of the Navbar component using its subcomponents: Header, Body, and Footer. It includes examples of AppItem and Item for navigation links. ```tsx import { Navbar} from '@koobiq/react-components'; App 1 Dashboard Reports Settings ; ``` -------------------------------- ### ProgressSpinner Loading Emulation Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/ProgressSpinner/ProgressSpinner.mdx Provides an example of how to emulate loading behavior with the ProgressSpinner component. This can be used for simulating background operations. ```tsx // Example of loading emulation (specific code not provided in source) // This snippet would typically involve state management and timers // to dynamically update the 'value' prop or toggle 'isIndeterminate'. ``` -------------------------------- ### Button Render Props Example Source: https://github.com/koobiq/react-components/blob/main/packages/primitives/src/components/Button/Button.mdx Illustrates how to use render functions for `className`, `style`, and `children` props to dynamically adjust the Button's appearance and content based on interaction states. ```ts export type ButtonRenderProps = { isHovered: boolean; isFocused: boolean; isPressed: boolean; isLoading: boolean; isDisabled: boolean; isFocusVisible: boolean; }; ``` ```tsx import { clsx } from '@koobiq/react-core'; const MyButton = () => ( ); ``` -------------------------------- ### Display a Basic Toast Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/ToastProvider/ToastProvider.mdx Shows how to trigger a toast notification using the `toast.add()` function. This example adds a simple toast with a title when a button is pressed. ```tsx ``` -------------------------------- ### Addons Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TimePicker/TimePicker.mdx Shows how to include additional content before or after the input field using the `startAddon` and `endAddon` props. ```APIDOC ## Addons You can add an extra content using the `startAddon` and `endAddon` props. ``` -------------------------------- ### Basic Usage Source: https://github.com/koobiq/react-components/blob/main/packages/icons/README.md Demonstrates how to import and use a basic icon component from the package. ```APIDOC ## Usage Import the required icon from the package: ```tsx import { IconCheck16 } from '@koobiq/react-icons'; const Icon = () => ; ``` ``` -------------------------------- ### Integrate Koobiq with Next.js Source: https://context7.com/koobiq/react-components/llms.txt Provides the CLI command to initialize a Koobiq project and the layout configuration required to set up the Provider and global styles. ```bash npx create-next-app --example "https://github.com/koobiq/react-components/tree/main/templates/nextjs/template" my-app cd my-app npm run dev ``` ```tsx import { Provider } from '@koobiq/react-components'; import '@koobiq/react-components/style.css'; import '@koobiq/design-tokens/css/tokens/light.css'; export default function RootLayout({ children }) { return ( {children} ); } ``` -------------------------------- ### Nested Grid Structure Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Grid/Grid.mdx Shows an example of nesting Grid components within each other to create complex layouts. ```tsx Parent Item 1 Nested Item 1 ``` -------------------------------- ### Import useMediaQuery Hook Source: https://github.com/koobiq/react-components/blob/main/packages/core/src/hooks/useMediaQuery/useMediaQuery.mdx Demonstrates how to import the useMediaQuery hook from the @koobiq/react-core library. ```tsx import { useMediaQuery } from '@koobiq/react-core'; ``` -------------------------------- ### Basic Textarea Usage Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Textarea/Textarea.mdx Shows the basic implementation of the Textarea component. This serves as a starting point for integrating the component into your application. ```tsx