Skip to content

Commit 36f3b90

Browse files
committed
feat(toolbar): add hasNoPadding prop
1 parent da560d5 commit 36f3b90

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/react-core/src/components/Toolbar/Toolbar.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export interface ToolbarProps extends React.HTMLProps<HTMLDivElement>, OUIAProps
5757
ouiaSafe?: boolean;
5858
/** Background color variant of the toolbar */
5959
colorVariant?: ToolbarColorVariant | 'default' | 'no-background' | 'primary' | 'secondary';
60+
/** Flag indicating the toolbar padding is removed */
61+
hasNoPadding?: boolean;
6062
}
6163

6264
export interface ToolbarState {
@@ -78,6 +80,7 @@ class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
7880
static displayName = 'Toolbar';
7981
labelGroupContentRef = React.createRef<HTMLDivElement>();
8082
staticFilterInfo = {};
83+
hasNoPadding = false;
8184
state = {
8285
isManagedToggleExpanded: false,
8386
filterInfo: {},
@@ -128,6 +131,7 @@ class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
128131

129132
renderToolbar = (randomId: string) => {
130133
const {
134+
hasNoPadding,
131135
clearAllFilters,
132136
clearFiltersButtonText,
133137
collapseListedFiltersBreakpoint,
@@ -159,6 +163,7 @@ class Toolbar extends React.Component<ToolbarProps, ToolbarState> {
159163
<div
160164
className={css(
161165
styles.toolbar,
166+
hasNoPadding && styles.modifiers.noPadding,
162167
isFullHeight && styles.modifiers.fullHeight,
163168
isStatic && styles.modifiers.static,
164169
isSticky && styles.modifiers.sticky,

0 commit comments

Comments
 (0)