/
githubmirror
/
gogs
Обзор
Документация
Войти
/
githubmirror
/
gogs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
web/src/components/ui/button.tsx
17 строк
608 B
ᴊᴏᴇ ᴄʜᴇɴ
web: align components with React 19 and fix accessibility findings (#8306)
31 май 2026, 18:06
Не верифицирован
31 май 2026, 18:06
2c46f01
Код
Авторство
О чём код?
import { Slot } from "@radix-ui/react-slot"; import { type VariantProps } from "class-variance-authority"; import * as React from "react"; import { buttonVariants } from "@/components/ui/button-variants"; import { cn } from "@/lib/utils"; interface ButtonProps extends React.ComponentProps<"button">, VariantProps<typeof buttonVariants> { asChild?: boolean; } function Button({ className, variant, size, asChild = false, ...props }: ButtonProps) { const Comp = asChild ? Slot : "button"; return <Comp className={cn(buttonVariants({ variant, size, className }))} {...props} />; } export { Button };