Skip to content

armgit / vaul

Public Imported from GitHub
0

A drawer component for React.

Update hero

emilkowalskif8c3dba9bb2f
diff --git a/website/src/app/components/hero.tsx b/website/src/app/components/hero.tsx
index ef1552c..0582355 100644
--- a/website/src/app/components/hero.tsx
+++ b/website/src/app/components/hero.tsx
@@ -4,7 +4,7 @@ import { Drawer } from 'vaul';
export function Hero() {
return (
- <div className="relative h-[200vh]">
+ <div className="relative">
<div
aria-hidden
className="absolute top-0 w-[1000px] z-10 h-[400px] left-1/2 -translate-x-1/2 -translate-y-1/2 opacity-[0.15] pointer-events-none"
@@ -40,7 +40,7 @@ export function Hero() {
<p className="text-gray-600 text-xl">Drawer component for React.</p>
</div>
<div className="flex gap-4 justify-center mt-6">
- <Drawer.Root>
+ <Drawer.Root shouldScaleBackground>
<Drawer.Trigger asChild>
<button
type="button"
@@ -51,11 +51,84 @@ export function Hero() {
</Drawer.Trigger>
<Drawer.Overlay className="fixed inset-0 bg-black/40" />
<Drawer.Portal>
- <Drawer.Content className="bg-white flex flex-col fixed bottom-0 left-0 right-0 max-h-[50vh] rounded-t-[10px]">
- <div className="max-w-md w-full mx-auto flex flex-col overflow-auto p-4 rounded-t-[10px]">
- <input className="border border-gray-400 my-8" placeholder="Input" />
-
- <input className="border border-gray-400 my-8" placeholder="Input" />
+ <Drawer.Content className="bg-gray-100 flex flex-col rounded-t-[10px] h-full mt-24 max-h-[96%] fixed bottom-0 left-0 right-0">
+ <div className="p-4 bg-white rounded-t-[10px] flex-1">
+ <div className="mx-auto w-12 h-1.5 flex-shrink-0 rounded-full bg-gray-300 mb-8" />
+ <div className="max-w-md mx-auto">
+ <Drawer.Title className="font-medium mb-4">Drawer for React.</Drawer.Title>
+ <p className="text-gray-600 mb-2">
+ This component can be used as a Dialog replacement on mobile and tablet devices.
+ </p>
+ <p className="text-gray-600 mb-2">It comes unstyled and has gesture-driven animations.</p>
+ <p className="text-gray-600 mb-8">
+ It uses{' '}
+ <a
+ href="https://www.radix-ui.com/docs/primitives/components/dialog"
+ className="underline"
+ target="_blank"
+ >
+ Radix's Dialog primitive
+ </a>{' '}
+ under the hood and is inspired by{' '}
+ <a
+ href="https://twitter.com/devongovett/status/1674470185783402496"
+ className="underline"
+ target="_blank"
+ >
+ this tweet.
+ </a>
+ </p>
+ </div>
+ </div>
+ <div className="p-4 bg-gray-100 border-t border-gray-200 mt-auto">
+ <div className="flex gap-6 justify-end max-w-md mx-auto">
+ <a
+ className="text-xs text-gray-600 flex items-center gap-0.25"
+ href="https://github.com/emilkowalski/vaul"
+ target="_blank"
+ >
+ GitHub
+ <svg
+ fill="none"
+ height="16"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ viewBox="0 0 24 24"
+ width="16"
+ aria-hidden="true"
+ className="w-3 h-3 ml-1"
+ >
+ <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path>
+ <path d="M15 3h6v6"></path>
+ <path d="M10 14L21 3"></path>
+ </svg>
+ </a>
+ <a
+ className="text-xs text-gray-600 flex items-center gap-0.25"
+ href="https://twitter.com/emilkowalski_"
+ target="_blank"
+ >
+ Twitter
+ <svg
+ fill="none"
+ height="16"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ stroke-width="2"
+ viewBox="0 0 24 24"
+ width="16"
+ aria-hidden="true"
+ className="w-3 h-3 ml-1"
+ >
+ <path d="M18 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h6"></path>
+ <path d="M15 3h6v6"></path>
+ <path d="M10 14L21 3"></path>
+ </svg>
+ </a>
+ </div>
</div>
</Drawer.Content>
</Drawer.Portal>
diff --git a/website/src/app/globals.css b/website/src/app/globals.css
index 748e424..875c8f4 100644
--- a/website/src/app/globals.css
+++ b/website/src/app/globals.css
@@ -2,6 +2,11 @@
@tailwind components;
@tailwind utilities;
+html,
+body {
+ overflow: hidden;
+}
+
body,
main {
min-height: 100vh;