ValyroUI Русская версия

Button

Buttons in every variant. Free, MIT · Basics › Buttons

Installation

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';

Props

PropTypeDefault
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.
leftIconReactNodeIcon or element before the label.
rightIconReactNodeIcon or element after the label.
loadingbooleanfalseShows 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.
fullWidthbooleanfalseStretch to the full width of the container.
pillbooleanfalseFully rounded ends, regardless of theme.
asChildbooleanfalseRender the single child element (e.g. an <a>) with button styling.
hoverScalenumberScale 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.
tapScalenumberScale while pressed, e.g. 0.95, instead of the theme's press transform; springs back on release.

Related components

  • Icon Button — Icon-only button
  • Color Mode Switch — Light, dark or system: the choice is saved, painted before the first frame, synced across tabs and cross-faded
  • Button Group — Grouped buttons
  • Copy to Clipboard — Copy with confirmation
  • Badge — Status labels and tags
  • Tag — Removable and clickable tags, groups with +N
  • Avatar — User avatars
  • Tooltip — Hover and focus hints
  • Separator — Dividers
  • Icon — Any icon on the kit’s rules: size from the text, the theme’s stroke, RTL mirroring, an accessible name; createIcon and a gallery of 111 icons
  • Kbd — Keyboard keys and shortcuts: one "mod+k" string shows ⌘K on a Mac and Ctrl+K elsewhere, read aloud as words
  • Highlight — Search hits marked in text: case and accents ignored, several terms in their own tones, ready-made ranges, the current hit

Next: Icon Button · All Basics