A panel for supplementary details and actions.
import { useState } from 'react';
import { Sheet } from '@vrum/ui';
import { SheetTrigger, Button, SheetContent, SheetTitle, SheetDescription, SheetClose } from '@vrum/ui';
export default function Demo() {
const [open, setOpen] = useState(false);
return (
<Sheet
open={open}
onOpenChange={setOpen}
>
<SheetTrigger asChild><Button variant="outline">Open details</Button></SheetTrigger><SheetContent><SheetTitle>Project details</SheetTitle><SheetDescription>Review upcoming milestones and project ownership.</SheetDescription><SheetClose asChild><Button className="mt-6">Done</Button></SheetClose></SheetContent>
</Sheet>
);
}Copy code| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | none | Content rendered inside the component. |
open | boolean | none | Controlled visibility. |
defaultOpen | boolean | none | Initial visibility for an uncontrolled component. |
onOpenChange | ((open: boolean) => void) | none | Called when visibility changes. |
modal | boolean | none | modal configuration. |
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | none | as child configuration. |
disabled | boolean | none | Disable user interaction. |
name | string | none | name configuration. |
type | "submit" | "reset" | "button" | none | type configuration. |
value | string | number | readonly string[] | none | Controlled value. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLButtonElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLButtonElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLButtonElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLButtonElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLButtonElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLButtonElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLButtonElement> | none | on select configuration. |
| Prop | Type | Default | Description |
|---|---|---|---|
forceMount | true | none | Used to force mounting when more control is needed. Useful when controlling animation with React animation libraries. |
asChild | boolean | none | as child configuration. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLDivElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLDivElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLDivElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLDivElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLDivElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLDivElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLDivElement> | none | on select configuration. |
onOpenAutoFocus | ((event: Event) => void) | none | Event handler called when auto-focusing on open. Can be prevented. |
onCloseAutoFocus | ((event: Event) => void) | none | Event handler called when auto-focusing on close. Can be prevented. |
onEscapeKeyDown | ((event: KeyboardEvent) => void) | none | Event handler called when the escape key is down. Can be prevented. |
onPointerDownOutside | ((event: PointerDownOutsideEvent) => void) | none | Event handler called when the a `pointerdown` event happens outside of the `DismissableLayer`. Can be prevented. |
onFocusOutside | ((event: FocusOutsideEvent) => void) | none | Event handler called when the focus moves outside of the `DismissableLayer`. Can be prevented. |
onInteractOutside | ((event: PointerDownOutsideEvent | FocusOutsideEvent) => void) | none | Event handler called when an interaction happens outside the `DismissableLayer`. Specifically, when a `pointerdown` event happens outside or focus moves outside of it. Can be prevented. |
deferPointerDownOutside | boolean | none | When `true`, a `'pointerdown'` event outside of the layered element will wait for the interaction's click event before dispatching, allowing third-party code to stop propagation of later events and cancel dismissal. |
side | "top" | "bottom" | "left" | "right" | "right" | side configuration. |
hideCloseButton | boolean | false | hide close button configuration. |
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | none | as child configuration. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLHeadingElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLHeadingElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLHeadingElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLHeadingElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLHeadingElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLHeadingElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLHeadingElement> | none | on select configuration. |
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | none | as child configuration. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLParagraphElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLParagraphElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLParagraphElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLParagraphElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLParagraphElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLParagraphElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLParagraphElement> | none | on select configuration. |
| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | none | as child configuration. |
disabled | boolean | none | Disable user interaction. |
name | string | none | name configuration. |
type | "submit" | "reset" | "button" | none | type configuration. |
value | string | number | readonly string[] | none | Controlled value. |
defaultChecked | boolean | none | default checked configuration. |
defaultValue | string | number | readonly string[] | none | Initial value for an uncontrolled component. |
autoFocus | boolean | none | auto focus configuration. |
className | string | none | Additional CSS classes. |
id | string | none | id configuration. |
style | CSSProperties | none | Inline style overrides. |
aria-invalid | boolean | "false" | "true" | "grammar" | "spelling" | none | Indicates the entered value does not conform to the format expected by the application. |
aria-label | string | none | Defines a string value that labels the current element. |
children | ReactNode | none | Content rendered inside the component. |
onFocus | FocusEventHandler<HTMLButtonElement> | none | on focus configuration. |
onBlur | FocusEventHandler<HTMLButtonElement> | none | on blur configuration. |
onChange | ChangeEventHandler<HTMLButtonElement, Element> | none | Called when the input value changes. |
onSubmit | SubmitEventHandler<HTMLButtonElement> | none | Called when the form is submitted. |
onKeyDown | KeyboardEventHandler<HTMLButtonElement> | none | on key down configuration. |
onClick | MouseEventHandler<HTMLButtonElement> | none | Called when the control is activated. |
onSelect | ReactEventHandler<HTMLButtonElement> | none | on select configuration. |