Breadcrumbs
Breadcrumbs create hierarchical representation and navigation.
Examples
import React from 'react';
import ReactDOM from 'react-dom';
import { Breadcrumbs, Breadcrumb, Hyperlink } from 'furl-components';
ReactDOM.render(
<div>
<Breadcrumbs separator='>'>
<Breadcrumb>
<Hyperlink href='/my-files'>My files</Hyperlink>
</Breadcrumb>
<Breadcrumb>My documents</Breadcrumb>
</Breadcrumbs>
<Breadcrumbs data={[
{ href: '#', title: 'My files' },
'My documents'
]} />
</div>,
document.getElementById('root')
);
API
Property | Description | Type | Default | ||
---|---|---|---|---|---|
separator | breadcrumbs separator style | string | '/' | ||
data | breadcrumbs data source | array(string/object) |
Notes
- You can populate breadcrumbs 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
. Breadcrumbs
only accepts children of theBreadcrumb
component type.data
only accepts an array of values, each of which can either be a string or an object. Objects in thedata
array must contain atitle
, optionally ahref
value and any other props that you want to pass.