Ship faster with goilerplate templUI Pro

Sheet

Extends the Dialog component to display content that complements the main content of the screen.

Source Tailwind CSS JavaScript

Edit profile

Make changes to your profile here. Click save when you're done.

Examples

Sheet Sides

Top Sheet

This slides in from the top.

Content for the top sheet.

Right Sheet

This slides in from the right.

Content for the right sheet.

Bottom Sheet

This slides in from the bottom.

Content for the bottom sheet.

Left Sheet

This slides in from the left.

Content for the left sheet.

External Trigger

External Trigger

This sheet has no internal trigger

The trigger button exists outside the Sheet component.

Installation

templui add sheet

Load the script once in your layout:

<head>
  @sheet.Script()
</head>

API Reference

Required parameter
Hover for description

Sheet

Name Type Default
ID

Optional HTML id for the sheet root. Useful for external targeting.

string
""
Class

Additional CSS classes to apply to the sheet wrapper

string
""
Attributes

Additional HTML attributes to apply to the sheet wrapper

templ.Attributes
nil
Side

Side from which the sheet slides in (top, right, bottom, left)

Side
SideRight
Open

Whether the sheet should be open initially

bool
false
DisableClickAway

Disable closing the sheet when clicking the backdrop

bool
false
DisableESC

Disable closing the sheet with the ESC key

bool
false

Trigger

Name Type Default
ID

Unique identifier for the trigger element

string
""
Class

Additional CSS classes to apply to the trigger

string
""
Attributes

Additional HTML attributes to apply to the trigger

templ.Attributes
nil
For

Optional sheet root id for external triggers outside Sheet wrapper

string
""

Content

Name Type Default
Class

Additional CSS classes to apply to the content container

string
""
Attributes

Additional HTML attributes to apply to the content container

templ.Attributes
nil
HideCloseButton

Hide the close X button in the top right corner

bool
false
Side

Side from which the sheet slides in. Usually inherited from Sheet.

Side
SideRight

Title

Name Type Default
ID

Unique identifier for the title element

string
""
Class

Additional CSS classes to apply to the title

string
""
Attributes

Additional HTML attributes to apply to the title

templ.Attributes
nil

Description

Name Type Default
ID

Unique identifier for the description element

string
""
Class

Additional CSS classes to apply to the description

string
""
Attributes

Additional HTML attributes to apply to the description

templ.Attributes
nil

Close

Name Type Default
ID

Unique identifier for the close button

string
""
Class

Additional CSS classes to apply to the close button

string
""
Attributes

Additional HTML attributes to apply to the close button

templ.Attributes
nil
Axel Adrian