Info

By First Lastname |

Import

import Info from '@politico/interactive-style/src/components/Info';
// or
import { Info } from '@politico/interactive-style';

Props

NameTypeDefaultDescription
publishedstringA parseable datestring signifying the date and time it was published
updatedstringA parseable datestring signifying the date and time it was last updated
defaultTimezonestringAmerica/New_YorkA valid tz database timezone name to use as the default timezone if your user's timezone cannot be determined
authorsAuthor[]An array of author objects (see below)
AuthorobjectInformation about a particular author (used in 'authors' props)
Author.namestringThe author's name (used in 'Author' object)
Author.linkstringA link to the author's bio (used in 'Author' object)

CSS

NameGlobal ClassDescription
rootPibInfo-rootStyles applied to root element
containerPibInfo-containerStyles applied to container element
authorsContainerPibInfo-authorsStyles applied to bylines container element
publishedPibInfo-publishedStyles applied to published dateline
updatedPibInfo-updatedStyles applied to updated dateline
timestampPibInfo-timestampStyles applied to timestamp element

Demos

Multiple Authors

Add another object to the "authors" props with a "link" and "name" to add another author. The component will concatenate all the names with proper english syntax. Try adding or removing names to see it work.

Published and Updated Times

If you have an updated time, set the "updated" prop. Note that this will move the "<time />" element to reflect the updated time instead of the published time. Inspect the element below to see that.

By First Lastname | 1/1/1970 9 AM EST |

Time Zones

This component will do its best to display published and updated dates in the user's local time.

By First Lastname | 1/1/1970 9 AM EST |