-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from huntabyte/documentation/render-del
- Loading branch information
Showing
21 changed files
with
3,520 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<script lang="ts"> | ||
import type { IconProps } from "lucide-svelte"; | ||
type $$Props = IconProps; | ||
</script> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script lang="ts"> | ||
import type { IconProps } from "lucide-svelte"; | ||
type $$Props = IconProps; | ||
</script> | ||
|
||
<svg xmlns="http://www.w3.org/2000/svg" {...$$restProps} fill="currentColor" viewBox="0 0 256 256" | ||
><path | ||
d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z" | ||
/></svg | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
<script lang="ts"> | ||
import type { HTMLAnchorAttributes } from "svelte/elements"; | ||
import { ArrowSquareOut } from "@/components/icons"; | ||
import { cn } from "@/utils"; | ||
let className: string | undefined | null = undefined; | ||
export { className as class }; | ||
export let href: HTMLAnchorAttributes["href"] = undefined; | ||
export let href: string; | ||
$: internal = href.startsWith("/") || href.startsWith("#"); | ||
$: rel = !internal ? "noopener noreferrer" : undefined; | ||
$: target = !internal ? "_blank" : undefined; | ||
</script> | ||
|
||
<a {href} class={cn("font-medium underline underline-offset-4", className)} {...$$restProps}> | ||
<a | ||
{href} | ||
{target} | ||
{rel} | ||
class={cn("inline-flex items-center gap-1 font-medium underline underline-offset-4", className)} | ||
{...$$restProps} | ||
> | ||
<slot /> | ||
</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="[&>h3]:step mb-12 ml-4 border-l pl-8 [counter-reset:step]" {...$$restProps}> | ||
<slot /> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
--- | ||
title: Installation | ||
description: Start using primitives in your project. | ||
title: Getting Started | ||
description: Learn how to get started using Bits in your app. | ||
--- | ||
|
||
## Installation | ||
|
||
Install bits using your favorite package manager. | ||
|
||
```bash | ||
npm install @huntabyte/bits | ||
``` | ||
|
||
You can them import and start using them in your app. | ||
|
||
```svelte | ||
<script lang="ts"> | ||
import { Accordion } from "@huntabyte/bits"; | ||
</script> | ||
<Accordion.Root> | ||
<Accordion.Item value="first"> | ||
<Accordion.Header> | ||
<Accordion.Trigger>First</Accordion.Trigger> | ||
</Accordion.Header> | ||
<Accordion.Content>This is the first accordion content</Accordion.Content> | ||
</Accordion.Item> | ||
<Accordion.Item value="second"> | ||
<Accordion.Header> | ||
<Accordion.Trigger>Second</Accordion.Trigger> | ||
</Accordion.Header> | ||
<Accordion.Content>This is the second accordion content</Accordion.Content> | ||
</Accordion.Item> | ||
<Accordion.Item value="third"> | ||
<Accordion.Header> | ||
<Accordion.Trigger>Third</Accordion.Trigger> | ||
</Accordion.Header> | ||
<Accordion.Content>This is the third accordion content</Accordion.Content> | ||
</Accordion.Item> | ||
</Accordion.Root> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
--- | ||
title: Introduction | ||
description: A collection of headless Svelte components. | ||
description: A collection of headless Svelte components built with Melt UI builders. | ||
--- | ||
|
||
Primitives are headless components that provide a simple interface for composing your own components. They are designed to be customizable and composable, and to work with any UI framework. | ||
Bits are headless component primitives that provide a simple interface for composing your own components. They have been thoughtfully designed to prioritize simplicity, customizability, and compatibility with any styling or UI framework you choose to work with. | ||
|
||
Under the hood, these components are powered by [Melt UI](https://melt-ui.com), which provides an even lower-level builder API for creating headless components. Bits take that API and wrap it in a more familiar component interface which allows us to handle some quality of life improvements for you. | ||
|
||
While our goal has been to keep the APIs as close to Melt's as possible, there are some slight differences, so be sure to check out the documentation for the Bit you're interested in to understand how it works. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.