MCPcopy Create free account
hub / github.com/editablejs/editable / Button

Function Button

apps/docs/src/components/button.tsx:12–32  ·  view source on GitHub ↗
({ children, onClick, active, className, style }: ButtonProps)

Source from the content-addressed store, hash-verified

10}
11
12export function Button({ children, onClick, active, className, style }: ButtonProps) {
13 return (
14 <button
15 style={style}
16 onMouseDown={evt => {
17 evt.preventDefault()
18 evt.stopPropagation()
19 }}
20 onClick={onClick}
21 css={[
22 tw`text-base leading-tight font-bold border rounded-lg py-2 px-4 focus:ring-1 focus:ring-offset-2 focus:ring-link active:bg-link active:border-link active:text-white active:ring-0 active:ring-offset-0 outline-none inline-flex items-center my-1`,
23 active && tw`bg-link border-link text-white hover:bg-link focus:bg-link active:bg-link`,
24 !active &&
25 tw`bg-transparent text-secondary dark:text-secondary-dark bg-secondary-button dark:bg-secondary-button-dark hover:text-link focus:text-link border-transparent`,
26 ]}
27 className={className}
28 >
29 {children}
30 </button>
31 )
32}
33
34Button.defaultProps = {
35 active: false,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…