manifold/web/components/buttons/pill-button.tsx
ingawei ae2e7dfe30
noobify welcome demo (#699)
* noobify welcome
* also beginning to add greyscale color scheme
2022-07-30 02:50:03 -05:00

28 lines
624 B
TypeScript

import clsx from 'clsx'
import { ReactNode } from 'react'
export function PillButton(props: {
selected: boolean
onSelect: () => void
color?: string
big?: boolean
children: ReactNode
}) {
const { children, selected, onSelect, color, big } = props
return (
<button
className={clsx(
'cursor-pointer select-none whitespace-nowrap rounded-full',
selected
? ['text-white', color ?? 'bg-greyscale-6']
: 'bg-greyscale-2 hover:bg-greyscale-3',
big ? 'px-8 py-2' : 'px-3 py-1.5 text-sm'
)}
onClick={onSelect}
>
{children}
</button>
)
}