create-tauri-ui 0.3.1 → 0.3.2

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.
Files changed (196) hide show
  1. package/package.json +55 -55
  2. package/templates/.shared/src-tauri/Cargo.lock +15 -12
  3. package/templates/next/package.json +3 -3
  4. package/templates/next/pnpm-lock.yaml +19 -19
  5. package/templates/next/src/components/menu.tsx +3 -2
  6. package/templates/next/src-tauri/Cargo.lock +3835 -3832
  7. package/templates/sveltekit/package.json +4 -4
  8. package/templates/sveltekit/pnpm-lock.yaml +95 -72
  9. package/templates/sveltekit/src/lib/components/docs/dashboard/DashboardPage.svelte +1 -17
  10. package/templates/sveltekit/src/lib/components/docs/index.ts +1 -18
  11. package/templates/sveltekit/src/routes/+layout.svelte +13 -65
  12. package/templates/sveltekit/src/routes/authentication/+page.svelte +2 -18
  13. package/templates/sveltekit/src/routes/cards/+page.svelte +1 -19
  14. package/templates/sveltekit/src-tauri/Cargo.lock +21 -18
  15. package/templates/sveltekit/src-tauri/tauri.conf.json +3 -3
  16. package/templates/sveltekit/tailwind.config.js +4 -1
  17. package/templates/sveltekit/vite.config.js +5 -3
  18. package/templates/vite/package.json +3 -3
  19. package/templates/vite/pnpm-lock.yaml +417 -419
  20. package/templates/vite/src-tauri/Cargo.lock +21 -18
  21. package/templates/sveltekit/src/content/cli.md +0 -63
  22. package/templates/sveltekit/src/content/components/accordion.md +0 -59
  23. package/templates/sveltekit/src/content/components/alert-dialog.md +0 -75
  24. package/templates/sveltekit/src/content/components/alert.md +0 -67
  25. package/templates/sveltekit/src/content/components/aspect-ratio.md +0 -51
  26. package/templates/sveltekit/src/content/components/avatar.md +0 -52
  27. package/templates/sveltekit/src/content/components/badge.md +0 -104
  28. package/templates/sveltekit/src/content/components/button.md +0 -165
  29. package/templates/sveltekit/src/content/components/card.md +0 -82
  30. package/templates/sveltekit/src/content/components/checkbox.md +0 -71
  31. package/templates/sveltekit/src/content/components/collapsible.md +0 -55
  32. package/templates/sveltekit/src/content/components/dialog.md +0 -72
  33. package/templates/sveltekit/src/content/components/hover-card.md +0 -52
  34. package/templates/sveltekit/src/content/components/input.md +0 -114
  35. package/templates/sveltekit/src/content/components/label.md +0 -49
  36. package/templates/sveltekit/src/content/components/progress.md +0 -49
  37. package/templates/sveltekit/src/content/components/radio-group.md +0 -59
  38. package/templates/sveltekit/src/content/components/separator.md +0 -49
  39. package/templates/sveltekit/src/content/components/sheet.md +0 -95
  40. package/templates/sveltekit/src/content/components/skeleton.md +0 -42
  41. package/templates/sveltekit/src/content/components/slider.md +0 -49
  42. package/templates/sveltekit/src/content/components/switch.md +0 -49
  43. package/templates/sveltekit/src/content/components/table.md +0 -78
  44. package/templates/sveltekit/src/content/components/tabs.md +0 -56
  45. package/templates/sveltekit/src/content/components/textarea.md +0 -102
  46. package/templates/sveltekit/src/content/components/toggle.md +0 -121
  47. package/templates/sveltekit/src/content/components/tooltip.md +0 -56
  48. package/templates/sveltekit/src/content/figma.md +0 -22
  49. package/templates/sveltekit/src/content/forms/superforms.md +0 -4
  50. package/templates/sveltekit/src/content/index.md +0 -84
  51. package/templates/sveltekit/src/content/installation.md +0 -327
  52. package/templates/sveltekit/src/content/theming.md +0 -189
  53. package/templates/sveltekit/src/content/typography.md +0 -150
  54. package/templates/sveltekit/src/lib/components/docs/Callout.svelte +0 -17
  55. package/templates/sveltekit/src/lib/components/docs/CodeBlockWrapper.svelte +0 -30
  56. package/templates/sveltekit/src/lib/components/docs/ComponentExample.svelte +0 -55
  57. package/templates/sveltekit/src/lib/components/docs/ComponentSource.svelte +0 -14
  58. package/templates/sveltekit/src/lib/components/docs/CopyButton.svelte +0 -39
  59. package/templates/sveltekit/src/lib/components/docs/DocsPager.svelte +0 -51
  60. package/templates/sveltekit/src/lib/components/docs/HexToChannels.svelte +0 -38
  61. package/templates/sveltekit/src/lib/components/docs/ManualInstall.svelte +0 -17
  62. package/templates/sveltekit/src/lib/components/docs/Metadata.svelte +0 -34
  63. package/templates/sveltekit/src/lib/components/docs/SiteFooter.svelte +0 -42
  64. package/templates/sveltekit/src/lib/components/docs/SiteHeader.svelte +0 -51
  65. package/templates/sveltekit/src/lib/components/docs/Steps.svelte +0 -3
  66. package/templates/sveltekit/src/lib/components/docs/TableOfContents.svelte +0 -55
  67. package/templates/sveltekit/src/lib/components/docs/Tree.svelte +0 -31
  68. package/templates/sveltekit/src/lib/components/docs/examples/accordion/AccordionDemo.svelte +0 -27
  69. package/templates/sveltekit/src/lib/components/docs/examples/accordion/index.ts +0 -1
  70. package/templates/sveltekit/src/lib/components/docs/examples/alert/AlertDemo.svelte +0 -10
  71. package/templates/sveltekit/src/lib/components/docs/examples/alert/AlertDemoDestructive.svelte +0 -10
  72. package/templates/sveltekit/src/lib/components/docs/examples/alert/index.ts +0 -2
  73. package/templates/sveltekit/src/lib/components/docs/examples/alert-dialog/AlertDialogDemo.svelte +0 -33
  74. package/templates/sveltekit/src/lib/components/docs/examples/alert-dialog/index.ts +0 -1
  75. package/templates/sveltekit/src/lib/components/docs/examples/aspect-ratio/AspectRatioDemo.svelte +0 -11
  76. package/templates/sveltekit/src/lib/components/docs/examples/aspect-ratio/index.ts +0 -1
  77. package/templates/sveltekit/src/lib/components/docs/examples/avatar/AvatarDemo.svelte +0 -8
  78. package/templates/sveltekit/src/lib/components/docs/examples/avatar/index.ts +0 -1
  79. package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemo.svelte +0 -5
  80. package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoDestructive.svelte +0 -5
  81. package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoOutline.svelte +0 -5
  82. package/templates/sveltekit/src/lib/components/docs/examples/badge/BadgeDemoSecondary.svelte +0 -5
  83. package/templates/sveltekit/src/lib/components/docs/examples/badge/index.ts +0 -4
  84. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemo.svelte +0 -5
  85. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoDestructive.svelte +0 -5
  86. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoGhost.svelte +0 -5
  87. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoIcon.svelte +0 -9
  88. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoLink.svelte +0 -5
  89. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoLoading.svelte +0 -9
  90. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoOutline.svelte +0 -5
  91. package/templates/sveltekit/src/lib/components/docs/examples/button/ButtonDemoSecondary.svelte +0 -5
  92. package/templates/sveltekit/src/lib/components/docs/examples/button/index.ts +0 -8
  93. package/templates/sveltekit/src/lib/components/docs/examples/card/CardDemo.svelte +0 -65
  94. package/templates/sveltekit/src/lib/components/docs/examples/card/CardDemoForm.svelte +0 -0
  95. package/templates/sveltekit/src/lib/components/docs/examples/card/index.ts +0 -2
  96. package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemo.svelte +0 -13
  97. package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemoDisabled.svelte +0 -13
  98. package/templates/sveltekit/src/lib/components/docs/examples/checkbox/CheckboxDemoText.svelte +0 -18
  99. package/templates/sveltekit/src/lib/components/docs/examples/checkbox/index.ts +0 -3
  100. package/templates/sveltekit/src/lib/components/docs/examples/collapsible/CollapsibleDemo.svelte +0 -24
  101. package/templates/sveltekit/src/lib/components/docs/examples/collapsible/index.ts +0 -1
  102. package/templates/sveltekit/src/lib/components/docs/examples/dialog/DialogDemo.svelte +0 -41
  103. package/templates/sveltekit/src/lib/components/docs/examples/dialog/index.ts +0 -1
  104. package/templates/sveltekit/src/lib/components/docs/examples/hover-card/HoverCardDemo.svelte +0 -28
  105. package/templates/sveltekit/src/lib/components/docs/examples/hover-card/index.ts +0 -1
  106. package/templates/sveltekit/src/lib/components/docs/examples/index.ts +0 -27
  107. package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemo.svelte +0 -5
  108. package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoButton.svelte +0 -9
  109. package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoDisabled.svelte +0 -5
  110. package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoFile.svelte +0 -9
  111. package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoLabel.svelte +0 -9
  112. package/templates/sveltekit/src/lib/components/docs/examples/input/InputDemoText.svelte +0 -10
  113. package/templates/sveltekit/src/lib/components/docs/examples/input/index.ts +0 -6
  114. package/templates/sveltekit/src/lib/components/docs/examples/label/LabelDemo.svelte +0 -11
  115. package/templates/sveltekit/src/lib/components/docs/examples/label/index.ts +0 -1
  116. package/templates/sveltekit/src/lib/components/docs/examples/progress/ProgressDemo.svelte +0 -12
  117. package/templates/sveltekit/src/lib/components/docs/examples/progress/index.ts +0 -1
  118. package/templates/sveltekit/src/lib/components/docs/examples/radio-group/RadioGroupDemo.svelte +0 -19
  119. package/templates/sveltekit/src/lib/components/docs/examples/radio-group/index.ts +0 -1
  120. package/templates/sveltekit/src/lib/components/docs/examples/separator/SeparatorDemo.svelte +0 -18
  121. package/templates/sveltekit/src/lib/components/docs/examples/separator/index.ts +0 -1
  122. package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetDemo.svelte +0 -44
  123. package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetPositionDemo.svelte +0 -62
  124. package/templates/sveltekit/src/lib/components/docs/examples/sheet/SheetSizeDemo.svelte +0 -62
  125. package/templates/sveltekit/src/lib/components/docs/examples/sheet/index.ts +0 -3
  126. package/templates/sveltekit/src/lib/components/docs/examples/skeleton/SkeletonDemo.svelte +0 -11
  127. package/templates/sveltekit/src/lib/components/docs/examples/skeleton/index.ts +0 -1
  128. package/templates/sveltekit/src/lib/components/docs/examples/slider/SliderDemo.svelte +0 -5
  129. package/templates/sveltekit/src/lib/components/docs/examples/slider/index.ts +0 -1
  130. package/templates/sveltekit/src/lib/components/docs/examples/switch/SwitchDemo.svelte +0 -9
  131. package/templates/sveltekit/src/lib/components/docs/examples/switch/index.ts +0 -1
  132. package/templates/sveltekit/src/lib/components/docs/examples/table/TableDemo.svelte +0 -78
  133. package/templates/sveltekit/src/lib/components/docs/examples/table/index.ts +0 -1
  134. package/templates/sveltekit/src/lib/components/docs/examples/tabs/TabsDemo.svelte +0 -67
  135. package/templates/sveltekit/src/lib/components/docs/examples/tabs/index.ts +0 -1
  136. package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemo.svelte +0 -5
  137. package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoButton.svelte +0 -9
  138. package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoDisabled.svelte +0 -5
  139. package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoLabel.svelte +0 -9
  140. package/templates/sveltekit/src/lib/components/docs/examples/textarea/TextareaDemoText.svelte +0 -10
  141. package/templates/sveltekit/src/lib/components/docs/examples/textarea/index.ts +0 -5
  142. package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemo.svelte +0 -8
  143. package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoDisabled.svelte +0 -8
  144. package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoLg.svelte +0 -8
  145. package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoOutline.svelte +0 -8
  146. package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoSm.svelte +0 -8
  147. package/templates/sveltekit/src/lib/components/docs/examples/toggle/ToggleDemoText.svelte +0 -9
  148. package/templates/sveltekit/src/lib/components/docs/examples/toggle/index.ts +0 -6
  149. package/templates/sveltekit/src/lib/components/docs/examples/tooltip/TooltipDemo.svelte +0 -19
  150. package/templates/sveltekit/src/lib/components/docs/examples/tooltip/index.ts +0 -1
  151. package/templates/sveltekit/src/lib/components/docs/examples/typography/BlockquoteDemo.svelte +0 -4
  152. package/templates/sveltekit/src/lib/components/docs/examples/typography/H1Demo.svelte +0 -3
  153. package/templates/sveltekit/src/lib/components/docs/examples/typography/H2Demo.svelte +0 -5
  154. package/templates/sveltekit/src/lib/components/docs/examples/typography/H3Demo.svelte +0 -1
  155. package/templates/sveltekit/src/lib/components/docs/examples/typography/H4Demo.svelte +0 -1
  156. package/templates/sveltekit/src/lib/components/docs/examples/typography/InlineCodeDemo.svelte +0 -3
  157. package/templates/sveltekit/src/lib/components/docs/examples/typography/LargeDemo.svelte +0 -1
  158. package/templates/sveltekit/src/lib/components/docs/examples/typography/LeadDemo.svelte +0 -3
  159. package/templates/sveltekit/src/lib/components/docs/examples/typography/ListDemo.svelte +0 -5
  160. package/templates/sveltekit/src/lib/components/docs/examples/typography/MutedDemo.svelte +0 -1
  161. package/templates/sveltekit/src/lib/components/docs/examples/typography/PDemo.svelte +0 -4
  162. package/templates/sveltekit/src/lib/components/docs/examples/typography/SmallDemo.svelte +0 -1
  163. package/templates/sveltekit/src/lib/components/docs/examples/typography/TableDemo.svelte +0 -56
  164. package/templates/sveltekit/src/lib/components/docs/examples/typography/TypographyDemo.svelte +0 -117
  165. package/templates/sveltekit/src/lib/components/docs/examples/typography/index.ts +0 -14
  166. package/templates/sveltekit/src/lib/components/docs/mdsvex/a.svelte +0 -12
  167. package/templates/sveltekit/src/lib/components/docs/mdsvex/blockquote.svelte +0 -10
  168. package/templates/sveltekit/src/lib/components/docs/mdsvex/h1.svelte +0 -10
  169. package/templates/sveltekit/src/lib/components/docs/mdsvex/h2.svelte +0 -16
  170. package/templates/sveltekit/src/lib/components/docs/mdsvex/h3.svelte +0 -10
  171. package/templates/sveltekit/src/lib/components/docs/mdsvex/h4.svelte +0 -10
  172. package/templates/sveltekit/src/lib/components/docs/mdsvex/h5.svelte +0 -10
  173. package/templates/sveltekit/src/lib/components/docs/mdsvex/h6.svelte +0 -13
  174. package/templates/sveltekit/src/lib/components/docs/mdsvex/hr.svelte +0 -8
  175. package/templates/sveltekit/src/lib/components/docs/mdsvex/img.svelte +0 -11
  176. package/templates/sveltekit/src/lib/components/docs/mdsvex/index.ts +0 -19
  177. package/templates/sveltekit/src/lib/components/docs/mdsvex/li.svelte +0 -10
  178. package/templates/sveltekit/src/lib/components/docs/mdsvex/mdsvex.svelte +0 -37
  179. package/templates/sveltekit/src/lib/components/docs/mdsvex/ol.svelte +0 -10
  180. package/templates/sveltekit/src/lib/components/docs/mdsvex/p.svelte +0 -10
  181. package/templates/sveltekit/src/lib/components/docs/mdsvex/pre.svelte +0 -24
  182. package/templates/sveltekit/src/lib/components/docs/mdsvex/table.svelte +0 -12
  183. package/templates/sveltekit/src/lib/components/docs/mdsvex/td.svelte +0 -16
  184. package/templates/sveltekit/src/lib/components/docs/mdsvex/th.svelte +0 -16
  185. package/templates/sveltekit/src/lib/components/docs/mdsvex/tr.svelte +0 -10
  186. package/templates/sveltekit/src/lib/components/docs/mdsvex/ul.svelte +0 -10
  187. package/templates/sveltekit/src/lib/components/docs/nav/DocsSidebarNav.svelte +0 -24
  188. package/templates/sveltekit/src/lib/components/docs/nav/DocsSidebarNavItems.svelte +0 -43
  189. package/templates/sveltekit/src/lib/components/docs/nav/MainNav.svelte +0 -31
  190. package/templates/sveltekit/src/lib/components/docs/nav/MobileLink.svelte +0 -19
  191. package/templates/sveltekit/src/lib/components/docs/nav/MobileNav.svelte +0 -56
  192. package/templates/sveltekit/src/lib/components/docs/nav/index.ts +0 -4
  193. package/templates/sveltekit/src/lib/components/docs/page-header/PageHeader.svelte +0 -13
  194. package/templates/sveltekit/src/lib/components/docs/page-header/PageHeaderDescription.svelte +0 -13
  195. package/templates/sveltekit/src/lib/components/docs/page-header/PageHeaderHeading.svelte +0 -16
  196. package/templates/sveltekit/src/lib/components/docs/page-header/index.ts +0 -3
@@ -1,56 +0,0 @@
1
- ---
2
- title: Tooltip
3
- description: A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
4
- component: true
5
- source: https://github.com/huntabyte/shadcn-svelte/tree/main/apps/www/src/lib/components/ui/tooltip
6
- radix: https://www.radix-svelte.com/docs/tooltip
7
- ---
8
-
9
- <script>
10
- import { TooltipDemo, ComponentExample, ManualInstall } from '$lib/components/docs';
11
- </script>
12
-
13
- <ComponentExample src="src/lib/components/docs/examples/tooltip/TooltipDemo.svelte">
14
-
15
- <div slot="example">
16
- <TooltipDemo />
17
- </div>
18
-
19
- </ComponentExample>
20
-
21
- ## Installation
22
-
23
- ```bash
24
- npx shadcn-svelte add tooltip
25
- ```
26
-
27
- <ManualInstall>
28
-
29
- 1. Install `radix-svelte`:
30
-
31
- ```bash
32
- npm install radix-svelte
33
- ```
34
-
35
- 2. Copy and paste the component source files linked at the top of this page into your project.
36
-
37
- </ManualInstall>
38
-
39
- ## Usage
40
-
41
- ```svelte
42
- <script lang="ts">
43
- import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '$components/ui/tooltip';
44
- </script>
45
- ```
46
-
47
- ```svelte
48
- <TooltipProvider>
49
- <Tooltip>
50
- <TooltipTrigger>Hover</TooltipTrigger>
51
- <TooltipContent>
52
- <p>Add to library</p>
53
- </TooltipContent>
54
- </Tooltip>
55
- </TooltipProvider>
56
- ```
@@ -1,22 +0,0 @@
1
- ---
2
- title: Figma
3
- description: Every component recreated in Figma. With customizable props, typography and icons.
4
- ---
5
-
6
- <script>
7
- import { AspectRatio } from '$components/ui/aspect-ratio';
8
- </script>
9
-
10
- The Figma UI Kit is open sourced by [Pietro Schirano](https://twitter.com/skirano).
11
-
12
- <AspectRatio ratio={16 / 9} class="w-full mt-4">
13
-
14
- <iframe
15
- src="https://embed.figma.com/file/1203061493325953101/hf_embed?community_viewer=true&embed_host=shadcn&hub_file_id=1203061493325953101&kind=&viewer=1"
16
- class="h-full w-full overflow-hidden rounded-lg border bg-muted"
17
- />
18
- </AspectRatio>
19
-
20
- ## Grab a copy
21
-
22
- https://www.figma.com/community/file/1203061493325953101
@@ -1,4 +0,0 @@
1
- ---
2
- title: Superforms
3
- description: Building forms with Superforms and Zod.
4
- ---
@@ -1,84 +0,0 @@
1
- ---
2
- title: Introduction
3
- description: Re-usable components built using Radix Svelte and Tailwind CSS.
4
- ---
5
-
6
- <script>
7
- import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '$components/ui/accordion';
8
- import { Callout } from '$components/docs';
9
- import { AlertCircle } from "lucide-svelte";
10
- </script>
11
-
12
- An unofficial, community-led [Svelte](https://svelte.dev) port of [shadcn/ui](https://ui.shadcn.com). We are not affiliated with [shadcn](https://twitter.com/shadcn), but we did get his blessing before creating a clone of his work. This is a project born out of the need for a similar project for the Svelte ecosystem.
13
-
14
- <br>
15
-
16
- <Callout>
17
- <p>
18
- <strong>NOTE:</strong> This project does not have complete feature parity with the original. We are working on it, and if you'd like to expedite the process, please consider contributing to <a href="https://radix-svelte.com" rel="noreferrer" target="_blank">Radix Svelte</a>, which this project is built on.
19
- </p>
20
- </Callout>
21
-
22
- This is **NOT** a component library. It's a collection of re-usable components that you can copy and paste or use the CLI to add to your apps.
23
-
24
- **What do you mean not a component library?**
25
-
26
- It means you do not install it as a dependency. It is not available or distributed via npm, with no plans to publish it.
27
-
28
- Pick the components you need. Use the CLI to automatically add the components, or copy and paste the code into your project and customize to your needs. The code is yours.
29
-
30
- _Use this as a reference to build your own component libraries._
31
-
32
- ## FAQ
33
-
34
- <Accordion type="multiple" collapsible>
35
-
36
- <AccordionItem value="faq-1">
37
- <AccordionTrigger>
38
- Why not packaged as a dependency?
39
- </AccordionTrigger>
40
- <AccordionContent>
41
-
42
- The idea behind this is to give you ownership and control over the code, allowing you to decide how the components are built and styled.
43
-
44
- Start with some sensible defaults, then customize the components to your needs.
45
-
46
- One of the drawback of packaging the components in an npm package is that the style is coupled with the implementation. _The design of your components should be separate from their implementation._
47
-
48
- </AccordionContent>
49
-
50
- </AccordionItem>
51
-
52
- <AccordionItem value="faq-2">
53
- <AccordionTrigger>
54
- Which frameworks are supported?
55
- </AccordionTrigger>
56
- <AccordionContent>
57
-
58
- This port is built to be used with Svelte/SvelteKit.
59
-
60
- </AccordionContent>
61
- </AccordionItem>
62
-
63
- <AccordionItem value="faq-3">
64
- <AccordionTrigger>
65
- Can I use this in my project?
66
- </AccordionTrigger>
67
- <AccordionContent>
68
- Yes. Free to use for personal and commercial projects. No attribution required.
69
-
70
- But let us know if you do use it. We'd love to see what you build with it.
71
-
72
- </AccordionContent>
73
-
74
- </AccordionItem>
75
-
76
- </Accordion>
77
-
78
- ## Credits
79
-
80
- - [@shadcn](https://twitter.com/shadcn) - The brilliant mind behind the designs, methodology, and implementation.
81
- - [Radix Svelte](https://radix-svelte.com) - For the primitives. This project would not be possible without the incredible work by Thomas and the Radix Svelte team.
82
- - [Vercel](https://vercel.com) - Where this project is hosted.
83
- - [Shu Ding](https://shud.in) - The typography style is adapted from his work on Nextra.
84
- - [Cal](https://cal.com) - Where shad copied the styles for the first component: the `Button`.
@@ -1,327 +0,0 @@
1
- ---
2
- title: Installation
3
- description: How to install dependencies and structure your app.
4
- ---
5
-
6
- <script>
7
- import { Alert, AlertDescription } from "$components/ui/alert";
8
- import { Steps } from "$components/docs";
9
- </script>
10
-
11
- Unlike the official [shadcn/ui](https://ui.shadcn.com) for React, where the full components can exist in a single file, components in this port are split into multiple files. This is because Svelte doesn't support defining multiple components in a single file, so utilizing the CLI to add components will be the optimal approach.
12
-
13
- The CLI will create a folder for each _component_, which will sometimes just contain a single Svelte file, and in other times, multiple files. Within each folder, there will be an `index.ts` file that exports the component(s), so you can import them from a single file.
14
-
15
- For example, the Accordion component is split into four `.svelte` files:
16
-
17
- - `Accordion.svelte`
18
- - `AccordionContent.svelte`
19
- - `AccordionItem.svelte`
20
- - `AccordionTrigger.svelte`
21
-
22
- Each of which can be imported from the `accordion/index.ts` file like so:
23
-
24
- ```svelte
25
- <script lang="ts">
26
- import {
27
- Accordion,
28
- AccordionContent,
29
- AccordionItem,
30
- AccordionTrigger
31
- } from '$components/ui/accordion';
32
- </script>
33
- ```
34
-
35
- ## New Project
36
-
37
- <Steps>
38
-
39
- ### Create a new project
40
-
41
- Use the SvelteKit CLI to create a new project.
42
-
43
- ```bash
44
- npm create svelte@latest my-app
45
- ```
46
-
47
- ### Add TailwindCSS
48
-
49
- Use the `svelte-add` CLI to add Tailwind CSS to your project.
50
-
51
- ```bash
52
- npx svelte-add@latest tailwindcss
53
- ```
54
-
55
- ### Run the CLI
56
-
57
- ```bash
58
- npx shadcn-svelte init
59
- ```
60
-
61
- This will install dependencies, update your TailwindCSS configuration, add the `$components` path alias to your `svelte.config.js` file, and configure the `cn` utils for you.
62
-
63
- </Steps>
64
-
65
- ## Manual Installation
66
-
67
- <Steps>
68
-
69
- ### Add Tailwind
70
-
71
- Use the `svelte-add` CLI to add Tailwind CSS to your project.
72
-
73
- ```bash
74
- npx svelte-add@latest tailwindcss
75
- ```
76
-
77
- ### Add dependencies
78
-
79
- Add the following dependencies to your project:
80
-
81
- ```bash
82
- npm install tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-svelte
83
- ```
84
-
85
- ### Path Aliases
86
-
87
- Use the `$components` alias to make it easier to import your components. This is how you can configure the `$components` alias in `svelte.config.js`:
88
-
89
- ```js title="svelte.config.js" {7-8}
90
- /** @type {import('@sveltejs/kit').Config} */
91
- const config = {
92
- // ...
93
- kit: {
94
- // ..
95
- alias: {
96
- $components: 'src/lib/components',
97
- '$components/*': 'src/lib/components/*'
98
- }
99
- }
100
- };
101
- ```
102
-
103
- If you prefer to use a different alias than `$components`, you'll need to update the `import` statements when adding components.
104
-
105
- ### Configure tailwind.config.cjs
106
-
107
- This is what this project's `tailwind.config.cjs` file looks like:
108
-
109
- ```js title="tailwind.config.cjs"
110
- const { fontFamily } = require('tailwindcss/defaultTheme');
111
-
112
- /** @type {import('tailwindcss').Config} */
113
- module.exports = {
114
- darkMode: ['class'],
115
- content: ['./src/**/*.{html,js,svelte,ts}'],
116
- theme: {
117
- container: {
118
- center: true,
119
- padding: '2rem',
120
- screens: {
121
- '2xl': '1400px'
122
- }
123
- },
124
- extend: {
125
- colors: {
126
- border: 'hsl(var(--border))',
127
- input: 'hsl(var(--input))',
128
- ring: 'hsl(var(--ring))',
129
- background: 'hsl(var(--background))',
130
- foreground: 'hsl(var(--foreground))',
131
- primary: {
132
- DEFAULT: 'hsl(var(--primary))',
133
- foreground: 'hsl(var(--primary-foreground))'
134
- },
135
- secondary: {
136
- DEFAULT: 'hsl(var(--secondary))',
137
- foreground: 'hsl(var(--secondary-foreground))'
138
- },
139
- destructive: {
140
- DEFAULT: 'hsl(var(--destructive))',
141
- foreground: 'hsl(var(--destructive-foreground))'
142
- },
143
- muted: {
144
- DEFAULT: 'hsl(var(--muted))',
145
- foreground: 'hsl(var(--muted-foreground))'
146
- },
147
- accent: {
148
- DEFAULT: 'hsl(var(--accent))',
149
- foreground: 'hsl(var(--accent-foreground))'
150
- },
151
- popover: {
152
- DEFAULT: 'hsl(var(--popover))',
153
- foreground: 'hsl(var(--popover-foreground))'
154
- },
155
- card: {
156
- DEFAULT: 'hsl(var(--card))',
157
- foreground: 'hsl(var(--card-foreground))'
158
- }
159
- },
160
- borderRadius: {
161
- lg: 'var(--radius)',
162
- md: 'calc(var(--radius) - 2px)',
163
- sm: 'calc(var(--radius) - 4px)'
164
- },
165
- fontFamily: {
166
- sans: [...fontFamily.sans]
167
- }
168
- }
169
- },
170
- plugins: [require('tailwindcss-animate')]
171
- };
172
- ```
173
-
174
- Feel free to add or modify as needed to suit your project.
175
-
176
- ### Configure styles
177
-
178
- Add the following to your `src/app.postcss` file. You can learn more about using CSS variables for theming in the [theming section](/docs/theming).
179
-
180
- ```css title="src/app.postcss"
181
- @tailwind base;
182
- @tailwind components;
183
- @tailwind utilities;
184
-
185
- @layer base {
186
- :root {
187
- --background: 0 0% 100%;
188
- --foreground: 222.2 47.4% 11.2%;
189
-
190
- --muted: 210 40% 96.1%;
191
- --muted-foreground: 215.4 16.3% 46.9%;
192
-
193
- --popover: 0 0% 100%;
194
- --popover-foreground: 222.2 47.4% 11.2%;
195
-
196
- --border: 214.3 31.8% 91.4%;
197
- --input: 214.3 31.8% 91.4%;
198
-
199
- --card: 0 0% 100%;
200
- --card-foreground: 222.2 47.4% 11.2%;
201
-
202
- --primary: 222.2 47.4% 11.2%;
203
- --primary-foreground: 210 40% 98%;
204
-
205
- --secondary: 210 40% 96.1%;
206
- --secondary-foreground: 222.2 47.4% 11.2%;
207
-
208
- --accent: 210 40% 96.1%;
209
- --accent-foreground: 222.2 47.4% 11.2%;
210
-
211
- --destructive: 0 92% 38%;
212
- --destructive-foreground: 210 40% 98%;
213
-
214
- --ring: 215 20.2% 65.1%;
215
-
216
- --radius: 0.5rem;
217
- }
218
-
219
- .dark {
220
- --background: 224 71% 4%;
221
- --foreground: 213 31% 91%;
222
-
223
- --muted: 223 47% 11%;
224
- --muted-foreground: 215.4 16.3% 56.9%;
225
-
226
- --accent: 216 34% 17%;
227
- --accent-foreground: 210 40% 98%;
228
-
229
- --popover: 224 71% 4%;
230
- --popover-foreground: 215 20.2% 65.1%;
231
-
232
- --border: 216 34% 17%;
233
- --input: 216 34% 17%;
234
-
235
- --card: 224 71% 4%;
236
- --card-foreground: 213 31% 91%;
237
-
238
- --primary: 210 40% 98%;
239
- --primary-foreground: 222.2 47.4% 1.2%;
240
-
241
- --secondary: 222.2 47.4% 11.2%;
242
- --secondary-foreground: 210 40% 98%;
243
-
244
- --destructive: 359 51% 48%;
245
- --destructive-foreground: 210 40% 98%;
246
-
247
- --ring: 216 34% 17%;
248
-
249
- --radius: 0.5rem;
250
- }
251
- }
252
-
253
- @layer base {
254
- * {
255
- @apply border-border;
256
- }
257
- body {
258
- @apply bg-background text-foreground;
259
- font-feature-settings: 'rlig' 1, 'calt' 1;
260
- }
261
- }
262
- ```
263
-
264
- ### Add a cn helper
265
-
266
- You'll want to create a `cn` helper to make it easier to conditionally add Tailwind CSS classes. This project defines it in `lib/utils.ts`:
267
-
268
- ```ts title="lib/utils.ts"
269
- import type { ClassValue } from 'clsx';
270
- import { clsx } from 'clsx';
271
- import { twMerge } from 'tailwind-merge';
272
-
273
- export function cn(...inputs: ClassValue[]) {
274
- return twMerge(clsx(inputs));
275
- }
276
- ```
277
-
278
- ### Import styles to your app
279
-
280
- Create `src/routes/+layout.svelte` and import the styles:
281
-
282
- ```svelte title="src/routes/+layout.svelte"
283
- <script lang="ts">
284
- import '../app.postcss';
285
- </script>
286
-
287
- <slot />
288
- ```
289
-
290
- </Steps>
291
-
292
- ## Icons
293
-
294
- This project uses icons from [Lucide](https://lucide.dev/), but feel free to use any icon library.
295
-
296
- ## App structure
297
-
298
- Here's a recommended, but not required app structure:
299
-
300
- ```txt {4-11,15,19}
301
- src
302
- ├── lib
303
- │ ├── components
304
- │ │ ├── ui
305
- │ │ │ ├── alert-dialog
306
- │ │ │ │ ├── index.ts
307
- │ │ │ │ └── Alert.svelte
308
- │ │ │ ├── button
309
- │ │ │ │ ├── index.ts
310
- │ │ │ │ └── Button.svelte
311
- │ │ │ └── ...
312
- │ │ ├── Navigation.svelte
313
- │ │ ├── PageHeader.svelte
314
- │ │ └── ...
315
- │ └── utils.ts
316
- ├── routes
317
- │ ├── +page.svelte
318
- │ └── +layout.svelte
319
- ├── app.postcss
320
- ```
321
-
322
- - Place the UI components in the `lib/components/ui` folder.
323
- - The rest of the components such as `<PageHeader />` and `<Navigation />` are placed in the `lib/components` folder.
324
- - The `lib/utils.ts` file is where you can define the `cn` helper.
325
- - The `app.postcss` file contains the global CSS.
326
-
327
- That's it. You can now start adding components to your project.
@@ -1,189 +0,0 @@
1
- ---
2
- title: Theming
3
- description: Use CSS Variables to customize the look and feel of your application.
4
- ---
5
-
6
- <script>
7
- import { Callout, HexToChannels } from '$components/docs';
8
- </script>
9
-
10
- We use CSS variables for styling. This allows you to easily change the colors of components without having to update class names.
11
-
12
- **CSS variables must be defined without the color space function**. See the [Tailwind CSS documentation](https://tailwindcss.com/docs/customizing-colors#using-css-variables) for more information.
13
-
14
- ## Hex -> Color Channel
15
-
16
- You can use this tool to convert your HEX color to HSL without the color space function. Simply add your color in hex format, copy one of the generated values, then add them to the CSS variable.
17
-
18
- <HexToChannels />
19
-
20
- ## Convention
21
-
22
- We use a simple `background` and `foreground` convention for colors. The `background` variable is used for the background color of the component and the `foreground` variable is used for the text color.
23
-
24
- <Callout>
25
-
26
- The `background` suffix can be omitted if the variable is used for the background color of the component.
27
-
28
- </Callout>
29
-
30
- Given the following CSS variables:
31
-
32
- ```css
33
- --primary: 222.2 47.4% 11.2%;
34
- --primary-foreground: 210 40% 98%;
35
- ```
36
-
37
- The `background` color of the following component will be `hsl(var(--primary))` and the `foreground` color will be `hsl(var(--primary-foreground))`.
38
-
39
- ```svelte
40
- <div class="bg-primary text-primary-foreground">Hello</div>
41
- ```
42
-
43
- ## CSS Variables
44
-
45
- Here's the list of variables available for customization:
46
-
47
- ```css title="Default background color of <body />...etc"
48
- --background: 0 0% 100%;
49
- --foreground: 222.2 47.4% 11.2%;
50
- ```
51
-
52
- ```css title="Muted backgrounds such as <TabsList />, <Skeleton /> and <Switch />"
53
- --muted: 210 40% 96.1%;
54
- --muted-foreground: 215.4 16.3% 46.9%;
55
- ```
56
-
57
- ```css title="Background color for <Card />"
58
- --card: 0 0% 100%;
59
- --card-foreground: 222.2 47.4% 11.2%;
60
- ```
61
-
62
- ```css title="Background color for popovers such as <DropdownMenu />, <HoverCard />, <Popover />"
63
- --popover: 0 0% 100%;
64
- --popover-foreground: 222.2 47.4% 11.2%;
65
- ```
66
-
67
- ```css title="Default border color"
68
- --border: 214.3 31.8% 91.4%;
69
- ```
70
-
71
- ```css title="Border color for inputs such as <Input />, <Select />, <Textarea />"
72
- --input: 214.3 31.8% 91.4%;
73
- ```
74
-
75
- ```css title="Primary colors for <Button />"
76
- --primary: 222.2 47.4% 11.2%;
77
- --primary-foreground: 210 40% 98%;
78
- ```
79
-
80
- ```css title="Secondary colors for <Button />"
81
- --secondary: 210 40% 96.1%;
82
- --secondary-foreground: 222.2 47.4% 11.2%;
83
- ```
84
-
85
- ```css title="Used for accents such as hover effects on <DropdownMenuItem>, <SelectItem>...etc"
86
- --accent: 210 40% 96.1%;
87
- --accent-foreground: 222.2 47.4% 11.2%;
88
- ```
89
-
90
- ```css title="Used for destructive actions such as <Button variant='destructive'>"
91
- --destructive: 0 100% 50%;
92
- --destructive-foreground: 210 40% 98%;
93
- ```
94
-
95
- ```css title="Used for focus ring"
96
- --ring: 215 20.2% 65.1%;
97
- ```
98
-
99
- ```css title="Border radius for card, input and buttons"
100
- --radius: 0.5rem;
101
- ```
102
-
103
- ## Default
104
-
105
- The following is the default color palette used by the components.
106
-
107
- ```css title="src/app.postcss"
108
- @tailwind base;
109
- @tailwind components;
110
- @tailwind utilities;
111
-
112
- @layer base {
113
- :root {
114
- --background: 0 0% 100%;
115
- --foreground: 222.2 47.4% 11.2%;
116
-
117
- --muted: 210 40% 96.1%;
118
- --muted-foreground: 215.4 16.3% 46.9%;
119
-
120
- --popover: 0 0% 100%;
121
- --popover-foreground: 222.2 47.4% 11.2%;
122
-
123
- --card: 0 0% 100%;
124
- --card-foreground: 222.2 47.4% 11.2%;
125
-
126
- --border: 214.3 31.8% 91.4%;
127
- --input: 214.3 31.8% 91.4%;
128
-
129
- --primary: 222.2 47.4% 11.2%;
130
- --primary-foreground: 210 40% 98%;
131
-
132
- --secondary: 210 40% 96.1%;
133
- --secondary-foreground: 222.2 47.4% 11.2%;
134
-
135
- --accent: 210 40% 96.1%;
136
- --accent-foreground: 222.2 47.4% 11.2%;
137
-
138
- --destructive: 0 92% 38%;
139
- --destructive-foreground: 210 40% 98%;
140
-
141
- --ring: 215 20.2% 65.1%;
142
-
143
- --radius: 0.5rem;
144
- }
145
-
146
- .dark {
147
- --background: 224 71% 4%;
148
- --foreground: 213 31% 91%;
149
-
150
- --muted: 223 47% 11%;
151
- --muted-foreground: 215.4 16.3% 56.9%;
152
-
153
- --popover: 224 71% 4%;
154
- --popover-foreground: 215 20.2% 65.1%;
155
-
156
- --card: 224 71% 4%;
157
- --card-foreground: 213 31% 91%;
158
-
159
- --border: 216 34% 17%;
160
- --input: 216 34% 17%;
161
-
162
- --primary: 210 40% 98%;
163
- --primary-foreground: 222.2 47.4% 1.2%;
164
-
165
- --secondary: 222.2 47.4% 11.2%;
166
- --secondary-foreground: 210 40% 98%;
167
-
168
- --accent: 216 34% 17%;
169
- --accent-foreground: 210 40% 98%;
170
-
171
- --destructive: 359 51% 48%;
172
- --destructive-foreground: 210 40% 98%;
173
-
174
- --ring: 216 34% 17%;
175
-
176
- --radius: 0.5rem;
177
- }
178
- }
179
-
180
- @layer base {
181
- * {
182
- @apply border-border;
183
- }
184
- body {
185
- @apply bg-background text-foreground;
186
- font-feature-settings: 'rlig' 1, 'calt' 1;
187
- }
188
- }
189
- ```