Sheet
octane/sheetFreeComponent
octane publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by octane on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/octanejs/octane/main/packages/shadcn/registry/sheet.jsonSource
1// Base UI base sheet — TRANSCRIBED from upstream's `bases/base-ui/ui/sheet.tsx`2// (maintainer-supplied), class strings verbatim. Runs on @octanejs/base-ui's Dialog:3// Overlay -> Backdrop, Content -> Popup.4//5// UPSTREAM ANIMATES THIS WITH CSS TRANSITIONS, NOT KEYFRAMES, which is why the file is transcribed6// rather than derived. Base UI publishes `data-starting-style` and `data-ending-style` (see7// utils/popupStateMapping.ts) and this source drives motion off them with a plain `transition`,8// where the radix base uses `animate-in` / `animate-out` keyframe utilities.9//10// A derived version of this file did jump visibly on close, which is what prompted the11// transcription. Do NOT infer from that a general rule that keyframes cannot work on Base UI: the12// same mapping also emits `data-open` and `data-closed`, so `data-closed:animate-out` does match,13// and the precise cause of that jump was never isolated. What is established here is only what14// upstream ships, which is this.15//16// So the motion here reads: `transition duration-200` plus per-side17// `data-starting-style:translate-*` / `data-ending-style:translate-*` and an opacity pair —18// the element sits offset-and-transparent before open and after close, and transitions to its19// resting position in between.20//21// ONE DEPARTURE FROM THE SOURCE: upstream's title carries `cn-font-heading`, a semantic hook from22// the pinned cn-* system. This package ships the utilities-inlined flavor, the react-aria base23// drops the same class, and nothing defines it here (0 occurrences in the built CSS).24//25// Octane adaptations: no `"use client"`; refs are props.26import { type OctaneNode } from 'octane';27import { Dialog as SheetPrimitive } from '@octanejs/base-ui/dialog';28import { XIcon } from '@octanejs/lucide';2930import { cn } from '@/lib/utils';31import { Button } from '@/components/ui/button';3233type Props = { className?: string; children?: OctaneNode } & Record<string, unknown>;3435export function Sheet(props: Record<string, unknown>) @{36 <SheetPrimitive.Root data-slot="sheet" {...props} />37}3839export function SheetTrigger(props: Record<string, unknown>) @{40 <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />41}4243export function SheetClose(props: Record<string, unknown>) @{44 <SheetPrimitive.Close data-slot="sheet-close" {...props} />45}4647export function SheetPortal(props: Record<string, unknown>) @{48 <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />49}5051// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from octane
All 44 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | octane | Components | Free | 2 deps | |
| Alertalert | octane | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | octane | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | octane | Components | Free | no deps | |
| Avataravatar | octane | Components | Free | 1 dep | |
| Badgebadge | octane | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | octane | Components | Free | 1 dep | |
| Buttonbutton | octane | Components | Free | 2 deps |
