@primer/react
Version:
An implementation of GitHub's Primer Design System using React
23 lines • 1.57 kB
TypeScript
import type { ButtonHTMLAttributes } from 'react';
import type React from 'react';
import type { IconProps } from '@primer/octicons-react';
import type { FCWithSlotMarker } from '../utils/types';
export type SegmentedControlButtonProps = {
/** The visible label rendered in the button */
children: string;
/** Whether the segment is selected. This is used for controlled `SegmentedControls`, and needs to be updated using the `onChange` handler on `SegmentedControl`. */
selected?: boolean;
/** Whether the segment is selected. This is used for uncontrolled `SegmentedControls` to pick one `SegmentedControlButton` that is selected on the initial render. */
defaultSelected?: boolean;
/** The leading visual comes before item label */
leadingVisual?: React.FunctionComponent<React.PropsWithChildren<IconProps>> | React.ReactElement<any>;
/** @deprecated Use `leadingVisual` instead. The leading icon comes before item label */
leadingIcon?: React.FunctionComponent<React.PropsWithChildren<IconProps>> | React.ReactElement<any>;
/** Applies `aria-disabled` to the button. This will disable certain functionality, such as `onClick` events. */
disabled?: boolean;
/** Optional counter to display on the right side of the button */
count?: number | string;
} & ButtonHTMLAttributes<HTMLButtonElement | HTMLLIElement>;
declare const SegmentedControlButton: FCWithSlotMarker<React.PropsWithChildren<SegmentedControlButtonProps>>;
export default SegmentedControlButton;
//# sourceMappingURL=SegmentedControlButton.d.ts.map