Upper Toolbar

View in LexiconDeprecated

Upper toolbar is a guidance pattern to allow designers create their own toolbars for edition with preview pages.

installyarn add @clayui/upper-toolbar
versionNPM Version
useimport UpperToolbar from '@clayui/upper-toolbar';
Warning This component has been discontinued in favor of ClayToolbar, you can get the same result.

Introduction

The Upper Toolbar components can be composed together to make all sorts of toolbar variations. Combine Upper Toolbar with other Clay components to cover a variety of use cases.

Example

import {Provider} from '@clayui/core';
import UpperToolbar from '@clayui/upper-toolbar';
import {ClayDropDownWithItems} from '@clayui/drop-down';
import Button, {ClayButtonWithIcon} from '@clayui/button';
import Icon from '@clayui/icon';
import React, {useState} from 'react';

import '@clayui/css/lib/css/atlas.css';

export default function App() {
	return (
		<Provider spritemap="/public/icons.svg">
			<div className="p-4">
				<UpperToolbar>
					<UpperToolbar.Item className="text-left" expand>
						<label className="component-title">{'Foo Bar'}</label>

						<Icon symbol="lock" />
					</UpperToolbar.Item>

					<UpperToolbar.Input placeholder="Search..." />

					<UpperToolbar.Item>
						<Button.Group>
							<ClayButtonWithIcon
								displayType="secondary"
								onClick={() => {}}
								small
								symbol="angle-left"
							/>

							<ClayButtonWithIcon
								displayType="secondary"
								onClick={() => {}}
								small
								symbol="angle-right"
							/>
						</Button.Group>
					</UpperToolbar.Item>

					<UpperToolbar.Item>
						<Button displayType="secondary" onClick={() => {}}>
							{'Delete'}
						</Button>

						<Button
							className="inline-item-after"
							onClick={() => {}}
						>
							{'Edit'}
						</Button>
					</UpperToolbar.Item>

					<UpperToolbar.Item>
						<ClayDropDownWithItems
							items={[
								{href: '#one', label: 'one'},
								{href: '#two', label: 'two'},
								{
									disabled: true,
									href: '#three',
									label: 'three',
								},
								{href: '#four', label: 'four'},
							]}
							trigger={
								<ClayButtonWithIcon
									displayType="unstyled"
									small
									symbol="ellipsis-v"
								/>
							}
						/>
					</UpperToolbar.Item>
				</UpperToolbar>
			</div>
		</Provider>
	);
}

API Reference

Input

{ ({ className, ...otherProps }: IInputProps): JSX.Element; displayName: string; }
Parameters
Properties

component

"input" | "textarea" | React.ForwardRefExoticComponent<any> | undefined

Input component to render. Can either be a string like 'input' or 'textarea' or a component.

insetAfter

boolean | undefined

Flag to indicate if input-group-inset-after class should be applied

insetBefore

boolean | undefined

Flag to indicate if input-group-inset-before class should be applied

sizing

"sm" | "lg" | "regular" | undefined

Selects the height of the input.

Returns
Element

Item

{ ({ children, className, expand, ...otherProps }: IItemProps): JSX.Element; displayName: string; }
Parameters
Properties

expand

boolean | undefined

Flag to indicate if Item should auto expand to fill the remaining width.

Returns
Element

UpperToolbar

{ ({ children, className, ...otherProps }: React.HTMLAttributes<HTMLElement>): JSX.Element; displayName: string; Item: { ({ children, className, expand, ...otherProps }: IItemProps): JSX.Element; displayName: string; }; Input: { ({ className, ...otherProps }: IInputProps): JSX.Element; displayName: string; }; }
Returns
Element
Edit this page on GitHub

Contributors

Matuzalém Teles, Bryce Osterhaus, Krešimir Čoko

Last edited January 29, 2025 at 1:35:02 AM