-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
549 additions
and
29 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
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
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,99 @@ | ||
--- | ||
title: Resizable | ||
description: Accessible resizable panel groups and layouts with keyboard support. | ||
component: true | ||
source: https://github.com/huntabyte/shadcn-svelte/tree/main/apps/www/src/lib/registry/default/ui/resizable | ||
bits: https://paneforge.com | ||
--- | ||
|
||
<script> | ||
import { ComponentPreview, ManualInstall } from '$lib/components/docs' | ||
</script> | ||
|
||
<ComponentPreview name="resizable-demo"> | ||
|
||
<div /> | ||
|
||
</ComponentPreview> | ||
|
||
## About | ||
|
||
The `Resizable` component is built on top of [PaneForge](https://github.com/svecosystem/paneforge) by [Huntabyte](https://github.com/huntabyte). Visit the [PaneForge documentation](https://paneforge.com) for all the available props and abilities of the `Resizable` component. | ||
|
||
## Installation | ||
|
||
```bash | ||
npx shadcn-svelte@latest add resizable | ||
``` | ||
|
||
<ManualInstall> | ||
|
||
1. Install `paneforge`: | ||
|
||
```bash | ||
npm install paneforge | ||
``` | ||
|
||
2. Copy and paste the component source files linked at the top of this page into your project. | ||
|
||
</ManualInstall> | ||
|
||
## Usage | ||
|
||
```svelte | ||
<script lang="ts"> | ||
import * as Resizable from "$lib/components/ui/resizable"; | ||
</script> | ||
<Resizable.PaneGroup direction="horizontal"> | ||
<Resizable.Pane>One</Resizable.Pane> | ||
<Resizable.Handle /> | ||
<Resizable.Pane>Two</Resizable.Pane> | ||
</Resizable.PaneGroup> | ||
``` | ||
|
||
## Examples | ||
|
||
### Vertical | ||
|
||
Use the `direction` prop to set the direction of the resizable panels. | ||
|
||
<ComponentPreview name="resizable-vertical"> | ||
|
||
<div /> | ||
|
||
</ComponentPreview> | ||
|
||
```svelte showLineNumbers {5} | ||
<script lang="ts"> | ||
import * as Resizable from "$lib/components/ui/resizable"; | ||
</script> | ||
<Resizable.PaneGroup direction="vertical"> | ||
<Resizable.Pane>One</Resizable.Pane> | ||
<Resizable.Handle /> | ||
<Resizable.Pane>Two</Resizable.Pane> | ||
</Resizable.PaneGroup> | ||
``` | ||
|
||
### Handle | ||
|
||
You can set or hide the handle by using the `withHandle` prop on the `ResizableHandle` component. | ||
|
||
<ComponentPreview name="resizable-handle"> | ||
|
||
<div /> | ||
|
||
</ComponentPreview> | ||
|
||
```svelte showLineNumbers {7} | ||
<script lang="ts"> | ||
import * as Resizable from "$lib/components/ui/resizable"; | ||
</script> | ||
<Resizable.PaneGroup direction="vertical"> | ||
<Resizable.Pane>One</Resizable.Pane> | ||
<Resizable.Handle withHandle /> | ||
<Resizable.Pane>Two</Resizable.Pane> | ||
</Resizable.PaneGroup> | ||
``` |
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
Oops, something went wrong.