@carbon/react
Version:
React components for the Carbon Design System
49 lines (45 loc) • 1.3 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import PropTypes from 'prop-types';
import React from 'react';
import cx from 'classnames';
import { usePrefix } from '../../internal/usePrefix.js';
function UnorderedList({
className,
nested = false,
isExpressive = false,
...other
}) {
const prefix = usePrefix();
const classNames = cx(`${prefix}--list--unordered`, className, {
[`${prefix}--list--nested`]: nested,
[`${prefix}--list--expressive`]: isExpressive
});
return /*#__PURE__*/React.createElement("ul", _extends({
className: classNames
}, other));
}
UnorderedList.propTypes = {
/**
* Specify a collection of ListItem's to be rendered in the UnorderedList
*/
children: PropTypes.node,
/**
* Specify an optional className to be applied to the underlying `<ul>` node
*/
className: PropTypes.string,
/**
* Specify whether this ordered list expressive or not
*/
isExpressive: PropTypes.bool,
/**
* Specify whether the list is nested, or not
*/
nested: PropTypes.bool
};
export { UnorderedList as default };