|
import Info from '@politico/interactive-style/src/components/Info';// orimport { Info } from '@politico/interactive-style';
Name | Type | Default | Description |
---|---|---|---|
published | string | A parseable datestring signifying the date and time it was published | |
updated | string | A parseable datestring signifying the date and time it was last updated | |
defaultTimezone | string | America/New_York | A valid tz database timezone name to use as the default timezone if your user's timezone cannot be determined |
authors | Author[] | An array of author objects (see below) | |
Author | object | Information about a particular author (used in 'authors' props) | |
Author.name | string | The author's name (used in 'Author' object) | |
Author.link | string | A link to the author's bio (used in 'Author' object) |
Name | Global Class | Description |
---|---|---|
root | PibInfo-root | Styles applied to root element |
container | PibInfo-container | Styles applied to container element |
authorsContainer | PibInfo-authors | Styles applied to bylines container element |
published | PibInfo-published | Styles applied to published dateline |
updated | PibInfo-updated | Styles applied to updated dateline |
timestamp | PibInfo-timestamp | Styles applied to timestamp element |
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.
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.
| 1/1/1970 9 AM EST |
This component will do its best to display published and updated dates in the user's local time.
| 1/1/1970 9 AM EST |