You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be cool if you provided TypeScript definitions for PrimeFlex utility classes.
This way it would be easy to build components that rely on utility classes with all the benefits of TS.
Maybe you can provide the classes as string unions (it should be trivial to generate)?
Example component:
import{ReactNode}from'react';// Would be nice to get such types from PrimeFlextypeDirection=|'flex-row'|'flex-row-reverse'|'flex-column'|'flex-column-reverse';typeGap='gap-0'|'gap-1'|'gap-2';// And so on...typeJustifyContent='justify-content-start'|'justify-content-end';// And so on...typeAlignItems='align-items-stretch'|'align-items-start';// And so on...typeProps={direction?: Direction;gap?: Gap;justifyContent?: JustifyContent;alignItems?: AlignItems;children: ReactNode;};exportconstExample=({
direction ='flex-row',
gap ='gap-1',
justifyContent ='justify-content-start',
alignItems ='align-items-start',
children,}: Props)=>(<divclassName={`flex ${direction} ${gap} ${justifyContent} ${alignItems}`}>{children}</div>);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It would be cool if you provided TypeScript definitions for PrimeFlex utility classes.
This way it would be easy to build components that rely on utility classes with all the benefits of TS.
Maybe you can provide the classes as string unions (it should be trivial to generate)?
Example component:
Example usage:
Beta Was this translation helpful? Give feedback.
All reactions