Rost

← All components

component

EmptyState

What a screen says when there's nothing on it yet. One of Rost's drawings, a line saying why, a sentence on what to do, and the button that does it.

In code Contract: review Guidance: proposed Contract on GitHub Figma 742:62 As markdown

No invoices yet

When you send your first one, it shows up here with what's paid and what's due.

Default

Install

npx github:Runceanu/rost add empty-state

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

When to use

  • Nothing here yet

    A list or a screen before its first item: no clients, no invoices this month. Say why, and offer the way to the first one.

When not to use

  • No results

    A search that found nothing needs one line in place of the results, not a drawing.

  • Errors

    Something that failed. That's InlineBanner, with what to do.

    Use InlineBanner

Behaviour

A drawing, a title, a sentence and at most one Button, centred. It adds nothing to the drawing or the Button: they're Rost's own.

Accessibility

  • Element

    A <div>. The title is a heading (h2 by default, as changes it) so it's found by headings.

  • Name

    The title.

  • Colour

    The title is 14:1 and the sentence 11:1 on the dark page. The drawing is decoration and is hidden from screen readers.

Content

The title says why ("No invoices yet"), the sentence what to do, the button the verb ("New invoice").

Props

PropTypeValuesDefault
illustration slot
title slot
children slot
action 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

  • gap 16px spacing/gap/medium
  • padding 40px spacing/gap/2xlarge

displayflex · flex-directioncolumn · align-itemscenter · text-aligncenter

illustration

flex-shrink0

title

  • font-family 'General Sans Variable' font-family/base
  • font-weight 500 typography/sub-title/font-weight/medium
  • font-size 20px typography/sub-title/font-size
  • line-height 28px typography/sub-title/line-height
  • letter-spacing 0px typography/sub-title/letter-spacing
  • color #ededed empty-state/title

body

  • max-width 320px no token yet
  • 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 empty-state/body

action

flex-shrink0