{}}
+/>`,
+];
+
export const ButtonExample = {
title: 'Button',
sections: [
@@ -469,6 +491,26 @@ export const ButtonExample = {
demo: ,
snippet: buttonGroupIconsSnippet,
},
+ {
+ source: [
+ {
+ type: GuideSectionTypes.JS,
+ code: ButtonGroupVerticalSource,
+ },
+ {
+ type: GuideSectionTypes.HTML,
+ code: ButtonGroupVerticalHtml,
+ },
+ ],
+ wrapText: false,
+ text: (
+
+ Vertical orientated
+
+ ),
+ demo: ,
+ snippet: ButtonGroupVerticalSnippet,
+ },
{
source: [
{
diff --git a/src-docs/src/views/button/button_group_vertical.js b/src-docs/src/views/button/button_group_vertical.js
new file mode 100644
index 0000000000..8590fb970a
--- /dev/null
+++ b/src-docs/src/views/button/button_group_vertical.js
@@ -0,0 +1,179 @@
+/*
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * The OpenSearch Contributors require contributions made to
+ * this file be licensed under the Apache-2.0 license or a
+ * compatible open source license.
+ *
+ * Modifications Copyright OpenSearch Contributors. See
+ * GitHub history for details.
+ */
+
+import React, { useState, Fragment } from 'react';
+
+import {
+ OuiButtonGroup,
+ OuiSpacer,
+ OuiTitle,
+} from '../../../../src/components';
+
+import { htmlIdGenerator } from '../../../../src/services';
+
+const idPrefix = htmlIdGenerator()();
+const idPrefix3 = htmlIdGenerator()();
+
+export default () => {
+ const [toggleIdSelected, setToggleIdSelected] = useState(`${idPrefix}1`);
+
+ const onChange = (optionId) => {
+ setToggleIdSelected(optionId);
+ };
+
+ const toggleButtons = [
+ {
+ id: `${idPrefix}0`,
+ label: 'Option one',
+ },
+ {
+ id: `${idPrefix}1`,
+ label: 'Option two',
+ },
+ {
+ id: `${idPrefix}2`,
+ label: 'Option three',
+ },
+ ];
+
+ const toggleButtonsIcons = [
+ {
+ id: `${idPrefix3}0`,
+ label: 'Align left',
+ iconType: 'editorAlignLeft',
+ },
+ {
+ id: `${idPrefix3}1`,
+ label: 'Align center',
+ iconType: 'editorAlignCenter',
+ },
+ {
+ id: `${idPrefix3}2`,
+ label: 'Align right',
+ iconType: 'editorAlignRight',
+ isDisabled: true,
+ },
+ ];
+
+ const toggleButtonsIconsMulti = [
+ {
+ id: `${idPrefix3}3`,
+ label: 'Bold',
+ name: 'bold',
+ iconType: 'editorBold',
+ },
+ {
+ id: `${idPrefix3}4`,
+ label: 'Italic',
+ name: 'italic',
+ iconType: 'editorItalic',
+ isDisabled: true,
+ },
+ {
+ id: `${idPrefix3}5`,
+ label: 'Underline',
+ name: 'underline',
+ iconType: 'editorUnderline',
+ },
+ {
+ id: `${idPrefix3}6`,
+ label: 'Strikethrough',
+ name: 'strikethrough',
+ iconType: 'editorStrike',
+ },
+ ];
+
+ const [toggleIconIdSelected, setToggleIconIdSelected] = useState(
+ `${idPrefix3}1`
+ );
+ const [toggleIconIdToSelectedMap, setToggleIconIdToSelectedMap] = useState(
+ {}
+ );
+
+ const onChangeIcons = (optionId) => {
+ setToggleIconIdSelected(optionId);
+ };
+
+ const onChangeIconsMulti = (optionId) => {
+ const newToggleIconIdToSelectedMap = {
+ ...toggleIconIdToSelectedMap,
+ ...{
+ [optionId]: !toggleIconIdToSelectedMap[optionId],
+ },
+ };
+
+ setToggleIconIdToSelectedMap(newToggleIconIdToSelectedMap);
+ };
+
+ return (
+
+ onChange(id)}
+ />
+
+ onChangeIcons(id)}
+ isIconOnly
+ />
+
+ onChangeIconsMulti(id)}
+ type="multi"
+ isIconOnly
+ />
+
+
+ Compressed
+
+ onChange(id)}
+ />
+
+ onChangeIcons(id)}
+ isIconOnly
+ />
+
+ onChangeIconsMulti(id)}
+ type="multi"
+ isIconOnly
+ />
+
+ );
+};
diff --git a/src/components/button/button_group/__snapshots__/button_group.test.tsx.snap b/src/components/button/button_group/__snapshots__/button_group.test.tsx.snap
index 54c1542442..45f3628bff 100644
--- a/src/components/button/button_group/__snapshots__/button_group.test.tsx.snap
+++ b/src/components/button/button_group/__snapshots__/button_group.test.tsx.snap
@@ -2475,6 +2475,546 @@ exports[`OuiButtonGroup button props isIconOnly is rendered for single 1`] = `
`;
+exports[`OuiButtonGroup button props orientation horizontal is rendered for multi 1`] = `
+
+`;
+
+exports[`OuiButtonGroup button props orientation horizontal is rendered for single 1`] = `
+
+`;
+
+exports[`OuiButtonGroup button props orientation horizontal is rendered with compressed 1`] = `
+
+`;
+
+exports[`OuiButtonGroup button props orientation vertical is rendered for multi 1`] = `
+
+`;
+
+exports[`OuiButtonGroup button props orientation vertical is rendered for single 1`] = `
+
+`;
+
+exports[`OuiButtonGroup button props orientation vertical is rendered with compressed 1`] = `
+
+`;
+
exports[`OuiButtonGroup button props selection idSelected is rendered for single 1`] = `