yoyo-bootstrap
Version:
Bootstrap components for the actual DOM (built with yoyo)
29 lines (22 loc) • 788 B
JavaScript
const yo = require('yo-yo')
const Children = require('./children')
require('./less/breadcrumbs.less')
const Breadcrumb = function (props) {
props = props || {}
return yo`
<ol class="${(props.bsClass && props.bsClass + ' ' || 'breadcrumb ')}">
${Children(arguments)}
</ol>
`
}
Breadcrumb.Item = function (props) {
props = props || {}
var content = props.href && yo`<a id=${props.linkId || ''} href=${props.href} target=${props.target || ''} title=${props.title || ''}>${Children(arguments)}</a>` || Children(arguments)
return yo`
<li id=${props.id || ''} class="${(props.bsClass && props.bsClass + ' ' || ' ') +
(props.active && 'active ' || ' ')}">
${content}
</li>
`
}
module.exports = Breadcrumb