Eyal Levin

Freshbar

A freshbar is a word-sized gauge of age, built into a date. It lets you see how recent something is, and how it compares to its neighbours, without reading.

With freshbars

    The same list, dates only

      The problem

      Every list on the web has dates: episodes, posts, commits, messages, prices. To understand one, you read it, you work out how long ago that was, and then, to know whether it is new for this list, you read the others too.

      Relative dates like "3 weeks ago" save the arithmetic, but you still have to read every one to compare them. Length, on the other hand, you can compare at a glance, which is much of why a bar chart is quicker to read than a table of numbers. A freshbar gives each date a length, in a column, so the comparison happens before you read a word.

      Anatomy

      2 weeks ago
      Label
      The date in words. It stays. The bar annotates the date, it never replaces it.
      Channel
      The track under the label, the same width for every date in a list.
      Fill
      How much of the channel has passed. It grows with age, from the left.
      Scale
      What a full channel means. The default is five equal sections: a day, a week, a month, a year, two years.

      The scale

      The scale is the one real design decision. A linear scale over two years would leave everything from this week as an empty channel, and most lists are dense in the recent past. So each section gets the same length, and time is stretched within it: the first day takes a fifth of the channel, and so does the whole second year.

      The channel stays empty for the first five minutes and is full at two years. Inside each section the end of the fill keeps away from the boundary, so "more than a week, less than a month" never sits exactly on a line. When a list has a different rhythm, change the scale, not the idea: a news feed might use an hour, a day, a week, a month.

      Principles

      When not to use one

      A single date alone on a page has nothing to be compared with. Future dates need a different idea. Dense data tables, where the column is already sortable and scanned by number, rarely need it. And if the age of things does not matter to the reader, a freshbar is noise.

      Choosing a scale

      Pick the scale from how far apart the things in your list usually are, so the channels spread out instead of all looking full or empty.

      Liststops
      Most feeds: posts, episodes, releases1d 1w 1mo 1y 2y (default)
      News, chat, notifications1h 6h 1d 1w
      Archives, references, books1mo 1y 5y 20y

      Set --freshbar-width to the widest label your list can show, in your language. In right-to-left pages the channel fills from the right.

      Variants

      The same component, styled with CSS.

      Channel. The default: quiet, under the words.
      2 Oct 29 Sep 11 Jul
      Your own words, an accent fill. For a page where age is the point.

      Use it

      One file, no dependencies, works in any page or framework.

      <script type="module" src="https://eyalev.com/freshbar/fresh-bar.js"></script>
      
      <fresh-bar datetime="2026-09-12T08:00:00Z"></fresh-bar>
      <fresh-bar datetime="2026-09-12">12 Sep</fresh-bar>

      Empty, it writes the relative label itself ("3 weeks ago") and keeps it current. With your own words inside, it keeps them and adds the channel. Either way, tapping the date shows the exact date and time, a screen reader hears it, and it sits in a real <time> element.

      AttributeMeaning
      datetimeRequired. An ISO date (2026-09-12, 2026-09-12T08:00:00Z), or unix seconds as a bare number.
      stopsThe scale, shortest first. Default 1d 1w 1mo 1y 2y (a day, a week, a month, a year, two years). Units: min h d w mo y.
      nowFix "now", for tests and screenshots.

      CSS propertyDefaultWhat it sets
      --freshbar-width7.4emThe one width for every bar in a list. Size it to your longest label.
      --freshbar-height3pxChannel thickness.
      --freshbar-gap2pxSpace between the words and the channel.
      --freshbar-filltext colour, 55%The part that has passed.
      --freshbar-tracktext colour, 15%The rest of the channel.

      For anything else, style ::part(label), ::part(channel) and ::part(fill). The functions behind it, fillFor and relativeLabel, are exported too, for server-rendered pages. Read the source (MIT).

      In use

      podqast, a podcast player, shows a freshbar on every episode in its feeds, so a glance down the list says which episodes are new this week.

      What is not known yet

      That a freshbar makes lists faster to understand is a claim from first principles, not a measured result. A simple test is planned: the same list with and without freshbars, timing "which is newest?" and "is anything from this week?". If you try it on your own site, I would like to hear how it went: hello@eyalev.com.

      Written up by Eyal Levin, October 2026.