Yeah. So, you could imagine something like this:

function Card({ className='', ...props }) {
const classNames = `card ${className}`.trim()'
return (
<div className={classNames} {...props} />
);
}
Card.Badge = Badge;export default Card;

Or in TSX, you could do something like this:

export function({ className='', ...props }: React.ComponentProps<'div'> {
const classNames = `card ${className}`.trim()'
return (
<div className={classNames} {...props} />
);
}
namespace Card { export const Badge = CardBadge;}

--

--

--

design systems @workday

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alan B Smith

Alan B Smith

design systems @workday

More from Medium

Data-Driven Decision Making in Public Policy

Disability & Me

Happiness and the pursuit of myself

This is my first post.