Button
Example contract · demo „buttons“src/components/ui/button.tsx- Responsibility
Actions use Button; navigation uses buttonVariants on a native anchor. Pass type="button" for non-submit actions.
- Reuse
- Not set separately – the demo is the contract
- Entry point
src/components/ui/button.tsx- Constraints and rules
- Use native semantics and visible keyboard focus.
- Check 320px, long content and both themes.
- Consumers in source
34 direct imports · Website reference
src/components/case/CaseBlock.astrosrc/components/case/CaseHero.astrosrc/components/ContactBlock.astrosrc/components/CvPreview.astro- + 30 more
Path from a website route:
src/pages/about/index.astro→src/components/ui/button.tsx- Variants
variant: primary | secondary | ghost | linksize: sm | md | iconasChild: boolean (React composition only)
- States
- default
- hover
- focus-visible
- disabled
- aria-busy + disabled (composition)
- API (read from source)
Button({className, variant, size, asChild = false, ...props}: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {asChild?: boolean})