@stratakit/structures
Version:
Medium-sized component structures for the Strata design system
37 lines (36 loc) • 1.22 kB
TypeScript
import * as React from "react";
import type { BaseProps } from "@stratakit/foundations/secret-internals";
interface ToolbarProps extends BaseProps {
/** Must be set to `"solid"` for now. */
variant: "solid";
}
/**
* A toolbar for grouping related interactive elements.
*
* Follows the [ARIA Toolbar pattern](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/) for reducing the number of tab stops.
*
* Example:
* ```jsx
* <Toolbar.Group variant="solid">
* <Toolbar.Item render={…} />
* <Toolbar.Item render={…} />
* <Toolbar.Item render={…} />
* </Toolbar.Group>
* ```
*/
declare const ToolbarGroup: React.ForwardRefExoticComponent<ToolbarProps & React.RefAttributes<HTMLDivElement | HTMLElement>>;
interface ToolbarItemProps extends Omit<BaseProps<"button">, "render">, Required<Pick<BaseProps, "render">> {
}
/**
* An item within the toolbar.
* Should be used with the `render` prop.
*
* Example:
* ```jsx
* <Toolbar.Item
* render={<IconButton variant="ghost" … />}
* />
* ```
*/
declare const ToolbarItem: React.ForwardRefExoticComponent<ToolbarItemProps & React.RefAttributes<HTMLElement | HTMLButtonElement>>;
export { ToolbarGroup as Group, ToolbarItem as Item };