UNPKG

891 BJavaScriptView Raw
1"use client";
2
3import classNames from 'classnames';
4import * as React from 'react';
5import { useBootstrapPrefix } from './ThemeProvider';
6import { jsx as _jsx } from "react/jsx-runtime";
7const ButtonGroup = /*#__PURE__*/React.forwardRef(({
8 bsPrefix,
9 size,
10 vertical = false,
11 className,
12 role = 'group',
13 // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
14 as: Component = 'div',
15 ...rest
16}, ref) => {
17 const prefix = useBootstrapPrefix(bsPrefix, 'btn-group');
18 let baseClass = prefix;
19 if (vertical) baseClass = `${prefix}-vertical`;
20 return /*#__PURE__*/_jsx(Component, {
21 ...rest,
22 ref: ref,
23 role: role,
24 className: classNames(className, baseClass, size && `${prefix}-${size}`)
25 });
26});
27ButtonGroup.displayName = 'ButtonGroup';
28export default ButtonGroup;
\No newline at end of file