Item
Items present post-like content in a familiar format.
Items are powered by react-timy.
Examples
I have posted this amazing article here. Check it out!
Dude, this is awesome. Thanks so much.
import React from 'react';
import ReactDOM from 'react-dom';
import { Item } from 'furl-components';
ReactDOM.render(
<Item
author='Joe Henderson'
date={new Date('11/03/2019')}
media='profile-joe.jpg'
data='I have posted this amazing article here. Check it out!'
/>
<Item
author='Sophie Gray'
date={new Date('12/03/2019')}
media='profile-sophia.jpg'
data='Dude, this is awesome. Thanks so much.'
/>,
document.getElementById('root')
);
API
Property | Description | Type | Default | ||
---|---|---|---|---|---|
media | item media url | string | |||
data | item content | string/object | |||
date | item creation date | Date | |||
author | item author | string |
Notes
- You can populate an item either via passing children to it or via the use of the
data
prop. Ifdata
is provided, it will take precedence over passed children, therefore rendering only the content provided indata
. data
accepts either a string or an object, which allows you to pass it a React component tree.- If
date
is not provided, the component will use the current date and time.