@primer/components
Version:
Primer react components
38 lines (37 loc) • 1.3 kB
TypeScript
import React from 'react';
import { SxProp } from '../sx';
import { ListProps } from './List';
import { AriaRole } from '../utils/types';
export declare type GroupProps = {
/**
* Style variations. Usage is discretionary.
*
* - `"filled"` - Superimposed on a background, offset from nearby content
* - `"subtle"` - Relatively less offset from nearby content
*/
variant?: 'subtle' | 'filled';
/**
* Primary text which names a `Group`.
*/
title?: string;
/**
* Secondary text which provides additional information about a `Group`.
*/
auxiliaryText?: string;
/**
* The ARIA role describing the function of the list inside `Group` component. `listbox` or `menu` are a common values.
*/
role?: AriaRole;
} & SxProp & {
/**
* Whether multiple Items or a single Item can be selected in the Group. Overrides value on ActionList root.
*/
selectionVariant?: ListProps['selectionVariant'] | false;
};
declare type ContextProps = Pick<GroupProps, 'selectionVariant'>;
export declare const GroupContext: React.Context<ContextProps>;
export declare const Group: React.FC<GroupProps>;
export declare type HeaderProps = Pick<GroupProps, 'variant' | 'title' | 'auxiliaryText'> & {
labelId: string;
};
export {};