@kamrade/svelte-dynamic-button
Version:
A simple button template that supports a flexible set of themes, variants, sizes and shapes. You can find usage examples (MagicButton and SimpleButton components) in the repository.
14 lines (13 loc) • 577 B
JavaScript
export const getClassNames = (props) => {
const { theme, variant, size, shape, className, block, convex, loading, iconButton } = props;
return `DynamicButton ` +
(convex ? `DynamicButton--convex ` : '') +
(loading ? `DynamicButton--loading ` : '') +
`${className} ` +
`${className}--theme--${theme} ` +
`${className}--variant--${variant} ` +
`${className}--size--${size} ` +
`${className}--shape--${shape} ` +
(iconButton ? `DynamicButton--icon` : '') +
(block ? `DynamicButton--block ` : '');
};