### 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 (
);
}
```
--------------------------------
### 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 = () => (
clsx(
'myButton',
isHovered && 'myButton--hovered',
isPressed && 'myButton--pressed'
)
}
style={({ isPressed }) => ({
transform: isPressed ? 'scale(0.95)' : 'scale(1)',
transition: 'transform 120ms ease',
})}
>
{({ isLoading }) => (isLoading ? 'Loading…' : 'Action')}
);
```
--------------------------------
### 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
toast.add({ title: 'Toast title' })}>
Show a toast
```
--------------------------------
### 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
```
--------------------------------
### InputNumber with Addons
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/InputNumber/InputNumber.mdx
Illustrates how to use the `startAddon` and `endAddon` props to include additional content before or after the input field in the InputNumber component.
```tsx
```
--------------------------------
### ProgressSpinner Base Usage
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/ProgressSpinner/ProgressSpinner.mdx
Shows the basic implementation of the ProgressSpinner component. This serves as a starting point for displaying visual progress in your application.
```tsx
```
--------------------------------
### Implement Input Components
Source: https://context7.com/koobiq/react-components/llms.txt
Shows how to use the Input component with labels, validation, captions, addons, and various states like disabled or read-only.
```tsx
import { Input } from '@koobiq/react-components';
import { IconSearch16, IconUser16 } from '@koobiq/react-icons';
function InputExamples() {
const [value, setValue] = useState('');
return (
<>
setValue(e.target.value)} />
} placeholder="Search..." isClearable onClear={() => setValue('')} />
>
);
}
```
--------------------------------
### Disabled Button Example
Source: https://github.com/koobiq/react-components/blob/main/packages/primitives/src/components/Button/Button.mdx
Demonstrates how to disable the Button component using the `isDisabled` prop, making it non-interactive and applying appropriate semantics for accessibility.
```tsx
```
--------------------------------
### Importing Menu Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Menu/Menu.mdx
Demonstrates how to import the Menu component from the @koobiq/react-components library.
```tsx
import {
Menu,
} from '@koobiq/react-components';
```
--------------------------------
### Autocomplete with Addons
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Autocomplete/Autocomplete.mdx
Shows how to include additional content before or after the input field in the Autocomplete component using the `startAddon` and `endAddon` props. This can be used for icons, buttons, or other UI elements.
```tsx
import { Autocomplete } from '@koobiq/react-components';
import { SearchIcon } from '@heroicons/react/outline'; // Example icon
function AutocompleteWithAddons() {
const items = [
{ key: '1', text: 'Option 1' },
{ key: '2', text: 'Option 2' },
];
return (
}
endAddon={Go }
/>
);
}
```
--------------------------------
### Value Range
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TimePicker/TimePicker.mdx
Illustrates how to restrict the selectable time range using the `minValue` and `maxValue` props, providing an example for times between 9 AM and 5 PM.
```APIDOC
## Minimum and maximum values
The `minValue` and `maxValue` props can also be used to ensure the value is within a specific range.
This example only accepts times between 9 AM and 5 PM.
```
--------------------------------
### Import Tooltip Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Tooltip/Tooltip.mdx
Demonstrates how to import the Tooltip component from the @koobiq/react-components library.
```tsx
import {
Tooltip
} from '@koobiq/react-components';
```
--------------------------------
### Implementing TagGroup with Props
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TagGroup/TagGroup.mdx
Demonstrates the basic implementation of a TagGroup component. It highlights the use of variants, icons, removal handlers, and disabled keys for interactive tag management.
```jsx
console.log("Removed:", key)}
disabledKeys={["item-2"]}
>
}>Tag One
Tag Two
```
--------------------------------
### Select Content Handling
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Select/Select.mdx
Demonstrates how to handle static and dynamic collections of items for the Select component.
```APIDOC
## Content
Select accepts static and dynamic collections. The examples above show static collections, which can be used when the full list of options is known ahead of time. Dynamic collections can be used when the options come from an external data source such as an API call, or update over time.
As seen below, an iterable list of options is passed to the `Select` using the `items` prop. Each item accepts an `key` prop, which is passed to the `onSelectionChange` handler to identify the selected item. Alternatively, if the item objects contain an `key` property, as shown in the example below, then this is used automatically and an `key` prop is not required.
```
--------------------------------
### Integrating with Next.js Link
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Link/Link.mdx
Demonstrates how to use the 'as' prop to integrate the Koobiq Link with the Next.js Link component for optimized client-side navigation.
```tsx
import NextLink from 'next/link';
Some page
;
```
--------------------------------
### TimePicker Minimum and Maximum Values
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TimePicker/TimePicker.mdx
Shows how to restrict the selectable time range using the `minValue` and `maxValue` props. This example enforces a range between 9 AM and 5 PM.
```tsx
import { parseTime } from '@internationalized/date';
```
--------------------------------
### Log standard messages with @koobiq/logger
Source: https://github.com/koobiq/react-components/blob/main/packages/logger/README.md
Demonstrates how to import and use the logger utility to output info, warning, and error messages to the console.
```javascript
import { logger } from '@koobiq/logger';
logger.info('Info message');
logger.warn('Warning message');
logger.error('Error message');
```
--------------------------------
### Implement Button Components
Source: https://context7.com/koobiq/react-components/llms.txt
Demonstrates usage of Button and IconButton components with various variants, loading states, icons, and polymorphic rendering.
```tsx
import { Button, IconButton } from '@koobiq/react-components';
import { IconPlus16, IconTrash16 } from '@koobiq/react-icons';
function ButtonExamples() {
return (
<>
console.log('Pressed')}>Primary Action
Secondary
Delete
}>Add Item
} variant="error-fade">Remove
Processing...
Submit Form
Go to Dashboard
>
);
}
```
--------------------------------
### Implement Select Component with Koobiq
Source: https://context7.com/koobiq/react-components/llms.txt
Demonstrates various configurations for the Select component, including single and multi-select modes, categorized sections, and async loading with infinite scroll capabilities.
```tsx
import { Select, SelectNext, useListData } from '@koobiq/react-components';
function SelectExamples() {
const [selectedKey, setSelectedKey] = useState(null);
return (
<>
United States
United Kingdom
Canada
console.log('Selected:', keys)}
>
Bug
Feature
Documentation
Super Admin
Admin
Editor
Viewer
fetchNextPage()}
>
{users.map((user) => (
{user.name}
))}
>
);
}
```
--------------------------------
### Configure Google Web Fonts via CDN
Source: https://github.com/koobiq/react-components/blob/main/docs/5-fonts.mdx
Add the required link tags to your HTML document head to load fonts directly from the Google Fonts CDN. This approach requires no local package installation.
```html
```
--------------------------------
### TimePicker Addons
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TimePicker/TimePicker.mdx
Illustrates how to add custom content before or after the TimePicker input using the `startAddon` and `endAddon` props. This is useful for including icons or other related elements.
```tsx
```
--------------------------------
### Importing useResizeObserver
Source: https://github.com/koobiq/react-components/blob/main/packages/core/src/hooks/useResizeObserver/useResizeObserver.mdx
Shows how to import the hook from the @koobiq/react-core package.
```tsx
import { useResizeObserver } from '@koobiq/react-core';
```
--------------------------------
### Configure ESLint for Type-Aware Linting in Vite
Source: https://github.com/koobiq/react-components/blob/main/templates/vite/template/README.md
This snippet shows how to configure ESLint in a Vite project to enable type-aware linting rules. It involves setting the 'parserOptions.project' and 'tsconfigRootDir' properties, and replacing default recommended configurations with type-checked versions. Ensure 'eslint-plugin-react' is installed for React-specific rules.
```javascript
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
});
```
--------------------------------
### Implementing Link with render props
Source: https://github.com/koobiq/react-components/blob/main/packages/primitives/src/components/Link/Link.mdx
Demonstrates using render functions for className, style, and children to apply state-based styling and dynamic content.
```tsx
import { clsx } from '@koobiq/react-core';
const MyLink = () => (
clsx(
'myLink',
isHovered && 'myLink--hovered',
isPressed && 'myLink--pressed',
isDisabled && 'myLink--disabled'
)
}
style={({ isPressed }) => ({
transform: isPressed ? 'translateY(1px)' : 'translateY(0)',
transition: 'transform 120ms ease',
})}
>
{({ isDisabled }) => (isDisabled ? 'Unavailable' : 'Read docs')}
);
```
--------------------------------
### Initialize ToastProvider in Layout
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/ToastProvider/ToastProvider.mdx
Demonstrates how to integrate the ToastProvider into your application's layout. The ToastProvider must be rendered in the component tree to enable the toast functionality. It wraps the main application content.
```tsx
import { Provider, ToastProvider } from '@koobiq/react-components';
export function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
>
);
}
```
--------------------------------
### Select Component Overview
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Select/Select.mdx
Introduction to the Select component and its deprecation notice.
```APIDOC
## Select Component
Please use [SelectNext](?path=/docs/components-selectnext--docs) instead.
A select displays a collapsible list of options and allows a user to select one or more of them.
```tsx
import { Select } from '@koobiq/react-components';
```
```
--------------------------------
### Import Grid Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Grid/Grid.mdx
Demonstrates how to import the Grid component from the @koobiq/react-components library for use in a React application.
```tsx
import { Grid } from '@koobiq/react-components';
```
--------------------------------
### Addons
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Select/Select.mdx
How to include additional content before or after the Select input using addons.
```APIDOC
## Addons
You can add an extra content using the `startAddon` and `endAddon` props.
```
--------------------------------
### Import and Usage of useCopyToClipboard
Source: https://github.com/koobiq/react-components/blob/main/packages/core/src/hooks/useCopyToClipboard/useCopyToClipboard.mdx
Demonstrates how to import the hook from the package and its basic usage within a React component. The hook returns the current copied value and a copy function that accepts a string.
```tsx
import { useCopyToClipboard } from '@koobiq/react-core';
const MyComponent = () => {
const [copied, copy] = useCopyToClipboard();
return copy('Hello')}>Copy ;
};
```
--------------------------------
### Alert with Actions
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Alert/Alert.mdx
Demonstrates adding custom actions to the Alert using the `action` prop.
```APIDOC
## Alert with Actions
### Description
Add an action to your Alert with the `action` prop. This is typically used for buttons or links related to the alert message.
### Usage
```tsx
const alertAction = (
alert('Action clicked!')}>Learn More
);
This alert has a custom action.
```
```
--------------------------------
### Import Popover Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Popover/Popover.mdx
Demonstrates how to import the Popover component from the @koobiq/react-components library.
```tsx
import { Popover } from '@koobiq/react-components';
```
--------------------------------
### Input Component Props
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Input/Input.mdx
Detailed documentation for the Input component properties and configuration options.
```APIDOC
## Input Component
### Description
The Input component is used to capture user text input. It supports various states, visual variants, and layout configurations.
### Props
- **startAddon** (ReactNode) - Optional - Content to display at the start of the input.
- **endAddon** (ReactNode) - Optional - Content to display at the end of the input.
- **variant** (string) - Optional - Visual style variant of the input.
- **isInvalid** (boolean) - Optional - Toggles the error state.
- **errorMessage** (string) - Optional - Message displayed when isInvalid is true.
- **isDisabled** (boolean) - Optional - Disables the input field.
- **isRequired** (boolean) - Optional - Marks the field as required.
- **isReadOnly** (boolean) - Optional - Makes the input content immutable while remaining focusable.
- **fullWidth** (boolean) - Optional - Forces the input to fill the parent container width.
- **labelPlacement** (string) - Optional - Defines the position of the label.
- **labelAlign** (string) - Optional - Defines the alignment of the label.
- **isClearable** (boolean) - Optional - Adds a clear button when a value is present.
- **defaultValue** (string) - Optional - Initial uncontrolled value.
- **value** (string) - Optional - Controlled value of the input.
- **onChange** (function) - Optional - Callback fired when the input value changes.
### Usage Example
```tsx
import { Input } from '@koobiq/react-components';
```
```
--------------------------------
### Import Modal Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Modal/Modal.mdx
Demonstrates how to import the Modal component from the @koobiq/react-components library.
```tsx
import {
Modal
} from '@koobiq/react-components';
```
--------------------------------
### Implement ContentPanel with Container
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/ContenPanel/ContentPanel.mdx
Demonstrates how to wrap content in a ContentPanelContainer and use the render prop to toggle the visibility of a ContentPanel.
```tsx
{({ toggle, isOpen }) => (
<>
{isOpen ? 'Close panel' : 'Open panel'}
...
...
...
>
)}
```
--------------------------------
### Display a Toast with Actions
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/ToastProvider/ToastProvider.mdx
Illustrates how to create a toast that includes interactive actions, such as buttons. This allows users to perform specific operations directly from the notification.
```tsx
```
--------------------------------
### Layout Options
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TimePicker/TimePicker.mdx
Details the `fullWidth` prop for making the input fit its parent width, and discusses `labelPlacement` and `labelAlign` for positioning the label. It also references the Form component for two-column layout options.
```APIDOC
## Full width
The `fullWidth` prop will make an input fit to its parent width.
## Label placement and alignment
Use `labelPlacement` and `labelAlign` props to set the position of the label.
See the [Form](?path=/docs/components-form--docs#visual-options) for a two-column layout with labels on the side and a shared label column.
```
--------------------------------
### Implement Table Component
Source: https://context7.com/koobiq/react-components/llms.txt
Shows how to create static and asynchronous data tables. Features include column sorting, row selection, and integration with the useAsyncList hook for dynamic data fetching.
```tsx
import { Table, TableContainer, useAsyncList } from '@koobiq/react-components';
function TableExample() {
const rows = [
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' },
];
return (
Name
Email
{(item) => (
{item.name}
{item.email}
)}
);
}
```
--------------------------------
### Responsive Grid Values
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Grid/Grid.mdx
Demonstrates how to apply responsive values to Grid props like 'cols', 'gap', and alignment properties, allowing layout adjustments based on screen breakpoints.
```tsx
...
```
--------------------------------
### Manage List State with useListData and useAsyncList
Source: https://context7.com/koobiq/react-components/llms.txt
Demonstrates how to manage static lists with CRUD operations using useListData and handle asynchronous data fetching with pagination using useAsyncList.
```tsx
import { useListData, useAsyncList } from '@koobiq/react-components';
function useListDataExample() {
const list = useListData({
initialItems: [
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },
],
getKey: (item) => item.id,
});
list.append({ id: 3, name: 'Item 3' });
list.remove(1);
list.update(2, { name: 'Updated Item 2' });
return list.items;
}
function useAsyncListExample() {
const list = useAsyncList({
async load({ signal, cursor }) {
const response = await fetch(cursor || '/api/items?page=1', { signal });
const data = await response.json();
return { items: data.items, cursor: data.nextPage };
},
});
return {
items: list.items,
isLoading: list.loadingState === 'loading',
loadMore: list.loadMore,
reload: list.reload,
};
}
```
--------------------------------
### Importing Backdrop Component in Storybook
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Backdrop/Backdrop.mdx
This snippet demonstrates how to import the necessary Storybook components and the Backdrop stories into a documentation file. It uses the Meta component to associate the documentation with the corresponding story file.
```javascript
import { Props, Story, Meta, Status } from '../../../../../.storybook/components';
import * as Stories from './Backdrop.stories';
```
--------------------------------
### Import Button Component
Source: https://github.com/koobiq/react-components/blob/main/packages/primitives/src/components/Button/Button.mdx
Demonstrates how to import the Button component from the @koobiq/react-primitives library.
```tsx
import {
Meta,
Story,
Props,
Status,
} from '../../../../../.storybook/components';
import * as Stories from './Button.stories';
# Button
import { Button } from '@koobiq/react-primitives';
```
--------------------------------
### Import Fonts in Entry Point
Source: https://github.com/koobiq/react-components/blob/main/docs/5-fonts.mdx
Import the specific font weight and style CSS files into your application's main entry point. This ensures the necessary font assets are bundled and loaded.
```javascript
// Inter
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';
import '@fontsource/inter/400-italic.css';
import '@fontsource/inter/500-italic.css';
// JetBrains Mono
import '@fontsource/jetbrains-mono/400.css';
import '@fontsource/jetbrains-mono/700.css';
```
--------------------------------
### SkeletonBlock Implementation
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/SkeletonBlock/SkeletonBlock.mdx
Demonstrates the basic usage of the SkeletonBlock component. It is typically used as a wrapper or a standalone placeholder to indicate loading states.
```jsx
```
--------------------------------
### Import DatePicker Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/DatePicker/DatePicker.mdx
Demonstrates how to import the DatePicker component from the @koobiq/react-components library.
```tsx
import {
DatePicker
} from '@koobiq/react-components';
```
--------------------------------
### Importing IconButton Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/IconButton/IconButton.mdx
Demonstrates how to import the IconButton component from the @koobiq/react-components library into a React project.
```tsx
import { IconButton } from '@koobiq/react-components';
```
--------------------------------
### Layout Components
Source: https://context7.com/koobiq/react-components/llms.txt
FlexBox and Grid components for building responsive layouts using CSS flexbox and grid.
```APIDOC
## Layout Components
### Description
FlexBox and Grid components for building responsive layouts using CSS flexbox and grid.
### FlexBox
#### Props
- `direction` ('row' | 'column' | 'row-reverse' | 'column-reverse') - Sets the direction of flex items.
- `alignItems` ('flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch') - Aligns items along the cross axis.
- `justifyContent` ('flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly') - Aligns items along the main axis.
- `gap` (number | string) - Sets the space between flex items.
- `wrap` ('nowrap' | 'wrap' | 'wrap-reverse') - Controls whether flex items wrap.
### Grid
#### Props
- `columns` (number | string | object) - Defines the number of columns or responsive column definitions.
- `gap` (number | string) - Sets the space between grid items.
### Grid.Item
#### Props
- `span` (number | string | object) - Defines how many columns the item spans, can be responsive.
### Container
#### Props
- `placement` ('center' | 'start' | 'end') - Aligns the container content.
- `maxWidth` (string) - Sets the maximum width of the container (e.g., 'sm', 'md', 'lg').
### Example
```tsx
import { FlexBox, Grid, Container } from '@koobiq/react-components';
function LayoutExample() {
return (
{/* FlexBox for flexible layouts */}
Item 1
Item 2
Item 3
{/* Grid for structured layouts */}
Column 1
Column 2
Column 3
Responsive
);
}
```
```
--------------------------------
### Import List Component (TypeScript)
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/List/List.mdx
Demonstrates how to import the List component from the '@koobiq/react-components' library.
```tsx
import {
List
} from '@koobiq/react-components';
```
--------------------------------
### Import and Use React Icons
Source: https://github.com/koobiq/react-components/blob/main/packages/icons/README.md
Demonstrates how to import a specific icon component from the library and render it within a React functional component with custom color properties.
```tsx
import { IconCheck16 } from '@koobiq/react-icons';
const Icon = () => ;
```
--------------------------------
### Implement Modal Component
Source: https://context7.com/koobiq/react-components/llms.txt
Demonstrates how to use the Modal component with state control and custom trigger elements. It supports header, body, and footer sections with configurable sizing and exit behaviors.
```tsx
import { Modal, Button } from '@koobiq/react-components';
function ModalExample() {
const [isOpen, setIsOpen] = useState(false);
return (
<>
setIsOpen(true)}>Open Modal
{({ close }) => (
<>
Confirm Action
Are you sure you want to proceed with this action?
Cancel
Delete
>
)}
>
);
}
```
--------------------------------
### TagGroup as Links
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/TagGroup/TagGroup.mdx
Demonstrates how to make tags act as links using the `href` prop.
```APIDOC
## Links
Tags may be links to another page or website. This can be achieved by passing the `href` prop to the `Tag` component.
### Example with Links
```jsx
```
```
--------------------------------
### List Component
Source: https://context7.com/koobiq/react-components/llms.txt
Provides selectable lists with keyboard navigation, sections, and async loading support.
```APIDOC
## List Component
### Description
Provides selectable lists with keyboard navigation, sections, and async loading support.
### Usage
Import `List` from `@koobiq/react-components`. Use `List.Section` for grouping items and `List.Item` for individual entries. `List.ItemText` can be used to display primary and secondary text. Supports `selectionMode`, `onSelectionChange`, `isLoading`, `onLoadMore`, and `noItemsText` props.
### Props
- `aria-label` (string) - Accessibility label for the list.
- `selectionMode` ('single' | 'multiple' | 'none') - Defines how items can be selected.
- `onSelectionChange` (function) - Callback when selection changes.
- `isLoading` (boolean) - Indicates if data is being loaded.
- `onLoadMore` (function) - Callback to load more items.
- `noItemsText` (string) - Text to display when no items are available.
### Example
```tsx
import { List } from '@koobiq/react-components';
function ListExample() {
return (
console.log('Selected:', keys)}
isLoading={isLoading}
onLoadMore={loadMore}
noItemsText="No items found"
>
Archive.zip
);
}
```
```
--------------------------------
### Flex Component Overview
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/layout/flex/flex.mdx
This section provides an overview of the Flex component, its basic usage, and its core functionality as a flex container utility.
```APIDOC
## Flex Component
### Description
The `flex` mixin turns the element it's applied to into a flex container, enabling flexible box layout.
### Usage
Import the `flex` utility from `@koobiq/react-components` and apply it to your elements.
```tsx
import { flex } from '@koobiq/react-components';
```
### Props
The Flex component accepts various props to configure its behavior and appearance. Refer to the `Props` documentation for a detailed list of available properties.
#### Example Usage
```tsx
// Assuming 'Stories.Example' and 'Stories.Base' are defined in './flex.stories'
//
//
```
```
--------------------------------
### Importing the Badge Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Badge/Badge.mdx
Shows how to import the Badge component from the @koobiq/react-components package for use in a React application.
```tsx
import { Badge } from '@koobiq/react-components';
```
--------------------------------
### Implementing SidePanel with Subcomponents and Close Action
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/SidePanel/SidePanel.mdx
Shows how to structure the SidePanel content using Header, Body, and Footer subcomponents, and how to utilize the close function provided by the render prop.
```tsx
import { Button, SidePanel } from '@koobiq/react-components';
Open }>
{({ close }) => (
<>
Title
Content
Close
>
)}
;
```
--------------------------------
### Import Provider Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Provider/Provider.mdx
Demonstrates how to import the Provider component from the '@koobiq/react-components' library for use in a React application.
```tsx
import {
Provider
} from '@koobiq/react-components';
```
--------------------------------
### Import InputNumber Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/InputNumber/InputNumber.mdx
Demonstrates how to import the InputNumber component from the '@koobiq/react-components' library for use in a React application.
```tsx
import { InputNumber } from '@koobiq/react-components';
```
--------------------------------
### Importing the Calendar Component
Source: https://github.com/koobiq/react-components/blob/main/packages/components/src/components/Calendar/Calendar.mdx
Demonstrates the standard import statement required to use the Calendar component from the @koobiq/react-components library.
```tsx
import { Calendar } from '@koobiq/react-components';
```