APEX Design System is built with TypeScript and provides full type definitions for all components.
Import types alongside components for full IntelliSense support:
import { Button, type ButtonProps } from 'apex-design-system';
const MyButton: React.FC<ButtonProps> = (props) => {
return <Button {...props} />;
};All components export their prop interfaces for type checking:
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
size?: 'sm' | 'md' | 'lg';
isLoading?: boolean;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
}Use exported types for component variants:
import { type ButtonProps } from 'apex-design-system';
type ButtonVariant = NonNullable<ButtonProps['variant']>;
const variant: ButtonVariant = 'primary'; // Type-safe