Button
Кнопки всех типов. Бесплатно, MIT · Базовые элементы › Кнопки
Установка
npx valyro-cli@latest add button
npx shadcn@latest add https://valyro.xyz/r/button.json
npm install valyro-ui
import 'valyro-ui/styles.css';
import { Button } from 'valyro-ui';
Пропсы
| Prop | Type | Default | |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'ghost' | 'accent' | 'danger' | 'link' | 'secondary' | Solid primary/accent/danger fill, outlined secondary, transparent ghost, or unpadded text link. |
size | 'sm' | 'md' | 'lg' | 'md' | Control height, padding and text size. |
leftIcon | ReactNode | Icon or element before the label. | |
rightIcon | ReactNode | Icon or element after the label. | |
loading | boolean | false | Shows a spinner and blocks activation without changing the button's width: the spinner takes the left icon's place, or covers the label when there is no left icon. The button stays focusable and gets aria-busy. |
fullWidth | boolean | false | Stretch to the full width of the container. |
pill | boolean | false | Fully rounded ends, regardless of theme. |
asChild | boolean | false | Render the single child element (e.g. an <a>) with button styling. |
hoverScale | number | Scale under a hovering mouse, e.g. 1.05; it springs back with a slight bounce. Off by default (the theme's own hover). Skipped on touch and under reduced motion. | |
tapScale | number | Scale while pressed, e.g. 0.95, instead of the theme's press transform; springs back on release. |
Похожие компоненты
- Icon Button — Кнопка с иконкой
- Button Group — Группы кнопок
- Copy to Clipboard — Копирование с подтверждением
- Badge — Статусы и метки
- Avatar — Аватары пользователей
- Tooltip — Всплывающие подсказки
- Separator — Разделители
- Skeleton — Заглушки загрузки
- Spinner — Индикатор загрузки
- Progress Bar — Полосы прогресса