@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
38 lines (37 loc) • 1.32 kB
TypeScript
import * as React from 'react';
import type { BaseUIComponentProps } from '../utils/types.js';
import { type UseToggleGroup } from './useToggleGroup.js';
/**
* Provides a shared state to a series of toggle buttons.
*
* Documentation: [Base UI Toggle Group](https://base-ui.com/react/components/toggle-group)
*/
declare const ToggleGroup: React.ForwardRefExoticComponent<ToggleGroup.Props & React.RefAttributes<HTMLDivElement>>;
export { ToggleGroup };
export type ToggleGroupOrientation = 'horizontal' | 'vertical';
export declare namespace ToggleGroup {
interface State {
/**
* Whether the component should ignore user interaction.
*/
disabled: boolean;
multiple: boolean;
}
interface Props extends Partial<UseToggleGroup.Parameters>, Omit<BaseUIComponentProps<'div', State>, 'defaultValue'> {
/**
* Whether the component should ignore user interaction.
* @default false
*/
disabled?: boolean;
/**
* @default 'horizontal'
*/
orientation?: ToggleGroupOrientation;
/**
* Whether to loop keyboard focus back to the first item
* when the end of the list is reached while using the arrow keys.
* @default true
*/
loop?: boolean;
}
}