saha-ui 1.15.0 → 1.17.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/README.md +982 -75
- package/bin/cli.js +1 -1
- package/bin/mcp.js +33 -0
- package/dist/components/Affix/Affix.styles.d.ts +11 -0
- package/dist/components/Affix/Affix.styles.d.ts.map +1 -0
- package/dist/components/Affix/Affix.styles.js +52 -0
- package/dist/components/Affix/Affix.types.d.ts +93 -0
- package/dist/components/Affix/Affix.types.d.ts.map +1 -0
- package/dist/components/Affix/index.d.ts +48 -0
- package/dist/components/Affix/index.d.ts.map +1 -0
- package/dist/components/Affix/index.js +134 -0
- package/dist/components/AppBar/AppBar.styles.d.ts +17 -0
- package/dist/components/AppBar/AppBar.styles.d.ts.map +1 -0
- package/dist/components/AppBar/AppBar.styles.js +135 -0
- package/dist/components/AppBar/AppBar.types.d.ts +125 -0
- package/dist/components/AppBar/AppBar.types.d.ts.map +1 -0
- package/dist/components/AppBar/index.d.ts +57 -0
- package/dist/components/AppBar/index.d.ts.map +1 -0
- package/dist/components/AppBar/index.js +77 -0
- package/dist/components/Autocomplete/Autocomplete.styles.d.ts +2 -2
- package/dist/components/Backdrop/Backdrop.styles.d.ts +10 -0
- package/dist/components/Backdrop/Backdrop.styles.d.ts.map +1 -0
- package/dist/components/Backdrop/Backdrop.styles.js +100 -0
- package/dist/components/Backdrop/Backdrop.types.d.ts +111 -0
- package/dist/components/Backdrop/Backdrop.types.d.ts.map +1 -0
- package/dist/components/Backdrop/index.d.ts +54 -0
- package/dist/components/Backdrop/index.d.ts.map +1 -0
- package/dist/components/Backdrop/index.js +76 -0
- package/dist/components/Badge/Badge.types.d.ts +106 -0
- package/dist/components/Badge/Badge.types.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +8 -0
- package/dist/components/Badge/index.d.ts.map +1 -1
- package/dist/components/Badge/index.js +49 -39
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.ts +30 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.d.ts.map +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.styles.js +179 -0
- package/dist/components/BottomNavigation/BottomNavigation.types.d.ts +179 -0
- package/dist/components/BottomNavigation/BottomNavigation.types.d.ts.map +1 -0
- package/dist/components/BottomNavigation/index.d.ts +76 -0
- package/dist/components/BottomNavigation/index.d.ts.map +1 -0
- package/dist/components/BottomNavigation/index.js +172 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +266 -1
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts.map +1 -1
- package/dist/components/Button/Button.types.d.ts +115 -0
- package/dist/components/Button/Button.types.d.ts.map +1 -1
- package/dist/components/Button/index.d.ts +28 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +50 -36
- package/dist/components/Chart/charts/ComposedChartComponent.d.ts.map +1 -1
- package/dist/components/Chart/charts/ComposedChartComponent.js +62 -59
- package/dist/components/Checkbox/Checkbox.types.d.ts +94 -1
- package/dist/components/Checkbox/Checkbox.types.d.ts.map +1 -1
- package/dist/components/Collapsible/index.d.ts +2 -4
- package/dist/components/Collapsible/index.d.ts.map +1 -1
- package/dist/components/Collapsible/index.js +148 -193
- package/dist/components/ColorPicker/ColorPicker.styles.d.ts +34 -0
- package/dist/components/ColorPicker/ColorPicker.styles.d.ts.map +1 -0
- package/dist/components/ColorPicker/ColorPicker.styles.js +187 -0
- package/dist/components/ColorPicker/ColorPicker.types.d.ts +167 -0
- package/dist/components/ColorPicker/ColorPicker.types.d.ts.map +1 -0
- package/dist/components/ColorPicker/index.d.ts +40 -0
- package/dist/components/ColorPicker/index.d.ts.map +1 -0
- package/dist/components/ColorPicker/index.js +183 -0
- package/dist/components/Command/Command.d.ts.map +1 -1
- package/dist/components/Command/Command.js +112 -111
- package/dist/components/Container/Container.d.ts +46 -0
- package/dist/components/Container/Container.d.ts.map +1 -1
- package/dist/components/Container/Container.js +31 -23
- package/dist/components/Container/Container.types.d.ts +170 -7
- package/dist/components/Container/Container.types.d.ts.map +1 -1
- package/dist/components/ContextMenu/index.d.ts +0 -2
- package/dist/components/ContextMenu/index.d.ts.map +1 -1
- package/dist/components/ContextMenu/index.js +58 -67
- package/dist/components/DatePicker/DatePicker.styles.d.ts +2 -2
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +266 -240
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +233 -219
- package/dist/components/Field/Field.styles.d.ts +2 -2
- package/dist/components/FloatingActionButton/FloatingActionButton.styles.d.ts +1 -1
- package/dist/components/Form/index.js +2 -3
- package/dist/components/Grid/Grid.d.ts +85 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -1
- package/dist/components/Grid/Grid.js +80 -58
- package/dist/components/Grid/Grid.types.d.ts +269 -24
- package/dist/components/Grid/Grid.types.d.ts.map +1 -1
- package/dist/components/IconButton/IconButton.styles.d.ts +11 -0
- package/dist/components/IconButton/IconButton.styles.d.ts.map +1 -0
- package/dist/components/IconButton/IconButton.styles.js +283 -0
- package/dist/components/IconButton/IconButton.types.d.ts +113 -0
- package/dist/components/IconButton/IconButton.types.d.ts.map +1 -0
- package/dist/components/IconButton/index.d.ts +55 -0
- package/dist/components/IconButton/index.d.ts.map +1 -0
- package/dist/components/IconButton/index.js +60 -0
- package/dist/components/Input/Input.types.d.ts +165 -3
- package/dist/components/Input/Input.types.d.ts.map +1 -1
- package/dist/components/Input/index.d.ts +8 -0
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js +104 -82
- package/dist/components/Item/Item.styles.d.ts +1 -1
- package/dist/components/Link/Link.types.d.ts +273 -11
- package/dist/components/Link/Link.types.d.ts.map +1 -1
- package/dist/components/Link/index.d.ts +20 -11
- package/dist/components/Link/index.d.ts.map +1 -1
- package/dist/components/Link/index.js +61 -35
- package/dist/components/Masonry/Masonry.styles.d.ts +56 -0
- package/dist/components/Masonry/Masonry.styles.d.ts.map +1 -0
- package/dist/components/Masonry/Masonry.styles.js +126 -0
- package/dist/components/Masonry/Masonry.types.d.ts +124 -0
- package/dist/components/Masonry/Masonry.types.d.ts.map +1 -0
- package/dist/components/Masonry/index.d.ts +68 -0
- package/dist/components/Masonry/index.d.ts.map +1 -0
- package/dist/components/Masonry/index.js +156 -0
- package/dist/components/Menubar/index.d.ts.map +1 -1
- package/dist/components/Menubar/index.js +96 -88
- package/dist/components/NavigationMenu/NavigationMenu.styles.d.ts +2 -2
- package/dist/components/NavigationMenu/NavigationMenu.types.d.ts +206 -0
- package/dist/components/NavigationMenu/NavigationMenu.types.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.styles.d.ts +2 -2
- package/dist/components/Pagination/Pagination.styles.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.styles.js +56 -3
- package/dist/components/Pagination/Pagination.types.d.ts +251 -33
- package/dist/components/Pagination/Pagination.types.d.ts.map +1 -1
- package/dist/components/Pagination/index.d.ts +27 -7
- package/dist/components/Pagination/index.d.ts.map +1 -1
- package/dist/components/Pagination/index.js +93 -88
- package/dist/components/Paper/Paper.styles.d.ts +10 -0
- package/dist/components/Paper/Paper.styles.d.ts.map +1 -0
- package/dist/components/Paper/Paper.styles.js +178 -0
- package/dist/components/Paper/Paper.types.d.ts +100 -0
- package/dist/components/Paper/Paper.types.d.ts.map +1 -0
- package/dist/components/Paper/index.d.ts +72 -0
- package/dist/components/Paper/index.d.ts.map +1 -0
- package/dist/components/Paper/index.js +44 -0
- package/dist/components/Radio/index.d.ts.map +1 -1
- package/dist/components/Radio/index.js +11 -11
- package/dist/components/Rating/index.d.ts +0 -2
- package/dist/components/Rating/index.d.ts.map +1 -1
- package/dist/components/Rating/index.js +3 -3
- package/dist/components/Result/Result.styles.d.ts +24 -0
- package/dist/components/Result/Result.styles.d.ts.map +1 -0
- package/dist/components/Result/Result.styles.js +135 -0
- package/dist/components/Result/Result.types.d.ts +27 -0
- package/dist/components/Result/Result.types.d.ts.map +1 -0
- package/dist/components/Result/index.d.ts +5 -0
- package/dist/components/Result/index.d.ts.map +1 -0
- package/dist/components/Result/index.js +119 -0
- package/dist/components/ScrollArea/index.d.ts +1 -3
- package/dist/components/ScrollArea/index.d.ts.map +1 -1
- package/dist/components/Section/Section.d.ts +55 -0
- package/dist/components/Section/Section.d.ts.map +1 -1
- package/dist/components/Section/Section.js +42 -34
- package/dist/components/Section/Section.types.d.ts +198 -11
- package/dist/components/Section/Section.types.d.ts.map +1 -1
- package/dist/components/Segmented/Segmented.styles.d.ts +19 -0
- package/dist/components/Segmented/Segmented.styles.d.ts.map +1 -0
- package/dist/components/Segmented/Segmented.styles.js +114 -0
- package/dist/components/Segmented/Segmented.types.d.ts +139 -0
- package/dist/components/Segmented/Segmented.types.d.ts.map +1 -0
- package/dist/components/Segmented/index.d.ts +56 -0
- package/dist/components/Segmented/index.d.ts.map +1 -0
- package/dist/components/Segmented/index.js +138 -0
- package/dist/components/Snackbar/Snackbar.styles.d.ts +19 -0
- package/dist/components/Snackbar/Snackbar.styles.d.ts.map +1 -0
- package/dist/components/Snackbar/Snackbar.styles.js +208 -0
- package/dist/components/Snackbar/Snackbar.types.d.ts +178 -0
- package/dist/components/Snackbar/Snackbar.types.d.ts.map +1 -0
- package/dist/components/Snackbar/index.d.ts +36 -0
- package/dist/components/Snackbar/index.d.ts.map +1 -0
- package/dist/components/Snackbar/index.js +137 -0
- package/dist/components/Sonner/Sonner.styles.d.ts +1 -1
- package/dist/components/Sonner/hooks.d.ts +9 -0
- package/dist/components/Sonner/hooks.d.ts.map +1 -0
- package/dist/components/Sonner/hooks.js +14 -0
- package/dist/components/Sonner/index.d.ts +2 -2
- package/dist/components/Sonner/index.d.ts.map +1 -1
- package/dist/components/Sonner/index.js +85 -92
- package/dist/components/SpeedDial/SpeedDial.styles.d.ts +23 -0
- package/dist/components/SpeedDial/SpeedDial.styles.d.ts.map +1 -0
- package/dist/components/SpeedDial/SpeedDial.styles.js +125 -0
- package/dist/components/SpeedDial/SpeedDial.types.d.ts +180 -0
- package/dist/components/SpeedDial/SpeedDial.types.d.ts.map +1 -0
- package/dist/components/SpeedDial/index.d.ts +65 -0
- package/dist/components/SpeedDial/index.d.ts.map +1 -0
- package/dist/components/SpeedDial/index.js +175 -0
- package/dist/components/Stack/Stack.d.ts +25 -0
- package/dist/components/Stack/Stack.d.ts.map +1 -1
- package/dist/components/Stack/Stack.js +49 -36
- package/dist/components/Stack/Stack.types.d.ts +224 -12
- package/dist/components/Stack/Stack.types.d.ts.map +1 -1
- package/dist/components/StatCard/StatCard.styles.d.ts +34 -0
- package/dist/components/StatCard/StatCard.styles.d.ts.map +1 -0
- package/dist/components/StatCard/StatCard.styles.js +365 -0
- package/dist/components/StatCard/StatCard.types.d.ts +178 -0
- package/dist/components/StatCard/StatCard.types.d.ts.map +1 -0
- package/dist/components/StatCard/index.d.ts +65 -0
- package/dist/components/StatCard/index.d.ts.map +1 -0
- package/dist/components/StatCard/index.js +188 -0
- package/dist/components/Stepper/Stepper.styles.d.ts +31 -0
- package/dist/components/Stepper/Stepper.styles.d.ts.map +1 -0
- package/dist/components/Stepper/Stepper.styles.js +394 -0
- package/dist/components/Stepper/Stepper.types.d.ts +207 -0
- package/dist/components/Stepper/Stepper.types.d.ts.map +1 -0
- package/dist/components/Stepper/index.d.ts +78 -0
- package/dist/components/Stepper/index.d.ts.map +1 -0
- package/dist/components/Stepper/index.js +179 -0
- package/dist/components/Steps/Steps.styles.d.ts +2 -2
- package/dist/components/Steps/Steps.types.d.ts +281 -0
- package/dist/components/Steps/Steps.types.d.ts.map +1 -1
- package/dist/components/Tab/Tab.styles.d.ts +2 -2
- package/dist/components/TextArea/TextArea.styles.d.ts +1 -1
- package/dist/components/TextEditor/index.d.ts +2 -4
- package/dist/components/TextEditor/index.d.ts.map +1 -1
- package/dist/components/TextEditor/index.js +115 -120
- package/dist/components/Toast/ToastItem.d.ts.map +1 -1
- package/dist/components/Toast/ToastItem.js +90 -90
- package/dist/components/Tooltip/index.d.ts.map +1 -1
- package/dist/components/Tooltip/index.js +65 -62
- package/dist/components/Tour/Tour.styles.d.ts +32 -0
- package/dist/components/Tour/Tour.styles.d.ts.map +1 -0
- package/dist/components/Tour/Tour.styles.js +200 -0
- package/dist/components/Tour/Tour.types.d.ts +235 -0
- package/dist/components/Tour/Tour.types.d.ts.map +1 -0
- package/dist/components/Tour/index.d.ts +57 -0
- package/dist/components/Tour/index.d.ts.map +1 -0
- package/dist/components/Tour/index.js +303 -0
- package/dist/components/Transfer/Transfer.styles.d.ts +41 -0
- package/dist/components/Transfer/Transfer.styles.d.ts.map +1 -0
- package/dist/components/Transfer/Transfer.styles.js +209 -0
- package/dist/components/Transfer/Transfer.types.d.ts +240 -0
- package/dist/components/Transfer/Transfer.types.d.ts.map +1 -0
- package/dist/components/Transfer/index.d.ts +57 -0
- package/dist/components/Transfer/index.d.ts.map +1 -0
- package/dist/components/Transfer/index.js +352 -0
- package/dist/components/Upload/ImageEditor.js +84 -84
- package/dist/components/Upload/index.js +31 -31
- package/dist/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/hooks/useClickOutside.js +11 -11
- package/dist/hooks/useForm.js +13 -13
- package/dist/index.d.ts +49 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +866 -726
- package/dist/lib/validation.d.ts +1 -1
- package/dist/lib/validation.d.ts.map +1 -1
- package/mcp/server.ts +1800 -0
- package/mcp/test-dynamic-features.js +407 -0
- package/mcp/tsconfig.json +31 -0
- package/package.json +18 -5
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<h1>🎨 Saha UI</h1>
|
|
3
3
|
<p><strong>Ultra-Modern React Component Library</strong></p>
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
<p>
|
|
6
6
|
<a href="https://www.npmjs.com/package/saha-ui"><img src="https://img.shields.io/npm/v/saha-ui.svg?style=flat-square" alt="npm version"></a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/saha-ui"><img src="https://img.shields.io/npm/dm/saha-ui.svg?style=flat-square" alt="npm downloads"></a>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
## ✨ Features
|
|
31
31
|
|
|
32
|
-
- 🎨 **
|
|
32
|
+
- 🎨 **78 Modern Components** - Accordion, Alert, AspectRatio, Autocomplete, Avatar, AvatarGroup, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Chart (10 chart types), Checkbox, Chip, CodeEditor, Collapsible, Combobox, Command, Container, ContextMenu, DataTable, DatePicker, Dialog, Drawer, Dropdown, Empty, Field, FloatingActionButton, Form, Grid, HoverCard, Image, Input, InputOTP, Item, Kbd, Label, Link, List, Menubar, NativeSelect, NavigationMenu, Pagination, PlayButton, Popover, Progress, Radio, Rating, Resizable, ScrollArea, Section, Select, Separator, Skeleton (6 presets), Slider, Sonner, Spinner, Stack, Steps, Switch, Tab, Table, Tag, TagInput, TextArea, TextEditor, ThemeProvider, ThemeToggle, Timeline, Toast, Toggle, ToggleGroup, Tooltip, Tree, Typography, Upload
|
|
33
33
|
- ⚡ **Next.js 15/16 Ready** - Full App Router support with Server & Client Components
|
|
34
34
|
- 🌓 **Dark Mode** - Seamless theme switching with full dark mode support
|
|
35
35
|
- 🔮 **Glass Morphism** - Beautiful backdrop blur effects across components
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
- 📦 **Modular** - Individual component imports for maximum flexibility
|
|
42
42
|
- 📱 **Responsive** - Mobile-first design with touch gesture support
|
|
43
43
|
- 🔧 **Customizable** - Easy to extend and customize with Tailwind CSS
|
|
44
|
-
- 🪝 **Custom Hooks** -
|
|
44
|
+
- 🪝 **40 Custom Hooks** - Comprehensive hook library including useAccordion, useAnimation, useArray, useAspectRatio, useAsync, useAvatar, useChartColors, useChartData, useClickOutside, useClipboard, useColorMode, useControllableState, useCounter, useDataTable, useDebounce, useDisclosure, useDOM, useEventListener, useFetch, useFocusTrap, useForm, useHover, useIntersectionObserver, useInterval, useLocalStorage, useMediaQuery, useMergedRefs, usePagination, usePrevious, useReducedMotion, useScrollLock, useSearchFilter, useSessionStorage, useTheme, useThrottle, useTimeout, useToggle, useUpdateEffect, useValidation, useWindowSize
|
|
45
45
|
|
|
46
46
|
---
|
|
47
47
|
|
|
@@ -65,7 +65,14 @@ pnpm add saha-ui
|
|
|
65
65
|
Run this command in your project root to setup CSS and Tailwind configuration:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
|
|
68
|
+
# npm
|
|
69
|
+
npx saha-ui@latest init
|
|
70
|
+
|
|
71
|
+
# yarn
|
|
72
|
+
yarn dlx saha-ui@latest init
|
|
73
|
+
|
|
74
|
+
# pnpm
|
|
75
|
+
pnpm dlx saha-ui@latest init
|
|
69
76
|
```
|
|
70
77
|
|
|
71
78
|
This will automatically:
|
|
@@ -84,17 +91,20 @@ See [CSS_DISTRIBUTION_SOLUTION.md](./CSS_DISTRIBUTION_SOLUTION.md) for detailed
|
|
|
84
91
|
Saha UI requires React 18+ or React 19+:
|
|
85
92
|
|
|
86
93
|
```bash
|
|
94
|
+
# npm
|
|
87
95
|
npm install react@^18.0.0 react-dom@^18.0.0
|
|
88
96
|
# or
|
|
89
97
|
npm install react@^19.0.0 react-dom@^19.0.0
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### Optional Dependencies
|
|
93
98
|
|
|
94
|
-
|
|
99
|
+
# yarn
|
|
100
|
+
yarn add react@^18.0.0 react-dom@^18.0.0
|
|
101
|
+
# or
|
|
102
|
+
yarn add react@^19.0.0 react-dom@^19.0.0
|
|
95
103
|
|
|
96
|
-
|
|
97
|
-
|
|
104
|
+
# pnpm
|
|
105
|
+
pnpm add react@^18.0.0 react-dom@^18.0.0
|
|
106
|
+
# or
|
|
107
|
+
pnpm add react@^19.0.0 react-dom@^19.0.0
|
|
98
108
|
```
|
|
99
109
|
|
|
100
110
|
## 🚀 Quick Start
|
|
@@ -177,7 +187,17 @@ Saha UI is **fully compatible** with Next.js 15 and 16 App Router!
|
|
|
177
187
|
### Quick Setup
|
|
178
188
|
|
|
179
189
|
```bash
|
|
190
|
+
# npm
|
|
180
191
|
npm install saha-ui
|
|
192
|
+
npx saha-ui@latest init
|
|
193
|
+
|
|
194
|
+
# yarn
|
|
195
|
+
yarn add saha-ui
|
|
196
|
+
yarn dlx saha-ui@latest init
|
|
197
|
+
|
|
198
|
+
# pnpm
|
|
199
|
+
pnpm add saha-ui
|
|
200
|
+
pnpm dlx saha-ui@latest init
|
|
181
201
|
```
|
|
182
202
|
|
|
183
203
|
```tsx
|
|
@@ -257,6 +277,121 @@ export function InteractiveButton() {
|
|
|
257
277
|
|
|
258
278
|
---
|
|
259
279
|
|
|
280
|
+
## 🔄 Using asChild Pattern
|
|
281
|
+
|
|
282
|
+
Many Saha UI components support the `asChild` prop, which allows you to merge the component's props and behavior with a child element. This is particularly useful when you want to use a component's styling and functionality with custom elements like Next.js `Link` or React Router `Link`.
|
|
283
|
+
|
|
284
|
+
### Components Supporting asChild
|
|
285
|
+
|
|
286
|
+
The following **24 components** support the `asChild` prop:
|
|
287
|
+
|
|
288
|
+
- **Navigation & Actions:** Button, Link, Badge, Toggle, FloatingActionButton
|
|
289
|
+
- **Layout:** Container, Grid, Stack, Section, Card
|
|
290
|
+
- **Interactive:** Accordion (Trigger), Collapsible (Trigger), Tooltip (Trigger), HoverCard (Trigger), Dropdown (Trigger), ContextMenu (Trigger), NavigationMenu (Link), Combobox (Trigger)
|
|
291
|
+
- **Display:** Item, Kbd, Chip, Autocomplete (Input/Option), Slider (Thumb)
|
|
292
|
+
|
|
293
|
+
### Basic Usage
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
import { Button } from "saha-ui";
|
|
297
|
+
import Link from "next/link";
|
|
298
|
+
|
|
299
|
+
// Without asChild - creates a button
|
|
300
|
+
<Button variant="primary">Click me</Button>
|
|
301
|
+
|
|
302
|
+
// With asChild - merges with Next.js Link
|
|
303
|
+
<Button asChild variant="primary">
|
|
304
|
+
<Link href="/dashboard">Go to Dashboard</Link>
|
|
305
|
+
</Button>
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Common Use Cases
|
|
309
|
+
|
|
310
|
+
#### 1. Navigation Buttons with Next.js Link
|
|
311
|
+
|
|
312
|
+
```tsx
|
|
313
|
+
import { Button } from "saha-ui";
|
|
314
|
+
import Link from "next/link";
|
|
315
|
+
|
|
316
|
+
<Button asChild variant="primary" size="lg">
|
|
317
|
+
<Link href="/products">Browse Products</Link>
|
|
318
|
+
</Button>
|
|
319
|
+
|
|
320
|
+
// The button styling is applied to the Link component
|
|
321
|
+
// Result: <a href="/products" class="button-primary-classes">Browse Products</a>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
#### 2. Badge as Link
|
|
325
|
+
|
|
326
|
+
```tsx
|
|
327
|
+
import { Badge } from "saha-ui";
|
|
328
|
+
import Link from "next/link";
|
|
329
|
+
|
|
330
|
+
<Badge asChild variant="success" dot>
|
|
331
|
+
<Link href="/notifications">5 New Messages</Link>
|
|
332
|
+
</Badge>
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
#### 3. Card as Interactive Container
|
|
336
|
+
|
|
337
|
+
```tsx
|
|
338
|
+
import { Card } from "saha-ui";
|
|
339
|
+
import Link from "next/link";
|
|
340
|
+
|
|
341
|
+
<Card asChild variant="glass" hoverable>
|
|
342
|
+
<Link href="/blog/post-1">
|
|
343
|
+
<h3>Blog Post Title</h3>
|
|
344
|
+
<p>Post excerpt...</p>
|
|
345
|
+
</Link>
|
|
346
|
+
</Card>
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
#### 4. Tooltip with Custom Trigger
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import { Tooltip, TooltipTrigger, TooltipContent } from "saha-ui";
|
|
353
|
+
|
|
354
|
+
<Tooltip>
|
|
355
|
+
<TooltipTrigger asChild>
|
|
356
|
+
<button className="custom-icon-button">
|
|
357
|
+
<IconHelp />
|
|
358
|
+
</button>
|
|
359
|
+
</TooltipTrigger>
|
|
360
|
+
<TooltipContent>Help information</TooltipContent>
|
|
361
|
+
</Tooltip>
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
#### 5. Dropdown Menu Trigger
|
|
365
|
+
|
|
366
|
+
```tsx
|
|
367
|
+
import { Dropdown, DropdownTrigger, DropdownContent, DropdownItem } from "saha-ui";
|
|
368
|
+
import { Button } from "saha-ui";
|
|
369
|
+
|
|
370
|
+
<Dropdown>
|
|
371
|
+
<DropdownTrigger asChild>
|
|
372
|
+
<Button variant="outline">Open Menu</Button>
|
|
373
|
+
</DropdownTrigger>
|
|
374
|
+
<DropdownContent>
|
|
375
|
+
<DropdownItem>Profile</DropdownItem>
|
|
376
|
+
<DropdownItem>Settings</DropdownItem>
|
|
377
|
+
<DropdownItem>Logout</DropdownItem>
|
|
378
|
+
</DropdownContent>
|
|
379
|
+
</Dropdown>
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Benefits of asChild
|
|
383
|
+
|
|
384
|
+
| Benefit | Description |
|
|
385
|
+
|---------|-------------|
|
|
386
|
+
| **Preserves Styling** | All component variants, sizes, and styles are maintained |
|
|
387
|
+
| **Router Integration** | Works seamlessly with Next.js Link, React Router, and custom routing |
|
|
388
|
+
| **Accessibility** | Maintains all ARIA attributes and keyboard navigation |
|
|
389
|
+
| **Type Safety** | Full TypeScript support with proper type inference |
|
|
390
|
+
| **Clean DOM** | No unnecessary wrapper elements, cleaner HTML output |
|
|
391
|
+
| **Flexibility** | Use with any custom component or HTML element |
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
260
395
|
## 🎨 Components
|
|
261
396
|
|
|
262
397
|
### Overview
|
|
@@ -276,12 +411,14 @@ export function InteractiveButton() {
|
|
|
276
411
|
| **Calendar** | Date calendar with month/year navigation and date selection | ✅ | ✅ |
|
|
277
412
|
| **Card** | Container with 5 variants and sub-components | ✅ | ✅ |
|
|
278
413
|
| **Carousel** | Image slider with 4 transition effects and autoplay | ✅ | ✅ |
|
|
414
|
+
| **Chart** | Comprehensive charting with 10 types (Line, Bar, Area, Pie, Radar, etc) | ✅ | ✅ |
|
|
279
415
|
| **Checkbox** | Checkbox with 7 variants, 3 sizes, indeterminate, card mode, icons | ✅ | ✅ |
|
|
280
416
|
| **Chip** | Interactive tags with 5 variants, deletable, and avatars | ✅ | ✅ |
|
|
281
417
|
| **CodeEditor** | Code editor with syntax highlighting and themes | ✅ | ✅ |
|
|
282
418
|
| **Collapsible** | Expandable content with smooth animations | ✅ | ✅ |
|
|
283
419
|
| **Combobox** | Combined input and dropdown with search and selection | ✅ | ✅ |
|
|
284
420
|
| **Command** | Command palette with search and keyboard navigation | ✅ | ✅ |
|
|
421
|
+
| **Container** | Responsive container with max-width constraints and padding | ✅ | ✅ |
|
|
285
422
|
| **ContextMenu** | Right-click context menu with nested items and shortcuts | ✅ | ✅ |
|
|
286
423
|
| **DataTable** | Advanced data table with sorting, filtering, pagination | ✅ | ✅ |
|
|
287
424
|
| **DatePicker** | Calendar date picker with 5 variants, 3 sizes, date restrictions | ✅ | ✅ |
|
|
@@ -292,6 +429,7 @@ export function InteractiveButton() {
|
|
|
292
429
|
| **Field** | Form field wrapper with label, description, and error states | ✅ | ✅ |
|
|
293
430
|
| **FloatingActionButton** | Modern FAB with 9 variants, 4 sizes, positions, extended mode | ✅ | ✅ |
|
|
294
431
|
| **Form** | Form container with validation and layout management | ✅ | ✅ |
|
|
432
|
+
| **Grid** | CSS Grid layout system with responsive columns and gaps | ✅ | ✅ |
|
|
295
433
|
| **HoverCard** | Rich hover card with content preview and positioning | ✅ | ✅ |
|
|
296
434
|
| **Image** | Advanced image with lazy loading and aspect ratio | ✅ | ✅ |
|
|
297
435
|
| **Input** | Text input with 10 variants, 4 sizes, icons, validation, all input types | ✅ | ✅ |
|
|
@@ -303,7 +441,9 @@ export function InteractiveButton() {
|
|
|
303
441
|
| **List** | Modern lists with 5 variants and icon support | ✅ | ✅ |
|
|
304
442
|
| **Menubar** | Menu bar with dropdown menus and keyboard navigation | ✅ | ✅ |
|
|
305
443
|
| **NativeSelect** | Native select dropdown with custom styling | ✅ | ✅ |
|
|
306
|
-
| **NavigationMenu** |
|
|
444
|
+
| **NavigationMenu** | navigation menu with nested items and mega menu support | ✅ | ✅ |
|
|
445
|
+
| **Notification** | Notification center with positioning, stacking, auto-dismiss, context | ✅ | ✅ |
|
|
446
|
+
| **NumberInput** | Numeric input with increment/decrement, formatting, validation | ✅ | ✅ |
|
|
307
447
|
| **Pagination** | Page navigation with 5 variants, 3 sizes, ellipsis, customizable labels | ✅ | ✅ |
|
|
308
448
|
| **PlayButton** | Animated play/pause button with 9 variants, 4 sizes, smooth transitions | ✅ | ✅ |
|
|
309
449
|
| **Popover** | Rich content popover with 11 variants, 12 positions, 4 triggers | ✅ | ✅ |
|
|
@@ -311,13 +451,17 @@ export function InteractiveButton() {
|
|
|
311
451
|
| **Radio** | Radio button with 7 variants, 3 sizes, RadioGroup, descriptions | ✅ | ✅ |
|
|
312
452
|
| **Rating** | Star rating with 6 variants, 4 sizes, multiple icons, half stars | ✅ | ✅ |
|
|
313
453
|
| **Resizable** | Resizable panels with drag handles and constraints | ✅ | ✅ |
|
|
454
|
+
| **Result** | Result/status pages with 7 status types (success, error, 404, 403, 500) | ✅ | ✅ |
|
|
314
455
|
| **ScrollArea** | Custom scrollbar with smooth scrolling and styling | ✅ | ✅ |
|
|
456
|
+
| **Section** | Semantic section wrapper with variants and spacing | ✅ | ✅ |
|
|
315
457
|
| **Select** | Advanced dropdown with search, multi-select, icons, avatars, grouping | ✅ | ✅ |
|
|
316
458
|
| **Separator** | Content separator with 5 variants and label support | ✅ | ✅ |
|
|
459
|
+
| **FileInput** | File upload with drag-drop, preview, progress, validation | ✅ | ✅ |
|
|
317
460
|
| **Skeleton** | Loading placeholder with 5 variants, 4 shapes, customizable animations | ✅ | ✅ |
|
|
318
461
|
| **Slider** | Range slider with single/dual handles and custom marks | ✅ | ✅ |
|
|
319
462
|
| **Sonner** | Toast notifications with rich content and animations | ✅ | ✅ |
|
|
320
463
|
| **Spinner** | Loading spinner with 10 variants, 6 sizes, 4 animations, fullscreen mode | ✅ | ✅ |
|
|
464
|
+
| **Stack** | Flexbox-based stacking layout with direction and spacing control | ✅ | ✅ |
|
|
321
465
|
| **Steps** | Progress indicator with 4 variants, horizontal/vertical layouts | ✅ | ✅ |
|
|
322
466
|
| **Switch** | Toggle switch with 7 variants, 3 sizes, icons, loading state | ✅ | ✅ |
|
|
323
467
|
| **Tab** | Tab navigation with 14 variants, 3 sizes, icons, badges, disabled states | ✅ | ✅ |
|
|
@@ -339,6 +483,206 @@ export function InteractiveButton() {
|
|
|
339
483
|
|
|
340
484
|
---
|
|
341
485
|
|
|
486
|
+
## 🪝 Custom Hooks (40 Total)
|
|
487
|
+
|
|
488
|
+
Saha UI provides a comprehensive collection of reusable React hooks to enhance your development experience:
|
|
489
|
+
|
|
490
|
+
### Component-Specific Hooks (7)
|
|
491
|
+
| Hook | Description |
|
|
492
|
+
|------|-------------|
|
|
493
|
+
| **useAccordion** | Accordion state management and behavior control |
|
|
494
|
+
| **useAspectRatio** | Aspect ratio calculations and responsive sizing |
|
|
495
|
+
| **useAvatar** | Avatar loading, fallback, and status management |
|
|
496
|
+
| **useChartColors** | Chart color palette and theme management |
|
|
497
|
+
| **useChartData** | Chart data processing and transformation |
|
|
498
|
+
| **useDataTable** | DataTable state, sorting, filtering, and pagination |
|
|
499
|
+
| **useTheme** | Theme context access and dark mode management |
|
|
500
|
+
|
|
501
|
+
### State Management Hooks (9)
|
|
502
|
+
| Hook | Description |
|
|
503
|
+
|------|-------------|
|
|
504
|
+
| **useArray** | Array state utilities (push, pop, filter, update) |
|
|
505
|
+
| **useAsync** | Async operation state (loading, error, data) |
|
|
506
|
+
| **useControllableState** | Controlled/uncontrolled component state |
|
|
507
|
+
| **useCounter** | Counter state with increment/decrement |
|
|
508
|
+
| **useDisclosure** | Open/close state for modals and dropdowns |
|
|
509
|
+
| **useLocalStorage** | Local storage synchronization |
|
|
510
|
+
| **useSessionStorage** | Session storage synchronization |
|
|
511
|
+
| **useToggle** | Boolean toggle state |
|
|
512
|
+
| **usePrevious** | Previous value tracking across renders |
|
|
513
|
+
|
|
514
|
+
### DOM & Event Hooks (8)
|
|
515
|
+
| Hook | Description |
|
|
516
|
+
|------|-------------|
|
|
517
|
+
| **useClickOutside** | Detect clicks outside an element |
|
|
518
|
+
| **useDOM** | DOM manipulation utilities |
|
|
519
|
+
| **useEventListener** | Safe event listener management |
|
|
520
|
+
| **useFocusTrap** | Trap focus within a component |
|
|
521
|
+
| **useHover** | Hover state detection |
|
|
522
|
+
| **useIntersectionObserver** | Viewport intersection detection |
|
|
523
|
+
| **useScrollLock** | Lock/unlock body scroll |
|
|
524
|
+
| **useWindowSize** | Window dimensions tracking |
|
|
525
|
+
|
|
526
|
+
### Form & Validation Hooks (2)
|
|
527
|
+
| Hook | Description |
|
|
528
|
+
|------|-------------|
|
|
529
|
+
| **useForm** | Form state management and validation |
|
|
530
|
+
| **useValidation** | Input validation with custom rules |
|
|
531
|
+
|
|
532
|
+
### Utility Hooks (14)
|
|
533
|
+
| Hook | Description |
|
|
534
|
+
|------|-------------|
|
|
535
|
+
| **useAnimation** | Animation control utilities |
|
|
536
|
+
| **useClipboard** | Clipboard copy/paste operations |
|
|
537
|
+
| **useColorMode** | Color mode (light/dark) management |
|
|
538
|
+
| **useDebounce** | Debounced value updates |
|
|
539
|
+
| **useFetch** | Data fetching with loading states |
|
|
540
|
+
| **useInterval** | Interval management with cleanup |
|
|
541
|
+
| **useMediaQuery** | CSS media query matching |
|
|
542
|
+
| **useMergedRefs** | Merge multiple refs into one |
|
|
543
|
+
| **usePagination** | Pagination logic and state |
|
|
544
|
+
| **useReducedMotion** | Detect user motion preferences |
|
|
545
|
+
| **useSearchFilter** | Search and filter operations |
|
|
546
|
+
| **useThrottle** | Throttled value updates |
|
|
547
|
+
| **useTimeout** | Timeout management with cleanup |
|
|
548
|
+
| **useUpdateEffect** | useEffect that skips first render |
|
|
549
|
+
|
|
550
|
+
### Hook Usage Examples
|
|
551
|
+
|
|
552
|
+
```tsx
|
|
553
|
+
import { useTheme, useToggle, useDebounce, useLocalStorage } from "saha-ui";
|
|
554
|
+
|
|
555
|
+
// Theme management
|
|
556
|
+
function ThemeExample() {
|
|
557
|
+
const { theme, setTheme } = useTheme();
|
|
558
|
+
|
|
559
|
+
return (
|
|
560
|
+
<button onClick={() => setTheme(theme === "dark" ? "light" : "dark")}>
|
|
561
|
+
Current theme: {theme}
|
|
562
|
+
</button>
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
// Toggle state
|
|
567
|
+
function ToggleExample() {
|
|
568
|
+
const [isOpen, toggle] = useToggle(false);
|
|
569
|
+
|
|
570
|
+
return (
|
|
571
|
+
<div>
|
|
572
|
+
<button onClick={toggle}>Toggle</button>
|
|
573
|
+
{isOpen && <div>Content is visible!</div>}
|
|
574
|
+
</div>
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
// Debounced search
|
|
579
|
+
function SearchExample() {
|
|
580
|
+
const [search, setSearch] = useState("");
|
|
581
|
+
const debouncedSearch = useDebounce(search, 500);
|
|
582
|
+
|
|
583
|
+
useEffect(() => {
|
|
584
|
+
// API call with debounced value
|
|
585
|
+
if (debouncedSearch) {
|
|
586
|
+
fetchResults(debouncedSearch);
|
|
587
|
+
}
|
|
588
|
+
}, [debouncedSearch]);
|
|
589
|
+
|
|
590
|
+
return <input value={search} onChange={(e) => setSearch(e.target.value)} />;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// Local storage persistence
|
|
594
|
+
function StorageExample() {
|
|
595
|
+
const [name, setName] = useLocalStorage("user-name", "Guest");
|
|
596
|
+
|
|
597
|
+
return (
|
|
598
|
+
<input
|
|
599
|
+
value={name}
|
|
600
|
+
onChange={(e) => setName(e.target.value)}
|
|
601
|
+
placeholder="Your name"
|
|
602
|
+
/>
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
---
|
|
608
|
+
|
|
609
|
+
## 🔄 asChild Pattern
|
|
610
|
+
|
|
611
|
+
Many Saha UI components support the `asChild` prop, which allows you to compose components with your own elements while preserving the component's styling and behavior. This is particularly useful when you want to render a component as a link, custom router component, or any other element.
|
|
612
|
+
|
|
613
|
+
### How It Works
|
|
614
|
+
|
|
615
|
+
When `asChild={true}`, the component passes its props to its direct child instead of rendering its default element. This uses the Slot pattern internally.
|
|
616
|
+
|
|
617
|
+
### Supported Components
|
|
618
|
+
|
|
619
|
+
The following components support `asChild`:
|
|
620
|
+
- **Navigation:** Button, Link, Badge
|
|
621
|
+
- **Layout:** Container, Grid, Stack, Section, Card
|
|
622
|
+
- **Interactive:** Accordion (trigger), FloatingActionButton, Toggle, Tooltip (trigger)
|
|
623
|
+
- **Data Display:** Chip, Item, Kbd
|
|
624
|
+
- **Overlays:** Combobox, ContextMenu, Dropdown, HoverCard, NavigationMenu
|
|
625
|
+
|
|
626
|
+
### Basic Example
|
|
627
|
+
|
|
628
|
+
```tsx
|
|
629
|
+
import { Button } from "saha-ui";
|
|
630
|
+
import Link from "next/link";
|
|
631
|
+
|
|
632
|
+
// Regular button
|
|
633
|
+
<Button variant="primary">Click Me</Button>
|
|
634
|
+
|
|
635
|
+
// Button rendered as Next.js Link (preserves button styling)
|
|
636
|
+
<Button variant="primary" asChild>
|
|
637
|
+
<Link href="/dashboard">Go to Dashboard</Link>
|
|
638
|
+
</Button>
|
|
639
|
+
|
|
640
|
+
// Button rendered as anchor tag
|
|
641
|
+
<Button variant="gradient" asChild>
|
|
642
|
+
<a href="https://example.com">External Link</a>
|
|
643
|
+
</Button>
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Advanced Examples
|
|
647
|
+
|
|
648
|
+
```tsx
|
|
649
|
+
// Badge as a link
|
|
650
|
+
<Badge variant="success" asChild>
|
|
651
|
+
<Link href="/notifications">3 New</Link>
|
|
652
|
+
</Badge>
|
|
653
|
+
|
|
654
|
+
// Card as clickable link
|
|
655
|
+
<Card variant="glass" hoverable asChild>
|
|
656
|
+
<Link href="/article/123">
|
|
657
|
+
<CardContent>Click entire card</CardContent>
|
|
658
|
+
</Link>
|
|
659
|
+
</Card>
|
|
660
|
+
|
|
661
|
+
// FloatingActionButton as Next.js Link
|
|
662
|
+
<FloatingActionButton variant="primary" position="bottom-right" asChild>
|
|
663
|
+
<Link href="/create">
|
|
664
|
+
<Plus size={24} />
|
|
665
|
+
</Link>
|
|
666
|
+
</FloatingActionButton>
|
|
667
|
+
|
|
668
|
+
// Custom router component
|
|
669
|
+
import { Link as RouterLink } from "react-router-dom";
|
|
670
|
+
|
|
671
|
+
<Button variant="outline" asChild>
|
|
672
|
+
<RouterLink to="/settings">Settings</RouterLink>
|
|
673
|
+
</Button>
|
|
674
|
+
```
|
|
675
|
+
|
|
676
|
+
### Benefits
|
|
677
|
+
|
|
678
|
+
- ✅ Preserves all component styling and variants
|
|
679
|
+
- ✅ Works with any routing library (Next.js, React Router, etc.)
|
|
680
|
+
- ✅ Maintains accessibility features
|
|
681
|
+
- ✅ Type-safe with TypeScript
|
|
682
|
+
- ✅ No wrapper elements (cleaner DOM)
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
342
686
|
## ⚡ Quick Examples
|
|
343
687
|
|
|
344
688
|
Here are simple examples for all components to get you started quickly:
|
|
@@ -348,8 +692,24 @@ Here are simple examples for all components to get you started quickly:
|
|
|
348
692
|
```tsx
|
|
349
693
|
import { Button } from "saha-ui";
|
|
350
694
|
|
|
695
|
+
// Basic button
|
|
351
696
|
<Button variant="primary">Click Me</Button>
|
|
352
697
|
<Button variant="ghost" size="sm">Small Ghost</Button>
|
|
698
|
+
|
|
699
|
+
// asChild - Render as a custom element (Link, anchor, etc.)
|
|
700
|
+
<Button variant="primary" asChild>
|
|
701
|
+
<a href="/dashboard">Go to Dashboard</a>
|
|
702
|
+
</Button>
|
|
703
|
+
|
|
704
|
+
// asChild with Next.js Link
|
|
705
|
+
<Button variant="gradient" size="lg" asChild>
|
|
706
|
+
<Link href="/profile">View Profile</Link>
|
|
707
|
+
</Button>
|
|
708
|
+
|
|
709
|
+
// asChild with custom component
|
|
710
|
+
<Button variant="outline" asChild>
|
|
711
|
+
<CustomRouterLink to="/settings">Settings</CustomRouterLink>
|
|
712
|
+
</Button>
|
|
353
713
|
```
|
|
354
714
|
|
|
355
715
|
### ButtonGroup
|
|
@@ -378,9 +738,20 @@ import { Alert } from "saha-ui";
|
|
|
378
738
|
```tsx
|
|
379
739
|
import { Badge } from "saha-ui";
|
|
380
740
|
|
|
741
|
+
// Basic badge
|
|
381
742
|
<Badge variant="primary">New</Badge>
|
|
382
743
|
<Badge variant="success" dot pulse>Online</Badge>
|
|
383
744
|
<Badge removable onRemove={() => console.log('removed')}>Tag</Badge>
|
|
745
|
+
|
|
746
|
+
// asChild - Render badge as a link
|
|
747
|
+
<Badge variant="info" asChild>
|
|
748
|
+
<a href="/notifications">3 New</a>
|
|
749
|
+
</Badge>
|
|
750
|
+
|
|
751
|
+
// asChild with Next.js Link
|
|
752
|
+
<Badge variant="warning" dot asChild>
|
|
753
|
+
<Link href="/alerts">Pending</Link>
|
|
754
|
+
</Badge>
|
|
384
755
|
```
|
|
385
756
|
|
|
386
757
|
### Breadcrumb
|
|
@@ -421,12 +792,30 @@ import { Breadcrumb, BreadcrumbItem, BreadcrumbSeparator } from "saha-ui";
|
|
|
421
792
|
```tsx
|
|
422
793
|
import { Card, CardHeader, CardTitle, CardContent } from "saha-ui";
|
|
423
794
|
|
|
795
|
+
// Basic card
|
|
424
796
|
<Card variant="glass" hoverable>
|
|
425
797
|
<CardHeader>
|
|
426
798
|
<CardTitle>Card Title</CardTitle>
|
|
427
799
|
</CardHeader>
|
|
428
800
|
<CardContent>Your content here</CardContent>
|
|
429
|
-
</Card
|
|
801
|
+
</Card>
|
|
802
|
+
|
|
803
|
+
// asChild - Clickable card as a link
|
|
804
|
+
<Card variant="outline" hoverable asChild>
|
|
805
|
+
<a href="/article/123">
|
|
806
|
+
<CardHeader>
|
|
807
|
+
<CardTitle>Read More</CardTitle>
|
|
808
|
+
</CardHeader>
|
|
809
|
+
<CardContent>Click anywhere on this card to navigate</CardContent>
|
|
810
|
+
</a>
|
|
811
|
+
</Card>
|
|
812
|
+
|
|
813
|
+
// asChild with Next.js Link
|
|
814
|
+
<Card variant="glass" asChild>
|
|
815
|
+
<Link href="/product/456">
|
|
816
|
+
<CardContent>Product Details</CardContent>
|
|
817
|
+
</Link>
|
|
818
|
+
</Card>
|
|
430
819
|
```
|
|
431
820
|
|
|
432
821
|
### Chip
|
|
@@ -454,6 +843,16 @@ import { Chip } from "saha-ui";
|
|
|
454
843
|
<Chip avatar={<Avatar name="JD" size="xs" />} color="primary">
|
|
455
844
|
John Doe
|
|
456
845
|
</Chip>
|
|
846
|
+
|
|
847
|
+
// asChild - Chip as a link
|
|
848
|
+
<Chip variant="filled" color="primary" asChild>
|
|
849
|
+
<a href="/tags/react">React</a>
|
|
850
|
+
</Chip>
|
|
851
|
+
|
|
852
|
+
// asChild with Next.js Link
|
|
853
|
+
<Chip variant="outlined" clickable asChild>
|
|
854
|
+
<Link href="/category/javascript">JavaScript</Link>
|
|
855
|
+
</Chip>
|
|
457
856
|
```
|
|
458
857
|
|
|
459
858
|
### Separator
|
|
@@ -472,6 +871,7 @@ import { Separator } from "saha-ui";
|
|
|
472
871
|
```tsx
|
|
473
872
|
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "saha-ui";
|
|
474
873
|
|
|
874
|
+
// Basic accordion
|
|
475
875
|
<Accordion type="single" collapsible>
|
|
476
876
|
<AccordionItem value="item-1">
|
|
477
877
|
<AccordionTrigger>Section 1</AccordionTrigger>
|
|
@@ -490,6 +890,18 @@ import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "sa
|
|
|
490
890
|
<AccordionContent>Content here</AccordionContent>
|
|
491
891
|
</AccordionItem>
|
|
492
892
|
</Accordion>
|
|
893
|
+
|
|
894
|
+
// asChild - Custom trigger element
|
|
895
|
+
<Accordion type="single" collapsible>
|
|
896
|
+
<AccordionItem value="item-1">
|
|
897
|
+
<AccordionTrigger asChild>
|
|
898
|
+
<button className="custom-trigger-class">
|
|
899
|
+
Click to expand
|
|
900
|
+
</button>
|
|
901
|
+
</AccordionTrigger>
|
|
902
|
+
<AccordionContent>Content here</AccordionContent>
|
|
903
|
+
</AccordionItem>
|
|
904
|
+
</Accordion>
|
|
493
905
|
```
|
|
494
906
|
|
|
495
907
|
### Avatar
|
|
@@ -545,6 +957,22 @@ import { Tooltip, TooltipTrigger, TooltipContent } from "saha-ui";
|
|
|
545
957
|
<div>Click <a href="#">here</a> for more</div>
|
|
546
958
|
</TooltipContent>
|
|
547
959
|
</Tooltip>
|
|
960
|
+
|
|
961
|
+
// asChild - Use tooltip with custom trigger element
|
|
962
|
+
<Tooltip variant="info">
|
|
963
|
+
<TooltipTrigger asChild>
|
|
964
|
+
<span className="custom-element">Hover for info</span>
|
|
965
|
+
</TooltipTrigger>
|
|
966
|
+
<TooltipContent>Additional information</TooltipContent>
|
|
967
|
+
</Tooltip>
|
|
968
|
+
|
|
969
|
+
// asChild with icon or custom component
|
|
970
|
+
<Tooltip>
|
|
971
|
+
<TooltipTrigger asChild>
|
|
972
|
+
<InfoIcon className="cursor-help" />
|
|
973
|
+
</TooltipTrigger>
|
|
974
|
+
<TooltipContent>Help text here</TooltipContent>
|
|
975
|
+
</Tooltip>
|
|
548
976
|
```
|
|
549
977
|
|
|
550
978
|
### Link
|
|
@@ -552,11 +980,27 @@ import { Tooltip, TooltipTrigger, TooltipContent } from "saha-ui";
|
|
|
552
980
|
```tsx
|
|
553
981
|
import { Link } from "saha-ui";
|
|
554
982
|
|
|
983
|
+
// Basic links
|
|
555
984
|
<Link href="/about">About Us</Link>
|
|
556
985
|
<Link href="https://example.com" variant="primary" external>
|
|
557
986
|
External Link
|
|
558
987
|
</Link>
|
|
559
988
|
<Link href="/contact" showIcon>Contact</Link>
|
|
989
|
+
|
|
990
|
+
// asChild - Use Link styles with Next.js Link or custom component
|
|
991
|
+
<Link variant="primary" asChild>
|
|
992
|
+
<NextLink href="/dashboard">Dashboard</NextLink>
|
|
993
|
+
</Link>
|
|
994
|
+
|
|
995
|
+
// asChild with button styling
|
|
996
|
+
<Link variant="gradient" showIcon asChild>
|
|
997
|
+
<button onClick={handleClick}>Custom Action</button>
|
|
998
|
+
</Link>
|
|
999
|
+
|
|
1000
|
+
// asChild preserves all Link styling
|
|
1001
|
+
<Link variant="underline" asChild>
|
|
1002
|
+
<RouterLink to="/settings">Settings</RouterLink>
|
|
1003
|
+
</Link>
|
|
560
1004
|
```
|
|
561
1005
|
|
|
562
1006
|
### List
|
|
@@ -806,8 +1250,10 @@ import { PlayButton } from "saha-ui";
|
|
|
806
1250
|
|
|
807
1251
|
```tsx
|
|
808
1252
|
import { FloatingActionButton } from "saha-ui";
|
|
809
|
-
import { Plus } from "lucide-react";
|
|
1253
|
+
import { Plus, MessageCircle } from "lucide-react";
|
|
1254
|
+
import Link from "next/link";
|
|
810
1255
|
|
|
1256
|
+
// Basic FAB
|
|
811
1257
|
<FloatingActionButton
|
|
812
1258
|
variant="primary"
|
|
813
1259
|
position="bottom-right"
|
|
@@ -815,11 +1261,9 @@ import { Plus } from "lucide-react";
|
|
|
815
1261
|
onClick={() => console.log("FAB clicked!")}
|
|
816
1262
|
>
|
|
817
1263
|
<Plus size={24} />
|
|
818
|
-
</FloatingActionButton
|
|
1264
|
+
</FloatingActionButton>
|
|
819
1265
|
|
|
820
|
-
|
|
821
|
-
/* Extended FAB */
|
|
822
|
-
}
|
|
1266
|
+
// Extended FAB
|
|
823
1267
|
<FloatingActionButton
|
|
824
1268
|
variant="accent"
|
|
825
1269
|
position="bottom-left"
|
|
@@ -827,7 +1271,360 @@ import { Plus } from "lucide-react";
|
|
|
827
1271
|
extended
|
|
828
1272
|
>
|
|
829
1273
|
<Plus size={20} />
|
|
830
|
-
</FloatingActionButton
|
|
1274
|
+
</FloatingActionButton>
|
|
1275
|
+
|
|
1276
|
+
// asChild - Render FAB as a link
|
|
1277
|
+
<FloatingActionButton
|
|
1278
|
+
variant="primary"
|
|
1279
|
+
position="bottom-right"
|
|
1280
|
+
label="Chat"
|
|
1281
|
+
asChild
|
|
1282
|
+
>
|
|
1283
|
+
<a href="/chat">
|
|
1284
|
+
<MessageCircle size={24} />
|
|
1285
|
+
</a>
|
|
1286
|
+
</FloatingActionButton>
|
|
1287
|
+
|
|
1288
|
+
// asChild with Next.js Link
|
|
1289
|
+
<FloatingActionButton variant="success" position="bottom-center" asChild>
|
|
1290
|
+
<Link href="/create">
|
|
1291
|
+
<Plus size={24} />
|
|
1292
|
+
</Link>
|
|
1293
|
+
</FloatingActionButton>
|
|
1294
|
+
```
|
|
1295
|
+
|
|
1296
|
+
### Toggle
|
|
1297
|
+
|
|
1298
|
+
```tsx
|
|
1299
|
+
import { Toggle } from "saha-ui";
|
|
1300
|
+
import { Bold } from "lucide-react";
|
|
1301
|
+
|
|
1302
|
+
// Basic toggle
|
|
1303
|
+
<Toggle>
|
|
1304
|
+
<Bold size={16} />
|
|
1305
|
+
</Toggle>
|
|
1306
|
+
|
|
1307
|
+
// With variants
|
|
1308
|
+
<Toggle variant="outline" pressed={isBold} onPressedChange={setIsBold}>
|
|
1309
|
+
<Bold size={16} />
|
|
1310
|
+
</Toggle>
|
|
1311
|
+
|
|
1312
|
+
// asChild - Custom element
|
|
1313
|
+
<Toggle variant="primary" asChild>
|
|
1314
|
+
<button className="custom-class">
|
|
1315
|
+
<Bold size={16} />
|
|
1316
|
+
</button>
|
|
1317
|
+
</Toggle>
|
|
1318
|
+
```
|
|
1319
|
+
|
|
1320
|
+
### Container
|
|
1321
|
+
|
|
1322
|
+
```tsx
|
|
1323
|
+
import { Container } from "saha-ui";
|
|
1324
|
+
|
|
1325
|
+
// Basic container
|
|
1326
|
+
<Container>
|
|
1327
|
+
<p>Content with max-width and padding</p>
|
|
1328
|
+
</Container>
|
|
1329
|
+
|
|
1330
|
+
// With size variants
|
|
1331
|
+
<Container size="sm" centered>
|
|
1332
|
+
<p>Small centered container</p>
|
|
1333
|
+
</Container>
|
|
1334
|
+
|
|
1335
|
+
// asChild - Container as section
|
|
1336
|
+
<Container variant="glass" asChild>
|
|
1337
|
+
<section className="my-section">
|
|
1338
|
+
<h1>Section Title</h1>
|
|
1339
|
+
<p>Content here</p>
|
|
1340
|
+
</section>
|
|
1341
|
+
</Container>
|
|
1342
|
+
```
|
|
1343
|
+
|
|
1344
|
+
### Grid
|
|
1345
|
+
|
|
1346
|
+
```tsx
|
|
1347
|
+
import { Grid, GridItem } from "saha-ui";
|
|
1348
|
+
|
|
1349
|
+
// Basic grid
|
|
1350
|
+
<Grid cols={3} gap={4}>
|
|
1351
|
+
<GridItem>Item 1</GridItem>
|
|
1352
|
+
<GridItem>Item 2</GridItem>
|
|
1353
|
+
<GridItem>Item 3</GridItem>
|
|
1354
|
+
</Grid>
|
|
1355
|
+
|
|
1356
|
+
// Responsive grid
|
|
1357
|
+
<Grid cols={{ base: 1, md: 2, lg: 3 }} gap={6}>
|
|
1358
|
+
<GridItem span={2}>Wide item</GridItem>
|
|
1359
|
+
<GridItem>Regular item</GridItem>
|
|
1360
|
+
</Grid>
|
|
1361
|
+
|
|
1362
|
+
// asChild - Grid as article
|
|
1363
|
+
<Grid cols={2} gap={4} asChild>
|
|
1364
|
+
<article>
|
|
1365
|
+
<GridItem>Content 1</GridItem>
|
|
1366
|
+
<GridItem>Content 2</GridItem>
|
|
1367
|
+
</article>
|
|
1368
|
+
</Grid>
|
|
1369
|
+
```
|
|
1370
|
+
|
|
1371
|
+
### Stack
|
|
1372
|
+
|
|
1373
|
+
```tsx
|
|
1374
|
+
import { Stack } from "saha-ui";
|
|
1375
|
+
|
|
1376
|
+
// Vertical stack
|
|
1377
|
+
<Stack direction="vertical" spacing={4}>
|
|
1378
|
+
<div>Item 1</div>
|
|
1379
|
+
<div>Item 2</div>
|
|
1380
|
+
<div>Item 3</div>
|
|
1381
|
+
</Stack>
|
|
1382
|
+
|
|
1383
|
+
// Horizontal stack
|
|
1384
|
+
<Stack direction="horizontal" spacing={2} align="center">
|
|
1385
|
+
<Button>Action 1</Button>
|
|
1386
|
+
<Button>Action 2</Button>
|
|
1387
|
+
</Stack>
|
|
1388
|
+
|
|
1389
|
+
// asChild - Stack as nav
|
|
1390
|
+
<Stack direction="horizontal" spacing={4} asChild>
|
|
1391
|
+
<nav>
|
|
1392
|
+
<Link href="/">Home</Link>
|
|
1393
|
+
<Link href="/about">About</Link>
|
|
1394
|
+
</nav>
|
|
1395
|
+
</Stack>
|
|
1396
|
+
```
|
|
1397
|
+
|
|
1398
|
+
### Item
|
|
1399
|
+
|
|
1400
|
+
```tsx
|
|
1401
|
+
import { Item, ItemMedia, ItemContent, ItemTitle, ItemDescription } from "saha-ui";
|
|
1402
|
+
|
|
1403
|
+
// Basic item
|
|
1404
|
+
<Item>
|
|
1405
|
+
<ItemMedia>
|
|
1406
|
+
<Avatar src="/user.jpg" />
|
|
1407
|
+
</ItemMedia>
|
|
1408
|
+
<ItemContent>
|
|
1409
|
+
<ItemTitle>John Doe</ItemTitle>
|
|
1410
|
+
<ItemDescription>Software Engineer</ItemDescription>
|
|
1411
|
+
</ItemContent>
|
|
1412
|
+
</Item>
|
|
1413
|
+
|
|
1414
|
+
// asChild - Item as link
|
|
1415
|
+
<Item variant="interactive" asChild>
|
|
1416
|
+
<a href="/profile/123">
|
|
1417
|
+
<ItemContent>
|
|
1418
|
+
<ItemTitle>View Profile</ItemTitle>
|
|
1419
|
+
<ItemDescription>Click to see details</ItemDescription>
|
|
1420
|
+
</ItemContent>
|
|
1421
|
+
</a>
|
|
1422
|
+
</Item>
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
### Kbd
|
|
1426
|
+
|
|
1427
|
+
```tsx
|
|
1428
|
+
import { Kbd, KbdGroup } from "saha-ui";
|
|
1429
|
+
|
|
1430
|
+
// Single key
|
|
1431
|
+
<Kbd>Ctrl</Kbd>
|
|
1432
|
+
|
|
1433
|
+
// Key combination
|
|
1434
|
+
<KbdGroup>
|
|
1435
|
+
<Kbd>Ctrl</Kbd>
|
|
1436
|
+
<Kbd>C</Kbd>
|
|
1437
|
+
</KbdGroup>
|
|
1438
|
+
|
|
1439
|
+
// asChild - Kbd as button
|
|
1440
|
+
<Kbd variant="outline" asChild>
|
|
1441
|
+
<button onClick={handleShortcut}>⌘ K</button>
|
|
1442
|
+
</Kbd>
|
|
1443
|
+
```
|
|
1444
|
+
|
|
1445
|
+
### HoverCard
|
|
1446
|
+
|
|
1447
|
+
```tsx
|
|
1448
|
+
import { HoverCard, HoverCardTrigger, HoverCardContent } from "saha-ui";
|
|
1449
|
+
|
|
1450
|
+
// Basic hover card
|
|
1451
|
+
<HoverCard>
|
|
1452
|
+
<HoverCardTrigger>
|
|
1453
|
+
<span>Hover me</span>
|
|
1454
|
+
</HoverCardTrigger>
|
|
1455
|
+
<HoverCardContent>
|
|
1456
|
+
<p>Additional information appears here</p>
|
|
1457
|
+
</HoverCardContent>
|
|
1458
|
+
</HoverCard>
|
|
1459
|
+
|
|
1460
|
+
// asChild - Custom trigger element
|
|
1461
|
+
<HoverCard variant="glass">
|
|
1462
|
+
<HoverCardTrigger asChild>
|
|
1463
|
+
<a href="/user/123">@username</a>
|
|
1464
|
+
</HoverCardTrigger>
|
|
1465
|
+
<HoverCardContent>
|
|
1466
|
+
<div className="flex items-center gap-3">
|
|
1467
|
+
<Avatar src="/user.jpg" />
|
|
1468
|
+
<div>
|
|
1469
|
+
<h4>John Doe</h4>
|
|
1470
|
+
<p>Software Engineer</p>
|
|
1471
|
+
</div>
|
|
1472
|
+
</div>
|
|
1473
|
+
</HoverCardContent>
|
|
1474
|
+
</HoverCard>
|
|
1475
|
+
|
|
1476
|
+
// asChild with button
|
|
1477
|
+
<HoverCard>
|
|
1478
|
+
<HoverCardTrigger asChild>
|
|
1479
|
+
<Button variant="ghost">Profile Preview</Button>
|
|
1480
|
+
</HoverCardTrigger>
|
|
1481
|
+
<HoverCardContent>User details...</HoverCardContent>
|
|
1482
|
+
</HoverCard>
|
|
1483
|
+
```
|
|
1484
|
+
|
|
1485
|
+
### Collapsible
|
|
1486
|
+
|
|
1487
|
+
```tsx
|
|
1488
|
+
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "saha-ui";
|
|
1489
|
+
|
|
1490
|
+
// Basic collapsible
|
|
1491
|
+
<Collapsible>
|
|
1492
|
+
<CollapsibleTrigger>Show More</CollapsibleTrigger>
|
|
1493
|
+
<CollapsibleContent>
|
|
1494
|
+
<p>Hidden content appears here</p>
|
|
1495
|
+
</CollapsibleContent>
|
|
1496
|
+
</Collapsible>
|
|
1497
|
+
|
|
1498
|
+
// asChild - Custom trigger
|
|
1499
|
+
<Collapsible variant="bordered">
|
|
1500
|
+
<CollapsibleTrigger asChild>
|
|
1501
|
+
<button className="custom-button">
|
|
1502
|
+
Toggle Details
|
|
1503
|
+
</button>
|
|
1504
|
+
</CollapsibleTrigger>
|
|
1505
|
+
<CollapsibleContent>
|
|
1506
|
+
<p>Collapsible content with smooth animation</p>
|
|
1507
|
+
</CollapsibleContent>
|
|
1508
|
+
</Collapsible>
|
|
1509
|
+
|
|
1510
|
+
// asChild with heading
|
|
1511
|
+
<Collapsible>
|
|
1512
|
+
<CollapsibleTrigger asChild>
|
|
1513
|
+
<h3 className="cursor-pointer">FAQ Question</h3>
|
|
1514
|
+
</CollapsibleTrigger>
|
|
1515
|
+
<CollapsibleContent>Answer to the question</CollapsibleContent>
|
|
1516
|
+
</Collapsible>
|
|
1517
|
+
```
|
|
1518
|
+
|
|
1519
|
+
### NavigationMenu
|
|
1520
|
+
|
|
1521
|
+
```tsx
|
|
1522
|
+
import {
|
|
1523
|
+
NavigationMenu,
|
|
1524
|
+
NavigationMenuItem,
|
|
1525
|
+
NavigationMenuTrigger,
|
|
1526
|
+
NavigationMenuContent,
|
|
1527
|
+
NavigationMenuLink
|
|
1528
|
+
} from "saha-ui";
|
|
1529
|
+
|
|
1530
|
+
// Basic navigation menu
|
|
1531
|
+
<NavigationMenu>
|
|
1532
|
+
<NavigationMenuItem>
|
|
1533
|
+
<NavigationMenuTrigger>Products</NavigationMenuTrigger>
|
|
1534
|
+
<NavigationMenuContent>
|
|
1535
|
+
<NavigationMenuLink href="/products/all">All Products</NavigationMenuLink>
|
|
1536
|
+
<NavigationMenuLink href="/products/new">New Arrivals</NavigationMenuLink>
|
|
1537
|
+
</NavigationMenuContent>
|
|
1538
|
+
</NavigationMenuItem>
|
|
1539
|
+
</NavigationMenu>
|
|
1540
|
+
|
|
1541
|
+
// asChild - Custom trigger element
|
|
1542
|
+
<NavigationMenu>
|
|
1543
|
+
<NavigationMenuItem>
|
|
1544
|
+
<NavigationMenuTrigger asChild>
|
|
1545
|
+
<button className="nav-button">Services</button>
|
|
1546
|
+
</NavigationMenuTrigger>
|
|
1547
|
+
<NavigationMenuContent>
|
|
1548
|
+
<p>Service content here</p>
|
|
1549
|
+
</NavigationMenuContent>
|
|
1550
|
+
</NavigationMenuItem>
|
|
1551
|
+
</NavigationMenu>
|
|
1552
|
+
|
|
1553
|
+
// asChild - Links with Next.js
|
|
1554
|
+
<NavigationMenu>
|
|
1555
|
+
<NavigationMenuItem>
|
|
1556
|
+
<NavigationMenuLink asChild>
|
|
1557
|
+
<Link href="/about">About Us</Link>
|
|
1558
|
+
</NavigationMenuLink>
|
|
1559
|
+
</NavigationMenuItem>
|
|
1560
|
+
</NavigationMenu>
|
|
1561
|
+
```
|
|
1562
|
+
|
|
1563
|
+
### ContextMenu
|
|
1564
|
+
|
|
1565
|
+
```tsx
|
|
1566
|
+
import {
|
|
1567
|
+
ContextMenu,
|
|
1568
|
+
ContextMenuTrigger,
|
|
1569
|
+
ContextMenuContent,
|
|
1570
|
+
ContextMenuItem
|
|
1571
|
+
} from "saha-ui";
|
|
1572
|
+
|
|
1573
|
+
// Basic context menu
|
|
1574
|
+
<ContextMenu>
|
|
1575
|
+
<ContextMenuTrigger>
|
|
1576
|
+
<div>Right click me</div>
|
|
1577
|
+
</ContextMenuTrigger>
|
|
1578
|
+
<ContextMenuContent>
|
|
1579
|
+
<ContextMenuItem>Edit</ContextMenuItem>
|
|
1580
|
+
<ContextMenuItem>Delete</ContextMenuItem>
|
|
1581
|
+
</ContextMenuContent>
|
|
1582
|
+
</ContextMenu>
|
|
1583
|
+
|
|
1584
|
+
// asChild - Custom trigger
|
|
1585
|
+
<ContextMenu>
|
|
1586
|
+
<ContextMenuTrigger asChild>
|
|
1587
|
+
<Card variant="outline">
|
|
1588
|
+
<CardContent>Right click this card</CardContent>
|
|
1589
|
+
</Card>
|
|
1590
|
+
</ContextMenuTrigger>
|
|
1591
|
+
<ContextMenuContent>
|
|
1592
|
+
<ContextMenuItem>Copy</ContextMenuItem>
|
|
1593
|
+
<ContextMenuItem>Paste</ContextMenuItem>
|
|
1594
|
+
</ContextMenuContent>
|
|
1595
|
+
</ContextMenu>
|
|
1596
|
+
```
|
|
1597
|
+
|
|
1598
|
+
### Combobox
|
|
1599
|
+
|
|
1600
|
+
```tsx
|
|
1601
|
+
import {
|
|
1602
|
+
Combobox,
|
|
1603
|
+
ComboboxTrigger,
|
|
1604
|
+
ComboboxContent,
|
|
1605
|
+
ComboboxItem
|
|
1606
|
+
} from "saha-ui";
|
|
1607
|
+
|
|
1608
|
+
// Basic combobox
|
|
1609
|
+
<Combobox>
|
|
1610
|
+
<ComboboxTrigger>Select option</ComboboxTrigger>
|
|
1611
|
+
<ComboboxContent>
|
|
1612
|
+
<ComboboxItem value="1">Option 1</ComboboxItem>
|
|
1613
|
+
<ComboboxItem value="2">Option 2</ComboboxItem>
|
|
1614
|
+
</ComboboxContent>
|
|
1615
|
+
</Combobox>
|
|
1616
|
+
|
|
1617
|
+
// asChild - Custom trigger button
|
|
1618
|
+
<Combobox>
|
|
1619
|
+
<ComboboxTrigger asChild>
|
|
1620
|
+
<Button variant="outline">Choose framework</Button>
|
|
1621
|
+
</ComboboxTrigger>
|
|
1622
|
+
<ComboboxContent>
|
|
1623
|
+
<ComboboxItem value="react">React</ComboboxItem>
|
|
1624
|
+
<ComboboxItem value="vue">Vue</ComboboxItem>
|
|
1625
|
+
<ComboboxItem value="angular">Angular</ComboboxItem>
|
|
1626
|
+
</ComboboxContent>
|
|
1627
|
+
</Combobox>
|
|
831
1628
|
```
|
|
832
1629
|
|
|
833
1630
|
### Radio
|
|
@@ -1316,8 +2113,8 @@ import { Sparkles } from "lucide-react";
|
|
|
1316
2113
|
|
|
1317
2114
|
Container component that groups multiple buttons together with seamless styling.
|
|
1318
2115
|
|
|
1319
|
-
**Variants:** `default` `outline` `ghost` `glass`
|
|
1320
|
-
**Sizes:** `sm` `md` `lg` `xl`
|
|
2116
|
+
**Variants:** `default` `outline` `ghost` `glass`
|
|
2117
|
+
**Sizes:** `sm` `md` `lg` `xl`
|
|
1321
2118
|
**Orientation:** `horizontal` `vertical`
|
|
1322
2119
|
|
|
1323
2120
|
```tsx
|
|
@@ -1414,8 +2211,8 @@ import { ButtonGroup, Button } from "saha-ui";
|
|
|
1414
2211
|
|
|
1415
2212
|
Navigation component showing the current page's location within a hierarchy with 5 modern variants.
|
|
1416
2213
|
|
|
1417
|
-
**Variants:** `default` `ghost` `bordered` `pills` `underline`
|
|
1418
|
-
**Sizes:** `sm` `md` `lg`
|
|
2214
|
+
**Variants:** `default` `ghost` `bordered` `pills` `underline`
|
|
2215
|
+
**Sizes:** `sm` `md` `lg`
|
|
1419
2216
|
**Separators:** `chevron` `slash` `dot` `arrow` `custom`
|
|
1420
2217
|
|
|
1421
2218
|
```tsx
|
|
@@ -1589,7 +2386,7 @@ const customItemClass = breadcrumbItemVariants({
|
|
|
1589
2386
|
|
|
1590
2387
|
Display important messages with inline icons and auto-link detection.
|
|
1591
2388
|
|
|
1592
|
-
**Variants:** `solid` `subtle` `left-accent` `top-accent` `outline`
|
|
2389
|
+
**Variants:** `solid` `subtle` `left-accent` `top-accent` `outline`
|
|
1593
2390
|
**Status:** `info` `success` `warning` `danger`
|
|
1594
2391
|
|
|
1595
2392
|
```tsx
|
|
@@ -1618,8 +2415,8 @@ import { Alert } from "saha-ui";
|
|
|
1618
2415
|
|
|
1619
2416
|
Small status indicators and labels with rich visual variants.
|
|
1620
2417
|
|
|
1621
|
-
**Variants:** `default` `primary` `secondary` `success` `warning` `error` `info` `outline` `glass`
|
|
1622
|
-
**Sizes:** `sm` `md` `lg`
|
|
2418
|
+
**Variants:** `default` `primary` `secondary` `success` `warning` `error` `info` `outline` `glass`
|
|
2419
|
+
**Sizes:** `sm` `md` `lg`
|
|
1623
2420
|
**Shapes:** `rounded` `pill` `square`
|
|
1624
2421
|
|
|
1625
2422
|
```tsx
|
|
@@ -1703,8 +2500,8 @@ import { Badge } from "saha-ui";
|
|
|
1703
2500
|
|
|
1704
2501
|
Versatile container component with sub-components for structured layouts.
|
|
1705
2502
|
|
|
1706
|
-
**Variants:** `default` `glass` `glass-strong` `glass-subtle` `bordered`
|
|
1707
|
-
**Padding:** `none` `sm` `md` `lg` `xl`
|
|
2503
|
+
**Variants:** `default` `glass` `glass-strong` `glass-subtle` `bordered`
|
|
2504
|
+
**Padding:** `none` `sm` `md` `lg` `xl`
|
|
1708
2505
|
**Rounded:** `sm` `md` `lg` `xl` `2xl`
|
|
1709
2506
|
|
|
1710
2507
|
```tsx
|
|
@@ -1755,8 +2552,8 @@ const customClass = cardVariants({ variant: 'glass-strong', padding: 'xl', round
|
|
|
1755
2552
|
|
|
1756
2553
|
Interactive tag component with multiple variants, deletable functionality, and icon/avatar support.
|
|
1757
2554
|
|
|
1758
|
-
**Variants:** `filled` `outlined` `soft` `gradient` `glass`
|
|
1759
|
-
**Colors:** `default` `primary` `secondary` `success` `warning` `error` `info`
|
|
2555
|
+
**Variants:** `filled` `outlined` `soft` `gradient` `glass`
|
|
2556
|
+
**Colors:** `default` `primary` `secondary` `success` `warning` `error` `info`
|
|
1760
2557
|
**Sizes:** `sm` `md` `lg`
|
|
1761
2558
|
|
|
1762
2559
|
```tsx
|
|
@@ -1958,9 +2755,9 @@ const customChipClass = chipVariants({
|
|
|
1958
2755
|
|
|
1959
2756
|
Content separator component with 5 modern variants, optional labels, and decorative elements.
|
|
1960
2757
|
|
|
1961
|
-
**Variants:** `solid` `dashed` `dotted` `gradient` `glass`
|
|
1962
|
-
**Orientation:** `horizontal` `vertical`
|
|
1963
|
-
**Thickness:** `thin` `medium` `thick`
|
|
2758
|
+
**Variants:** `solid` `dashed` `dotted` `gradient` `glass`
|
|
2759
|
+
**Orientation:** `horizontal` `vertical`
|
|
2760
|
+
**Thickness:** `thin` `medium` `thick`
|
|
1964
2761
|
**Spacing:** `none` `xs` `sm` `md` `lg` `xl`
|
|
1965
2762
|
|
|
1966
2763
|
```tsx
|
|
@@ -2127,7 +2924,7 @@ const customLabelClass = SeparatorLabelVariants({
|
|
|
2127
2924
|
|
|
2128
2925
|
Collapsible content sections with smooth animations and multiple behavior modes.
|
|
2129
2926
|
|
|
2130
|
-
**Variants:** `default` `bordered` `flush` `glass`
|
|
2927
|
+
**Variants:** `default` `bordered` `flush` `glass`
|
|
2131
2928
|
**Sizes:** `sm` `md` `lg`
|
|
2132
2929
|
|
|
2133
2930
|
```tsx
|
|
@@ -2159,8 +2956,8 @@ import { Accordion } from "saha-ui";
|
|
|
2159
2956
|
|
|
2160
2957
|
Profile images with status indicators and smart fallbacks.
|
|
2161
2958
|
|
|
2162
|
-
**Sizes:** `xs` `sm` `md` `lg` `xl` `2xl`
|
|
2163
|
-
**Shapes:** `circle` `square` `rounded`
|
|
2959
|
+
**Sizes:** `xs` `sm` `md` `lg` `xl` `2xl`
|
|
2960
|
+
**Shapes:** `circle` `square` `rounded`
|
|
2164
2961
|
**Status:** `online` `offline` `away` `busy` `none`
|
|
2165
2962
|
|
|
2166
2963
|
```tsx
|
|
@@ -2192,7 +2989,7 @@ import { Avatar } from "saha-ui";
|
|
|
2192
2989
|
|
|
2193
2990
|
Display multiple avatars with overlap and count indicator.
|
|
2194
2991
|
|
|
2195
|
-
**Variants:** `stack` `row` `grid` `grid-dense`
|
|
2992
|
+
**Variants:** `stack` `row` `grid` `grid-dense`
|
|
2196
2993
|
**Sizes:** `xs` `sm` `md` `lg` `xl` `2xl`
|
|
2197
2994
|
|
|
2198
2995
|
```tsx
|
|
@@ -2227,9 +3024,9 @@ import { AvatarGroup, Avatar } from "saha-ui";
|
|
|
2227
3024
|
|
|
2228
3025
|
Contextual hints and information with smart positioning, multiple trigger types, and interactive capabilities.
|
|
2229
3026
|
|
|
2230
|
-
**Variants:** `default` `dark` `light` `glass` `primary` `success` `warning` `error` `info`
|
|
2231
|
-
**Positions:** `top` `bottom` `left` `right`
|
|
2232
|
-
**Sizes:** `sm` `md` `lg`
|
|
3027
|
+
**Variants:** `default` `dark` `light` `glass` `primary` `success` `warning` `error` `info`
|
|
3028
|
+
**Positions:** `top` `bottom` `left` `right`
|
|
3029
|
+
**Sizes:** `sm` `md` `lg`
|
|
2233
3030
|
**Triggers:** `hover` `click` `focus` `manual`
|
|
2234
3031
|
|
|
2235
3032
|
```tsx
|
|
@@ -2456,7 +3253,7 @@ const customArrowClass = arrowVariants({
|
|
|
2456
3253
|
|
|
2457
3254
|
Smart, versatile links with automatic external detection and multiple visual variants.
|
|
2458
3255
|
|
|
2459
|
-
**Variants:** `default` `primary` `secondary` `accent` `muted` `underline` `ghost` `button` `glass`
|
|
3256
|
+
**Variants:** `default` `primary` `secondary` `accent` `muted` `underline` `ghost` `button` `glass`
|
|
2460
3257
|
**Sizes:** `sm` `md` `lg`
|
|
2461
3258
|
|
|
2462
3259
|
```tsx
|
|
@@ -2553,8 +3350,8 @@ import { Star } from "lucide-react";
|
|
|
2553
3350
|
|
|
2554
3351
|
Versatile lists with 5 modern variants, icon support, and enhanced animations powered by CVA (Class Variance Authority).
|
|
2555
3352
|
|
|
2556
|
-
**Types:** `disc` `circle` `square` `decimal` `decimal-leading-zero` `lower-roman` `upper-roman` `lower-alpha` `upper-alpha` `none`
|
|
2557
|
-
**Variants:** `default` `bordered` `divided` `striped` `cards`
|
|
3353
|
+
**Types:** `disc` `circle` `square` `decimal` `decimal-leading-zero` `lower-roman` `upper-roman` `lower-alpha` `upper-alpha` `none`
|
|
3354
|
+
**Variants:** `default` `bordered` `divided` `striped` `cards`
|
|
2558
3355
|
**Sizes:** `sm` `md` `lg`
|
|
2559
3356
|
|
|
2560
3357
|
```tsx
|
|
@@ -2724,9 +3521,9 @@ const customItemClass = listItemVariants({
|
|
|
2724
3521
|
|
|
2725
3522
|
Chronological event display with 4 modern variants, flexible positioning, status indicators, and icon support powered by CVA.
|
|
2726
3523
|
|
|
2727
|
-
**Variants:** `default` `outlined` `gradient` `minimal`
|
|
2728
|
-
**Positions:** `left` `right` `alternate`
|
|
2729
|
-
**Sizes:** `sm` `md` `lg`
|
|
3524
|
+
**Variants:** `default` `outlined` `gradient` `minimal`
|
|
3525
|
+
**Positions:** `left` `right` `alternate`
|
|
3526
|
+
**Sizes:** `sm` `md` `lg`
|
|
2730
3527
|
**Status:** `default` `primary` `success` `warning` `error` `info`
|
|
2731
3528
|
|
|
2732
3529
|
```tsx
|
|
@@ -3022,7 +3819,7 @@ const customDotClass = timelineDotVariants({
|
|
|
3022
3819
|
|
|
3023
3820
|
Hierarchical data visualization with expand/collapse functionality.
|
|
3024
3821
|
|
|
3025
|
-
**Variants:** `default` `glass` `bordered` `minimal`
|
|
3822
|
+
**Variants:** `default` `glass` `bordered` `minimal`
|
|
3026
3823
|
**Sizes:** `sm` `md` `lg`
|
|
3027
3824
|
|
|
3028
3825
|
```tsx
|
|
@@ -3229,8 +4026,8 @@ const customNodeClass = treeNodeVariants({
|
|
|
3229
4026
|
|
|
3230
4027
|
Advanced image component with loading states and effects.
|
|
3231
4028
|
|
|
3232
|
-
**Variants:** `default` `rounded` `circular` `bordered` `glass`
|
|
3233
|
-
**Fit:** `cover` `contain` `fill` `none` `scale-down`
|
|
4029
|
+
**Variants:** `default` `rounded` `circular` `bordered` `glass`
|
|
4030
|
+
**Fit:** `cover` `contain` `fill` `none` `scale-down`
|
|
3234
4031
|
**Sizes:** `xs` `sm` `md` `lg` `xl` `2xl` `full`
|
|
3235
4032
|
|
|
3236
4033
|
```tsx
|
|
@@ -3264,8 +4061,8 @@ import { Image } from "saha-ui";
|
|
|
3264
4061
|
|
|
3265
4062
|
Feature-rich image slider with multiple transition effects.
|
|
3266
4063
|
|
|
3267
|
-
**Variants:** `default` `contained` `bordered` `glass`
|
|
3268
|
-
**Effects:** `slide` `fade` `cube` `flip`
|
|
4064
|
+
**Variants:** `default` `contained` `bordered` `glass`
|
|
4065
|
+
**Effects:** `slide` `fade` `cube` `flip`
|
|
3269
4066
|
**Direction:** `forward` `backward`
|
|
3270
4067
|
|
|
3271
4068
|
```tsx
|
|
@@ -3315,9 +4112,9 @@ import { Carousel } from "saha-ui";
|
|
|
3315
4112
|
|
|
3316
4113
|
Progress indicator for multi-step processes and wizards.
|
|
3317
4114
|
|
|
3318
|
-
**Variants:** `default` `bordered` `glass` `minimal`
|
|
3319
|
-
**Orientation:** `horizontal` `vertical`
|
|
3320
|
-
**Sizes:** `sm` `md` `lg`
|
|
4115
|
+
**Variants:** `default` `bordered` `glass` `minimal`
|
|
4116
|
+
**Orientation:** `horizontal` `vertical`
|
|
4117
|
+
**Sizes:** `sm` `md` `lg`
|
|
3321
4118
|
**Status:** `completed` `current` `pending` `error`
|
|
3322
4119
|
|
|
3323
4120
|
```tsx
|
|
@@ -3401,8 +4198,8 @@ import { User, CreditCard, Check } from "lucide-react";
|
|
|
3401
4198
|
|
|
3402
4199
|
Data table component with sorting, selection, and responsive design.
|
|
3403
4200
|
|
|
3404
|
-
**Variants:** `default` `bordered` `striped` `glass` `minimal`
|
|
3405
|
-
**Sizes:** `sm` `md` `lg`
|
|
4201
|
+
**Variants:** `default` `bordered` `striped` `glass` `minimal`
|
|
4202
|
+
**Sizes:** `sm` `md` `lg`
|
|
3406
4203
|
**Density:** `compact` `normal` `comfortable`
|
|
3407
4204
|
|
|
3408
4205
|
```tsx
|
|
@@ -3555,9 +4352,9 @@ const data = [
|
|
|
3555
4352
|
|
|
3556
4353
|
Interactive star rating component with multiple icons and variants.
|
|
3557
4354
|
|
|
3558
|
-
**Variants:** `default` `primary` `secondary` `gradient` `glass` `outline`
|
|
3559
|
-
**Sizes:** `sm` `md` `lg` `xl`
|
|
3560
|
-
**Icons:** `star` `heart` `circle` `diamond`
|
|
4355
|
+
**Variants:** `default` `primary` `secondary` `gradient` `glass` `outline`
|
|
4356
|
+
**Sizes:** `sm` `md` `lg` `xl`
|
|
4357
|
+
**Icons:** `star` `heart` `circle` `diamond`
|
|
3561
4358
|
**Precision:** `full` `half`
|
|
3562
4359
|
|
|
3563
4360
|
```tsx
|
|
@@ -3827,8 +4624,8 @@ import { Popover, Button } from "saha-ui";
|
|
|
3827
4624
|
</Popover>
|
|
3828
4625
|
```
|
|
3829
4626
|
|
|
3830
|
-
**Variants:** `default` `primary` `secondary` `success` `warning` `danger` `info` `glass` `bordered` `elevated` `flat`
|
|
3831
|
-
**Positions:** 12 options including `top`, `bottom`, `left`, `right` (with -start and -end variations)
|
|
4627
|
+
**Variants:** `default` `primary` `secondary` `success` `warning` `danger` `info` `glass` `bordered` `elevated` `flat`
|
|
4628
|
+
**Positions:** 12 options including `top`, `bottom`, `left`, `right` (with -start and -end variations)
|
|
3832
4629
|
**Sizes:** `sm` `md` `lg` `xl`
|
|
3833
4630
|
|
|
3834
4631
|
**Features:**
|
|
@@ -3883,7 +4680,7 @@ const [playing, setPlaying] = useState(false);
|
|
|
3883
4680
|
</div>
|
|
3884
4681
|
```
|
|
3885
4682
|
|
|
3886
|
-
**Variants:** `default` `primary` `secondary` `accent` `info` `success` `warning` `error` `glass`
|
|
4683
|
+
**Variants:** `default` `primary` `secondary` `accent` `info` `success` `warning` `error` `glass`
|
|
3887
4684
|
**Sizes:** `sm` `md` `lg` `xl`
|
|
3888
4685
|
|
|
3889
4686
|
**Features:**
|
|
@@ -4361,8 +5158,8 @@ import { Skeleton } from "saha-ui";
|
|
|
4361
5158
|
))}
|
|
4362
5159
|
```
|
|
4363
5160
|
|
|
4364
|
-
**Variants:** `default` `pulse` `wave` `shimmer` `gradient`
|
|
4365
|
-
**Shapes:** `rectangle` `circle` `rounded` `text`
|
|
5161
|
+
**Variants:** `default` `pulse` `wave` `shimmer` `gradient`
|
|
5162
|
+
**Shapes:** `rectangle` `circle` `rounded` `text`
|
|
4366
5163
|
**Speeds:** `slow` `normal` `fast`
|
|
4367
5164
|
|
|
4368
5165
|
**Features:**
|
|
@@ -4606,11 +5403,11 @@ import { Spinner } from "saha-ui";
|
|
|
4606
5403
|
}
|
|
4607
5404
|
```
|
|
4608
5405
|
|
|
4609
|
-
**Variants:** `default` `primary` `secondary` `accent` `info` `success` `warning` `error` `glass` `gradient`
|
|
4610
|
-
**Sizes:** `xs` `sm` `md` `lg` `xl` `2xl`
|
|
4611
|
-
**Types:** `ring` `dots` `dashed` `bars` `dotRing` `orbit` `pulse` `square` `triangle` `wave` `spiral` `infinity` `flower` `grid` `bounce`
|
|
4612
|
-
**Animations:** `spin` `pulse` `bounce` `ping`
|
|
4613
|
-
**Thickness:** `thin` `default` `thick`
|
|
5406
|
+
**Variants:** `default` `primary` `secondary` `accent` `info` `success` `warning` `error` `glass` `gradient`
|
|
5407
|
+
**Sizes:** `xs` `sm` `md` `lg` `xl` `2xl`
|
|
5408
|
+
**Types:** `ring` `dots` `dashed` `bars` `dotRing` `orbit` `pulse` `square` `triangle` `wave` `spiral` `infinity` `flower` `grid` `bounce`
|
|
5409
|
+
**Animations:** `spin` `pulse` `bounce` `ping`
|
|
5410
|
+
**Thickness:** `thin` `default` `thick`
|
|
4614
5411
|
**Logo Sizes:** `xs` `sm` `md` `lg` `xl`
|
|
4615
5412
|
|
|
4616
5413
|
**Features:**
|
|
@@ -4782,8 +5579,8 @@ function DataTable() {
|
|
|
4782
5579
|
}
|
|
4783
5580
|
```
|
|
4784
5581
|
|
|
4785
|
-
**Variants:** `default` `primary` `secondary` `outlined` `minimal`
|
|
4786
|
-
**Sizes:** `sm` `md` `lg`
|
|
5582
|
+
**Variants:** `default` `primary` `secondary` `outlined` `minimal`
|
|
5583
|
+
**Sizes:** `sm` `md` `lg`
|
|
4787
5584
|
**Shapes:** `rounded` `square` `pill`
|
|
4788
5585
|
|
|
4789
5586
|
**Features:**
|
|
@@ -4953,8 +5750,8 @@ import { DatePicker } from "saha-ui";
|
|
|
4953
5750
|
/>
|
|
4954
5751
|
```
|
|
4955
5752
|
|
|
4956
|
-
**Variants:** `default` `primary` `secondary` `outlined` `minimal`
|
|
4957
|
-
**Sizes:** `sm` `md` `lg`
|
|
5753
|
+
**Variants:** `default` `primary` `secondary` `outlined` `minimal`
|
|
5754
|
+
**Sizes:** `sm` `md` `lg`
|
|
4958
5755
|
**Formats:** Customizable (MM/DD/YYYY, DD/MM/YYYY, etc.)
|
|
4959
5756
|
|
|
4960
5757
|
**Features:**
|
|
@@ -5059,7 +5856,7 @@ const tabs: TabItem[] = [
|
|
|
5059
5856
|
</div>
|
|
5060
5857
|
```
|
|
5061
5858
|
|
|
5062
|
-
**Variants:** `default` `primary` `secondary` `accent` `success` `warning` `danger` `info` `glass` `bordered` `elevated` `flat` `outlined` `minimal`
|
|
5859
|
+
**Variants:** `default` `primary` `secondary` `accent` `success` `warning` `danger` `info` `glass` `bordered` `elevated` `flat` `outlined` `minimal`
|
|
5063
5860
|
**Sizes:** `sm` `md` `lg`
|
|
5064
5861
|
|
|
5065
5862
|
**Props:**
|
|
@@ -5300,8 +6097,8 @@ import { Mail, Lock, Search, User } from "lucide-react";
|
|
|
5300
6097
|
</div>
|
|
5301
6098
|
```
|
|
5302
6099
|
|
|
5303
|
-
**Variants:** `primary` `secondary` `accent` `info` `success` `warning` `error` `outline` `ghost` `glass`
|
|
5304
|
-
**Sizes:** `sm` `md` `lg` `xl`
|
|
6100
|
+
**Variants:** `primary` `secondary` `accent` `info` `success` `warning` `error` `outline` `ghost` `glass`
|
|
6101
|
+
**Sizes:** `sm` `md` `lg` `xl`
|
|
5305
6102
|
**Input Types:** All HTML input types except `file`
|
|
5306
6103
|
|
|
5307
6104
|
**Props:**
|
|
@@ -5562,6 +6359,116 @@ Saha UI is optimized for minimal bundle impact:
|
|
|
5562
6359
|
- [NPM Package Summary](./NPM_PACKAGE_SUMMARY.md) - Package details
|
|
5563
6360
|
- [Type Safety Guide](./TYPE_SAFETY_GUIDE.md) - TypeScript best practices
|
|
5564
6361
|
- [Component Modernization](./ULTRA_MODERN_SUMMARY.md) - Architecture details
|
|
6362
|
+
- **[🤖 MCP Server](./docs/MCP_SERVER.md)** - AI Assistant Integration (Built-in!)
|
|
6363
|
+
|
|
6364
|
+
---
|
|
6365
|
+
|
|
6366
|
+
## 🤖 MCP Server - AI-Powered Development (v2.0 - Dynamic & Context-Aware)
|
|
6367
|
+
|
|
6368
|
+
Saha UI includes a **built-in Model Context Protocol (MCP) server** that provides AI assistants with intelligent, human-like access to the component library.
|
|
6369
|
+
|
|
6370
|
+
### 🧠 Intelligence Features
|
|
6371
|
+
|
|
6372
|
+
- 🎯 **Context Awareness**: Remembers your session and adapts responses based on what you've viewed
|
|
6373
|
+
- 💡 **Intent Detection**: Automatically understands if you need tutorials, examples, styling help, or troubleshooting
|
|
6374
|
+
- 🔍 **Fuzzy Matching**: Handles typos gracefully - "Buton" → Button, "inpt" → Input
|
|
6375
|
+
- 🤝 **Smart Suggestions**: Proactive recommendations for related components, hooks, and next steps
|
|
6376
|
+
- 📊 **Progressive Disclosure**: Shows summaries first, details on request - no information overload
|
|
6377
|
+
- 🗣️ **Natural Language**: Ask questions naturally - "How do I customize colors?" works perfectly
|
|
6378
|
+
|
|
6379
|
+
### Core Features
|
|
6380
|
+
|
|
6381
|
+
- 📦 **73 Components**: Complete source code, types, variants, and styles
|
|
6382
|
+
- 🪝 **40+ Hooks**: Full implementation with usage examples and best practices
|
|
6383
|
+
- 🎨 **Theme System**: OKLCH colors, Tailwind config, CSS variables
|
|
6384
|
+
- 🔎 **Smart Search**: Context-aware code search with intelligent filtering
|
|
6385
|
+
- 💬 **Conversational**: Ask questions naturally, get personalized answers
|
|
6386
|
+
- ⚡ **Recommendations**: Get component suggestions based on your project type
|
|
6387
|
+
|
|
6388
|
+
### Quick Setup
|
|
6389
|
+
|
|
6390
|
+
The MCP server is included with Saha UI - no separate installation needed!
|
|
6391
|
+
|
|
6392
|
+
```bash
|
|
6393
|
+
# Install Saha UI
|
|
6394
|
+
# npm
|
|
6395
|
+
npm install saha-ui
|
|
6396
|
+
npx saha-ui@latest init
|
|
6397
|
+
|
|
6398
|
+
# yarn
|
|
6399
|
+
yarn add saha-ui
|
|
6400
|
+
yarn dlx saha-ui@latest init
|
|
6401
|
+
|
|
6402
|
+
# pnpm
|
|
6403
|
+
pnpm add saha-ui
|
|
6404
|
+
pnpm dlx saha-ui@latest init
|
|
6405
|
+
|
|
6406
|
+
# Configure your AI client (e.g., Claude Desktop)
|
|
6407
|
+
# Add to claude_desktop_config.json:
|
|
6408
|
+
```
|
|
6409
|
+
|
|
6410
|
+
```json
|
|
6411
|
+
{
|
|
6412
|
+
"mcpServers": {
|
|
6413
|
+
"saha-ui": {
|
|
6414
|
+
"command": "npx",
|
|
6415
|
+
"args": ["saha-ui-mcp"]
|
|
6416
|
+
}
|
|
6417
|
+
}
|
|
6418
|
+
}
|
|
6419
|
+
```
|
|
6420
|
+
|
|
6421
|
+
That's it! The MCP server runs directly from your `node_modules`.
|
|
6422
|
+
|
|
6423
|
+
### Example Interactions
|
|
6424
|
+
|
|
6425
|
+
The MCP server understands natural language and adapts to your needs:
|
|
6426
|
+
|
|
6427
|
+
**Beginner-Friendly:**
|
|
6428
|
+
> "How do I get started with Saha UI?"
|
|
6429
|
+
>
|
|
6430
|
+
> "Show me simple form components"
|
|
6431
|
+
>
|
|
6432
|
+
> "What's the easiest way to add a button?"
|
|
6433
|
+
|
|
6434
|
+
**Discovery & Exploration:**
|
|
6435
|
+
> "What components work well for a dashboard?"
|
|
6436
|
+
>
|
|
6437
|
+
> "Show me components similar to Card"
|
|
6438
|
+
>
|
|
6439
|
+
> "Find components with glass morphism"
|
|
6440
|
+
|
|
6441
|
+
**Advanced Usage:**
|
|
6442
|
+
> "Customize Button theme colors using OKLCH"
|
|
6443
|
+
>
|
|
6444
|
+
> "Integrate DataTable with Next.js 15 App Router"
|
|
6445
|
+
>
|
|
6446
|
+
> "Search for all components using CVA variants"
|
|
6447
|
+
|
|
6448
|
+
**The server handles typos too:** "Show me the Botton component" → Automatically suggests Button ✓
|
|
6449
|
+
|
|
6450
|
+
### Smart Features in Action
|
|
6451
|
+
|
|
6452
|
+
```typescript
|
|
6453
|
+
// Fuzzy matching - typos are okay!
|
|
6454
|
+
"Buton" → Button ✓
|
|
6455
|
+
"inpt" → Input ✓
|
|
6456
|
+
"useDebonc" → useDebounce ✓
|
|
6457
|
+
|
|
6458
|
+
// Context awareness - remembers what you've viewed
|
|
6459
|
+
// Viewing Input → Suggests useDebounce hook
|
|
6460
|
+
// Viewing Card → Suggests related components
|
|
6461
|
+
|
|
6462
|
+
// Intent detection - understands what you need
|
|
6463
|
+
"How to style..." → Styling mode (variants, theme)
|
|
6464
|
+
"Show example..." → Example mode (code samples)
|
|
6465
|
+
"Fix error..." → Troubleshooting mode (solutions)
|
|
6466
|
+
```
|
|
6467
|
+
|
|
6468
|
+
📚 **Documentation:**
|
|
6469
|
+
- **[Full MCP Server Guide](./docs/MCP_SERVER.md)** - Complete documentation
|
|
6470
|
+
- **[Dynamic Features](./docs/MCP_DYNAMIC_FEATURES.md)** - Smart features quick reference
|
|
6471
|
+
- **[Quick Reference](./docs/MCP_QUICK_REFERENCE.md)** - Tool & command reference
|
|
5565
6472
|
|
|
5566
6473
|
---
|
|
5567
6474
|
|