===============
LIBRARY RULES
===============
From library maintainers:
- Use Svelte 5 runes ($props, $state, $derived, $effect) for reactivity
- Import enums from '@requify/requify-design-system' for type-safe variants and sizes
- Always use TypeScript strict mode with comprehensive type definitions
- Follow existing component patterns for consistency
- Use CSS custom properties for theming, never hardcode colors
- Ensure all interactive elements are keyboard accessible
- Provide proper ARIA attributes for screen readers
- Use snippets for flexible content composition
- Test components in both light and dark modes
- Wrap bits-ui primitives with custom styling and theming
- Follow WCAG AA/AAA accessibility guidelines
- Use cn() utility for merging Tailwind classes
- Bind values with $bindable() for two-way data flow
### DropdownDivider Installation and Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Shows the Svelte installation for DropdownDivider and an example demonstrating its use as a visual separator between dropdown items.
```svelte
Action 1Action 2
```
--------------------------------
### DropdownLink Installation and Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Explains the Svelte installation for DropdownLink and shows an example of creating clickable links within a dropdown menu.
```svelte
SettingsProfile
```
--------------------------------
### DropdownItem Installation and Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Provides the Svelte installation code for DropdownItem and an example of its usage with click handlers and custom classes.
```svelte
EditDelete
```
--------------------------------
### DropdownHeader Installation and Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Details the Svelte installation for DropdownHeader and provides an example of its usage to group related dropdown items under a section title.
```svelte
ActionsEditDelete
```
--------------------------------
### Dropdown: Installation Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Shows the necessary import statements for using the Dropdown component and its related sub-components (DropdownItem, DropdownDivider, DropdownHeader, DropdownLink) from the 'requify-design-system' library in Svelte.
```svelte
```
--------------------------------
### Setup Tailwind CSS and Typography Plugin
Source: https://github.com/requify-app/requify-design-system/blob/main/README.md
Installs Tailwind CSS and the @tailwindcss/typography plugin, essential for styling and component rendering. This step is crucial for the design system's functionality.
```bash
npm install -D tailwindcss @tailwindcss/typography
```
--------------------------------
### Implement Keyboard Accessibility with Shortcuts (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
Shows how to ensure keyboard accessibility by adding keyboard shortcuts. This example uses Svelte's `onMount` lifecycle function to add a global keydown event listener that triggers a modal when '⌘K' or 'Ctrl+K' is pressed.
```svelte
Press ⌘K to open
```
--------------------------------
### Create Responsive Design with Size Variants (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
Demonstrates how to implement responsive design by using different size variants for components based on screen size. This example applies different sizes to a button using Tailwind CSS utility classes that target specific breakpoints (md, lg).
```svelte
```
--------------------------------
### Input Component Basic Usage and Sizing Examples
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
Demonstrates the basic usage of the Input component and how to apply different size variants (XS, SM, MD, LG, XL). These examples require no external dependencies beyond the Input component itself.
```svelte
```
```svelte
```
--------------------------------
### Requify Design System Development Commands
Source: https://github.com/requify-app/requify-design-system/blob/main/README.md
Provides essential commands for developing with the Requify Design System, including installing dependencies, starting the development server, building for production, type checking, and formatting code.
```bash
# Install dependencies
bun install
# Start development server
bun run dev
# Build for production
bun run build
# Type check
bun run check
# Format code
bun run format
```
--------------------------------
### Accordion Component Basic Setup (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Illustrates the fundamental setup for using the Accordion component in Svelte. It shows how to import and use `Accordion` and `AccordionItem` components, demonstrating a collapsible content panel structure.
```svelte
```
--------------------------------
### Popover Installation
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Illustrates the basic import statement required to use the Popover component within a Svelte application. This setup is necessary before utilizing the Popover's functionality.
```svelte
```
--------------------------------
### Svelte Theme Switching Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
A Svelte component demonstrating how to dynamically switch between themes ('light', 'dark', 'brand') by updating a state variable and setting a data attribute on the document's root element.
```svelte
```
--------------------------------
### TableHead Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
A basic Svelte example demonstrating the usage of the TableHead component with TableHeadCell children.
```svelte
NameEmail
```
--------------------------------
### Example Svelte Component Using Requify Components
Source: https://github.com/requify-app/requify-design-system/blob/main/README.md
Shows a practical example of using Requify Design System components like Card, Label, Input, and Button within a Svelte component. It demonstrates binding input values and setting component variants and sizes.
```svelte
Example Card
This is a sample card component.
```
--------------------------------
### Install Table Component - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Demonstrates how to import and use the Table component and its related sub-components from the 'requify-design-system' package in a Svelte application. This is the initial setup for utilizing the table component.
```svelte
```
--------------------------------
### SidebarItem Installation - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Shows how to install and import the `SidebarItem` component from the 'requify-design-system' package.
```svelte
```
--------------------------------
### StepIndicator Basic Installation
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Shows how to import and install the StepIndicator component from the requify-design-system package for use in multi-step workflows.
```svelte
```
--------------------------------
### Install Requify Search Component
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/forms.md
Demonstrates how to import and use the Search component from the 'requify-design-system' package in a Svelte application. This is the initial setup required before utilizing the component's features.
```svelte
```
--------------------------------
### Basic Table Example - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Provides a fundamental example of the Table component in Svelte, showcasing how to structure table headers and body with data. This illustrates the basic rendering of tabular data.
```svelte
```
--------------------------------
### TableHeadCell Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
A basic Svelte example demonstrating the usage of the TableHeadCell component for table headers.
```svelte
Name
```
--------------------------------
### Implement Navigation with Sidebar, SidebarGroup, SidebarItem, SidebarDropdown Svelte Components
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
This Svelte component example showcases the implementation of a sidebar navigation menu using components from '@requify/requify-design-system'. It demonstrates structuring navigation into groups, individual items with icons, and dropdown menus for hierarchical organization.
```svelte
{#snippet icon()}
{/snippet}
Dashboard
{#snippet icon()}
{/snippet}
Analytics
{#snippet icon()}
{/snippet}
Settings
{#snippet icon()}
{/snippet}
Website
{#snippet icon()}
{/snippet}
Mobile App
DocumentationSupportHelp Center
```
--------------------------------
### Sidebar Installation - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Demonstrates how to install and import the Sidebar component and its related sub-components from the 'requify-design-system' package.
```svelte
```
--------------------------------
### Listgroup Component Examples (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Illustrates how to use the Listgroup and ListgroupItem components in Svelte for organizing lists of content. Examples cover basic list creation, applying custom styling, incorporating icons, and showing an active list item state.
```svelte
select('item1')}>Item 1 select('item2')}>Item 2 select('item3')}>Item 3
```
```svelte
Item 1Item 2
```
```svelte
Profile
Settings
```
```svelte
Active ItemOther Item
```
--------------------------------
### Product Card Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
An example of a Card component used to display product information, including an image, name, and price. It utilizes the `hoverable` prop for an interactive effect.
```svelte
Product Name
$99.99
```
--------------------------------
### Install Requify Design System Package
Source: https://github.com/requify-app/requify-design-system/blob/main/README.md
Installs the Requify Design System package using npm, yarn, or bun. This is the first step to integrating the design system into your project.
```bash
npm install @requify/requify-design-system
# or
yarn add @requify/requify-design-system
# or
bun add @requify/requify-design-system
```
--------------------------------
### Blockquote Component Examples (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/typography.md
Demonstrates the Blockquote component for displaying quoted text. Includes examples of a basic blockquote and a blockquote with a citation, showcasing proper semantic markup and styling for testimonials or highlighted text.
```svelte
```
```svelte
This is a quoted text block for testimonials or citations.
```
```svelte
"Design is not just what it looks like and feels like. Design is how it works."
— Steve Jobs
```
--------------------------------
### ListgroupItem Installation and Basic Usage
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Provides instructions for installing the ListgroupItem component from the requify-design-system package and demonstrates its basic usage with a click handler.
```svelte
Item
```
--------------------------------
### TableBodyRow Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
A Svelte example demonstrating the TableBodyRow component with an 'onclick' handler and TableBodyCell children.
```svelte
Data
```
--------------------------------
### Button Installation - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
Demonstrates how to import the Button component and its associated types from the 'requify-design-system' package.
```svelte
```
--------------------------------
### TabsList Component Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Demonstrates the basic usage of the TabsList component within a Tabs structure.
```svelte
Tab 1Tab 2Content
```
--------------------------------
### TabsContent Component Installation and Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
The TabsContent component displays the content for a specific tab. It needs to be imported and used with a 'value' prop that matches the corresponding TabsTrigger. The 'children' prop holds the content to be displayed when the tab is active. Additional CSS classes can be applied using the 'class' prop.
```svelte
Profile Settings
Configure your profile preferences
```
--------------------------------
### Progressbar Installation (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Instructions for installing the Progressbar component in a Svelte project. It requires importing 'Progressbar', 'ProgressbarVariant', and 'ComponentSize' from 'requify-design-system'.
```svelte
```
--------------------------------
### Install Select Component - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/forms.md
Demonstrates how to import and install the Select component from the 'requify-design-system' library in a Svelte project. This is the initial step before using the component in your application.
```svelte
```
--------------------------------
### StepIndicator Basic 3-Step Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
A fundamental example of the StepIndicator component, displaying a basic 3-step process with labels and setting the current step.
```svelte
```
--------------------------------
### CloseButton Basic Usage and Integration Examples (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
Provides examples of using the CloseButton component. This includes basic integration with an `onclick` handler, use within a Modal header, and custom positioning using absolute CSS.
```svelte
```
```svelte
```
```svelte
Content
```
```svelte
This is an alert with a close button
```
--------------------------------
### TableBody Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
A Svelte example showcasing the TableBody component containing TableBodyRow and TableBodyCell components.
```svelte
JohnDoe
```
--------------------------------
### AccordionItem: Basic Usage Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Provides a simple example of how to use the AccordionItem component. It requires a 'value' and 'title' prop, and its content is placed between the opening and closing tags.
```svelte
Answer goes here
```
--------------------------------
### Warning Message Alert Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Presents an example of the Alert component used for warning messages, employing the 'warning' variant to alert users of potential issues.
```svelte
Your session will expire in 5 minutes
```
--------------------------------
### Success Message Alert Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Provides a specific example of using the Alert component for success messages. It utilizes the 'success' variant for clear visual feedback.
```svelte
Profile updated successfully!
```
--------------------------------
### TabsList Component Installation
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Shows how to import the TabsList component from the requify-design-system.
```svelte
```
--------------------------------
### Tooltip with All Sides Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Provides examples of the Tooltip component placed on all four sides ('top', 'right', 'bottom', 'left') relative to the trigger button. This showcases the versatility of the 'side' prop.
```svelte
```
--------------------------------
### Accordion: Rich Content Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Demonstrates using the Accordion component with complex content inside its panels. This example shows the inclusion of form elements like Input, Switch, and Select within an AccordionItem.
```svelte
Dark mode
```
--------------------------------
### Form Helper Component Examples
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/other.md
Demonstrates the usage of the Helper component specifically within form contexts. Examples include basic form helpers, validation feedback, format hints, character counts, and multiple helpers. It's designed to work with other form components like Label, Input, and Textarea.
```svelte
Enter your work email addressPassword must be at least 8 charactersFormat: (555) 123-4567{message.length}/500 characters
Enter your full nameThis will be visible on your profile
```
--------------------------------
### Breadcrumb Component Installation and Examples (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
The Breadcrumb component provides a hierarchical navigation trail. It accepts BreadcrumbItem components as children and can be styled with additional CSS classes. Examples demonstrate basic usage, integration with icons, placement within page headers, and dynamic generation.
```svelte
HomeProductsLaptopsMacBook Pro
```
```svelte
Settings
```
```svelte
MacBook Pro
HomeProductsMacBook Pro
```
```svelte
{#each breadcrumbs as crumb, i}
{#if i < breadcrumbs.length - 1}
{crumb.label}
{:else}
{crumb.label}
{/if}
{/each}
```
--------------------------------
### Basic Spinner Usage
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
A simple example of rendering the Spinner component with its default settings.
```svelte
```
--------------------------------
### DateRangePicker Component Installation (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/forms.md
Illustrates how to import the DateRangePicker component from 'requify-design-system' in Svelte. This component is used for selecting a start and end date for a range.
```svelte
```
--------------------------------
### Toast Component Installation (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Imports the Toast component and its variant enum from the 'requify-design-system' library. This setup is necessary for displaying toast notifications in Svelte applications.
```svelte
```
--------------------------------
### Tabs Component Installation
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Shows how to import the necessary components for the Tabs interface from the requify-design-system.
```svelte
```
--------------------------------
### Spinner Installation
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
Basic Svelte script to import and use the Spinner component from the requify-design-system library.
```svelte
```
--------------------------------
### Install Textarea Component (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
Shows how to import the Textarea component from the 'requify-design-system' package into a Svelte application.
```svelte
```
--------------------------------
### Svelte Onboarding Flow with Step Indicator
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Demonstrates a multi-step onboarding process using Svelte. It manages the current step and provides navigation controls. Dependencies include StepIndicator, Card, and Input components.
```svelte
{#if currentStep === 1}
Create Account
{:else if currentStep === 2}
Profile Setup
{/if}
```
--------------------------------
### Basic Tooltip Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Demonstrates the basic usage of the Tooltip component by wrapping a Button with a simple content string. This is the most straightforward way to add a tooltip.
```svelte
```
--------------------------------
### DateRangePicker Basic Usage (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/forms.md
A fundamental example of the DateRangePicker component in Svelte, using `bind:start` and `bind:end` to manage the selected date range. This is suitable for simple booking or filtering scenarios.
```svelte
```
--------------------------------
### Drawer Usage Examples in Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Demonstrates various ways to use the Drawer component, including different placements (left, right, bottom, top), backdrop visibility control, custom transitions, and integrating complex content.
```svelte
Settings
ProfileAccount
```
```svelte
Right drawer content
```
```svelte
Select Option
```
```svelte
Drawer without backdrop
```
```svelte
Slow fade drawer
```
```svelte
Top Notification
Important message
```
```svelte
Filters
Refine your search
```
--------------------------------
### Input Component Installation
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/foundation.md
Shows how to import the Input component and related types like `ComponentSize` from the 'requify-design-system' library. The Input component is designed for single-line text entry.
```svelte
```
--------------------------------
### Group Buttons with ButtonGroup Svelte Component
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
This Svelte component example shows how to group related buttons using the ButtonGroup component. It imports Button and ButtonGroup from '@requify/requify-design-system' and demonstrates the usage of ButtonVariant for styling.
```svelte
```
--------------------------------
### Multiple Indicators Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Demonstrates the usage of multiple indicators with different icons, variants, and sizes. This shows how to combine `Button`, `Indicator`, `Bell`, and `Mail` components for distinct notifications. Assumes `Button`, `Indicator`, `Bell`, and `Mail` components are available.
```svelte
```
--------------------------------
### Basic Popover Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Demonstrates the fundamental usage of the Popover component. It requires a trigger element (a Button in this case) and content to display when the popover is open.
```svelte
{#snippet trigger()}
{/snippet}
Popover Title
Popover content
```
--------------------------------
### Svelte Dark Mode Toggle Example
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
A Svelte component that provides a manual toggle for dark mode. It manages a boolean state for dark mode, updates the `dark` class on the `documentElement`, and checks the system preference on component mount.
```svelte
```
--------------------------------
### Migrate from Tailwind Classes to Requify Button (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
Provides a migration example showing how to replace custom Tailwind CSS classes for a button with the equivalent Requify Design System `Button` component. This simplifies styling and ensures consistency with the design system.
```svelte
```
--------------------------------
### Using Snippets for Icons in Buttons (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
Demonstrates how to leverage Svelte's snippet feature to embed icons within buttons, enhancing their visual appeal and functionality. This example shows the integration of Lucide Svelte icons with Requify's Button component for search and save actions.
```svelte
```
--------------------------------
### Basic Alert Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/feedback.md
Demonstrates the basic usage of the Alert component in Svelte. It displays a simple informational alert with content provided as children.
```svelte
This is an informational alert
```
--------------------------------
### Create Modals with Forms using Modal, Input, Label, Button Svelte Components
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
This Svelte component example demonstrates how to create a modal dialog with form elements using components from '@requify/requify-design-system'. It includes a title input, a description textarea, and action buttons for cancellation and creation, all managed within a Modal component.
```svelte
{#snippet footer()}
{/snippet}
```
--------------------------------
### Paragraph Component Examples (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/typography.md
Demonstrates the usage of the Paragraph component (P) in Svelte, illustrating different text sizes ('xs' to 'xl') and font weights ('normal' to 'bold'). It covers basic usage and various stylistic options.
```svelte
This is a standard paragraph with base size and weight.
```
```svelte
This is extra small text for captions.
This is smaller text for secondary content.
This is base text for paragraphs.
This is larger text for emphasis.
This is extra large text for important content.
```
```svelte
This is bold text for emphasis.
```
```svelte
Normal weight
Medium weight
Semibold weight
Bold weight
```
--------------------------------
### Build Forms with Card, Input, Label, Button, Helper Svelte Components
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/usage-guides.md
This Svelte component example illustrates building a complex form structure using various components from '@requify/requify-design-system'. It includes input fields for name, email, and password, along with labels, helper text, and action buttons, all within a Card component.
```svelte
```
--------------------------------
### Progressbar Component Examples (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Demonstrates various ways to use the Progressbar component in Svelte, including basic usage, color variants, size options, label positioning, custom sizing, and dynamic progress updates for scenarios like uploads and form completion. It also mentions accessibility best practices.
```svelte
```
```svelte
```
```svelte
```
```svelte
```
```svelte
```
```svelte
```
```svelte
```
```svelte
{uploadProgress}% complete
```
```svelte
{completedFields} of {totalFields} fields completed
```
--------------------------------
### SidebarDropdown Installation - Svelte
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/navigation.md
Demonstrates the installation and import of the `SidebarDropdown` component from the 'requify-design-system' package.
```svelte
```
--------------------------------
### Table with Pagination Example (Svelte)
Source: https://github.com/requify-app/requify-design-system/blob/main/src/docs/components/data-display.md
Shows a Svelte Table integrated with a Card and Pagination component. It requires 'Pagination', 'Card', and 'Table' components from 'requify-design-system'. The 'pages', 'goToPrevious', and 'goToNext' variables need to be defined in the script.
```svelte