UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

37 lines (36 loc) 1.03 kB
import { TokenSizeKeys } from "./constants.js"; import React from "react"; //#region src/Token/TokenBase.d.ts interface TokenBaseProps extends Omit<React.HTMLProps<HTMLSpanElement | HTMLButtonElement | HTMLAnchorElement>, 'size' | 'id'> { as?: 'button' | 'a' | 'span'; /** * The function that gets called when a user clicks the remove button, or keys "Backspace" or "Delete" when focused on the token */ onRemove?: () => void; /** * Whether the remove button should be rendered in the token */ hideRemoveButton?: boolean; /** * Whether the token is selected */ isSelected?: boolean; /** * The text label inside the token */ text: React.ReactNode; /** * A unique identifier that can be associated with the token */ id?: number | string; /** * Which size the token will be rendered at */ size?: TokenSizeKeys; /** * Whether or not the token is disabled (non-interactive). */ disabled?: boolean; } //#endregion export { TokenBaseProps, type TokenSizeKeys };