Sheet

Dialog pinned to an edge of the screen, for content that complements the page rather than interrupting it.

c2-sheet is a dialog that spans one edge of the screen and slides in from it — filters, details, a form beside the record it edits. It is built on the native <dialog> like c2-modal, so focus is trapped and restored, the page behind is inert and covered by a backdrop, and Escape closes. side picks the edge (right by default), and --c2-sheet--size is the width of a left/right sheet or the height of a top/bottom one while the other axis fills the screen. Open it with the open attribute or show(), close it with close(returnValue), the × button, a backdrop click or Escape — hide-close, no-backdrop-close and no-escape turn those off. The heading goes in title (it labels the sheet; use label when there is none), the content in the default slot, the actions in footer; only the body scrolls, so the header and footer stay put.

Installation

npm install @c2n/sheet

Usage

Right

The default edge: a panel that complements the page without replacing it.

Filters
Left

Slides in from the left.

Navigation
TopAnnouncement

Full width, pinned to the top; --c2-sheet--size is its height.

Bottom

The phone pattern: a bottom sheet for actions on the current screen.

Share
Edit recordEdit record

Put the form in the body and the actions in the footer. Only the body scrolls, so Save never leaves the screen.

CancelSave
RoundedRounded

--c2-sheet--border-radius rounds the two corners facing the page; the edge stays square.

Wide

A detail panel that needs room for a table or a diff.

Wide

Reach for a sheet when the content belongs beside the page: filters over a list, a record’s details, a form the user fills in without losing their place. Reach for c2-modal when the page must stop for a decision, and for c2-side-nav when the panel is navigation that is part of the layout rather than a transient overlay.

Keep the trigger and the sheet next to each other in the markup, and give the sheet a name — a title slot labels it automatically, label names one without a visible heading. Focus moves into the panel on open and returns to the trigger on close, so a sheet opened from a toolbar button lands the user back where they were.

A sheet can hold another overlay: a confirm dialog opened from inside a sheet keeps the page locked until both have closed, and closing the inner one leaves the sheet standing.

--c2-sheet--size is the only geometry variable you normally need; the sheet fills the other axis. --c2-sheet--border-radius rounds the inner corners, --c2-sheet--transition-duration sets the slide (0ms disables it, and reduced motion drops it automatically), and the __header, __body, __footer, __close and __backdrop groups match c2-modal’s so a dialog and a sheet can be themed together.

escAccordionConnected, animated panels with shared borders and single or multiple expansion.LayoutAvatarImage, initials or icon for a person, with status dot and badge.Data displayBadgeTinted pill for status text, counts and dots, optionally pinned to a corner of another element.Data displayBreadcrumbNavigation trail of link buttons with separators, a current page and optional collapsing.NavigationButtonThemeable button with slots for text, prefix, suffix and running icons.ButtonsButton GroupAttached buttons with shared borders, optionally a segmented control with single or multiple selection.ButtonsCardGroups related content and actions on a single bordered surface.LayoutChat InputAuto-growing message box with a send button for chat interfaces.ChatChat MessageOne chat bubble with avatar, title, timestamp and message body.ChatCheckboxNative checkbox behaviour in a quiet, themeable box with an opt-in hover layer.InputsCode ViewerSyntax-highlighted code with line numbers, copy button and dark mode, powered by shiki.Data displayColor AreaTwo-dimensional area for picking saturation and value of a colour.InputsColor SelectColour swatch that opens a full picker built from area and slider.InputsColor SliderHorizontal slider for choosing a hue from 0 to 360.InputsCopy ButtonButton that copies text to the clipboard — the element it sits in, another element by id, or a literal string.ButtonsDetailsCollapsible disclosure built on native details and summary.LayoutIcon ButtonRound, hoverable button wrapping a slotted SVG icon.ButtonsKbdKeyboard key label for shortcuts and command hints, with the semantics of the native kbd element.Data displayLabelCaption that names and activates the control referenced by its for attribute, with a required marker.InputsLink ButtonText-styled control for link and navigation actions, rendered as a real anchor or a button.NavigationListVertical list container with single or multiple selection.Data displayList ItemSelectable row with icon slots, used on its own or as the option of list and select.Data displayMenuCommands, links, checkboxes and submenus in a popover anchored to a trigger.NavigationModalDialog built on the native dialog element: focus trap, backdrop, Escape, title, body and footer.FeedbackNavigation MenuSite navigation bar whose triggers open panels of links below the header.NavigationOverlayAnchored popup built on the browser Popover API, positioned with floating-ui.FeedbackPaginationPage navigation in three layouts: numbered pages, a simple page status, or a table-footer row with rows-per-page.NavigationProgressLinear progress bar, indeterminate or filling to a value, with an optional label and count.FeedbackRadioRadio options built on native inputs, grouped into one value with keyboard navigation.InputsSelectDropdown that pairs a themeable trigger with an anchored list of c2-list-item options.InputsSeperatorHorizontal or vertical rule with an optional label, for dividing content and toolbars.LayoutSheetDialog pinned to an edge of the screen, for content that complements the page rather than interrupting it.FeedbackSide NavResponsive navigation drawer beside the page: pushes the content on large screens, slides over it with a backdrop on small ones.NavigationSkeletonPlaceholder block standing in for content that has not arrived, in three shapes and three animations.FeedbackSliderRange input with a themeable track, thumb, step ticks and value bubble.InputsSpinnerCircular progress indicator, indeterminate or showing a value, with optional text.FeedbackSwitchOn/off toggle on a native switch input, with label, description and thumb icons.InputsTableVirtualized data grid with declarative columns, sorting, selection, pinning and resizing.Data displayTabsTab strip that shows one content panel at a time.NavigationText FieldSingle-line input with icon slots, clear button, helper and error text, and a character counter.InputsTextareaMultiline text input with resizing, helper and error text, and a character counter.InputsToastNotification cards and a manager for stacked, queued notifications with independent lifetimes.FeedbackTooltipContextual hint shown when its target is hovered or focused, rendered in the top layer.FeedbackFeather Icons287 open-source Feather icons, one web component each.IconsMat Icon2,234 Material Icons ligatures rendered through a single element.IconsPhosphor Icons1,512 flexible icons in six weights, one web component each.IconsThemingTheme every c2n component from a handful of design tokens with @c2n/theme, or reach for any component variable directly.GuideUsing c2n in an applicationThe workflow behind every c2n app: load the theme once, use c2-* tags directly, and turn every repeated pattern into a small variant or composed component.Guide