Skip to content

Instantly share code, notes, and snippets.

@nickgrato
Created November 9, 2022 23:07
Show Gist options
  • Save nickgrato/6d99fa3028b7474c81f11cc91e719f92 to your computer and use it in GitHub Desktop.
Save nickgrato/6d99fa3028b7474c81f11cc91e719f92 to your computer and use it in GitHub Desktop.
Button Component
const Button = ({
category = ButtonCategoriesE.PRIMARY_SOLID,
size = ButtonSizesE.MEDIUM,
......
/**
* Configure CSS Class
*/
const className = `
${styles['button_' + category]}
${styles[size]}
${active && styles['button_' + category + '_active']}
`
return (
<button
className={className}
id={id}
aria-label={label}
type={type}
disabled={disabled}
onClick={onClick}
>
{content}
</button>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment