Rost

← All components

component

Sheet

A panel that slides over the page from the right, for a task with more to it than a dialog: editing a client, an invoice's details.

In code Contract: review Guidance: proposed Contract on GitHub Figma 744:3 As markdown

Try it

Every variant

Default

Install

npx github:Runceanu/rost add sheet

It lands in src/rost/sheet/, with what it needs and its contract. Install has the rest.

When to use

  • A task beside the page

    Editing something from a list without leaving it: a client, an invoice's details. The list stays in sight behind it.

When not to use

Behaviour

It's a <dialog> opened as a modal and moved to the right edge, full height: the browser does focus, Esc and the page behind. The page dims as it does for Dialog. It doesn't slide in yet; it appears.

Accessibility

  • Element

    <dialog> opened with showModal(), labelled by its title.

  • Name

    The title.

  • Keyboard

    Focus starts inside and stays there until it closes. Esc closes it.

  • Focus

    When it closes, focus goes back to what opened it.

  • Colour

    The title is 14:1 and the words 11:1 on the plate, in dark.

Content

The title says what's being done (Edit client); the buttons say how it ends (Cancel, Save).

Props

PropTypeValuesDefault
open boolean false
title slot
children slot
actions slot

Values

Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.

Never changes

root

  • padding 0px spacing/gap/none

bordernone · backgroundtransparent · colorinherit · margin0 0 0 auto · block-size100% · max-heightnone · max-widthnone

backdrop

  • background #060805 sheet/backdrop
  • opacity 0.72 opacity/hard

panel

  • gap 16px spacing/gap/medium
  • width 400px no token yet
  • padding 24px spacing/gap/large
  • background #171717 sheet/background
  • outline-width 1px spacing/outline/small
  • outline-offset calc(-1 * var(--spacing-outline-small)) on purpose: Composed from a token: the edge sits inside.
  • outline-color #3a3a3a sheet/edge
  • box-shadow 0px 16px 24px 0px rgba(0, 0, 0, 0.16) shadow/floating

displayflex · flex-directioncolumn · max-widthcalc(100vw - 16px) · height100% · outline-stylesolid

title

  • font-family 'General Sans Variable' font-family/base
  • font-weight 500 typography/title/font-weight/medium
  • font-size 24px typography/title/font-size
  • line-height 32px typography/title/line-height
  • letter-spacing 0px typography/title/letter-spacing
  • color #ededed sheet/title

body

  • font-family 'General Sans Variable' font-family/base
  • font-weight 400 typography/paragraph/font-weight/regular
  • font-size 14px typography/paragraph/font-size
  • line-height 20px typography/paragraph/line-height
  • letter-spacing 0px typography/paragraph/letter-spacing
  • color #d3d9d5 sheet/body

flex-grow1 · overflow-yauto

actions

  • gap 8px spacing/gap/small

displayflex · justify-contentflex-end