UNPKG

saagie-ui

Version:

Saagie UI from Saagie Design System

44 lines (38 loc) 916 B
import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; const propTypes = { children: PropTypes.node, className: PropTypes.string, defaultClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), /** * The component used for the root node. * Either a string to use a DOM element or a component. */ tag: PropTypes.elementType, }; const defaultProps = { children: '', className: '', defaultClassName: 'sui-o-datalist__details', tag: 'div', }; export const DatalistDescription = ({ children, className, defaultClassName, tag: Tag, ...props }) => { const classes = classnames( defaultClassName, className, ); return ( <Tag className={classes} {...props}> { children } </Tag> ); }; DatalistDescription.propTypes = propTypes; DatalistDescription.defaultProps = defaultProps;