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

Function ButtonLink

apps/docs/src/components/button-link.tsx:11–39  ·  view source on GitHub ↗
({
  href,
  children,
  type = 'primary',
  size = 'md',
  label,
  target = '_self',
  ...props
}: JSX.IntrinsicElements['a'] & ButtonLinkProps)

Source from the content-addressed store, hash-verified

9}
10
11function ButtonLink({
12 href,
13 children,
14 type = 'primary',
15 size = 'md',
16 label,
17 target = '_self',
18 ...props
19}: JSX.IntrinsicElements['a'] & ButtonLinkProps) {
20 return (
21 <NextLink href={href as string}>
22 <a
23 css={[
24 tw`inline-flex font-bold items-center border-2 border-transparent outline-none focus:ring-1 focus:ring-offset-2 focus:ring-link active:bg-link active:text-white active:ring-0 active:ring-offset-0 leading-normal`,
25 type === 'primary' && tw`bg-link text-white hover:bg-opacity-80`,
26 type === 'secondary' &&
27 tw`bg-secondary-button dark:bg-secondary-button-dark text-primary dark:text-primary-dark hover:text-link focus:bg-link focus:text-white focus:border-link focus:border-2`,
28 size === 'lg' && tw`text-lg rounded-lg p-4`,
29 size === 'md' && tw`text-base rounded-lg px-4 py-1.5`,
30 ]}
31 {...props}
32 aria-label={label}
33 target={target}
34 >
35 {children}
36 </a>
37 </NextLink>
38 )
39}
40
41export default ButtonLink

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…