Components
Button
Triggers an action, or renders a link that looks like a button.
Ombelle · light
Actions
Installation
Run in a project initialized with an Ombelle preset (see Get started). The component uses the saved project preset. Run the command from your app folder; it shows the changes and asks before writing.
pnpm dlx @ombelle-ui/cli@1.1.2 add buttonAdds components/ui/button.tsx and installs react, @radix-ui/react-slot, class-variance-authority, clsx, tailwind-merge with lifecycle scripts disabled. This is a client component.
In a liquid glass project the plan adds a notice that accessibility is not guaranteed, because text contrast depends on the background behind the glass.
Usage
example.tsx
import { Button } from '@/components/ui/button'
export function Actions() {
return (
<>
<Button>Save changes</Button>
<Button variant="outline">Cancel</Button>
</>
)
}Liquid glass Buttons were restyled to one ink in 0.5.0.
API and states
- API
- variant (default, secondary, destructive, outline, ghost, link, link-destructive), size (sm, default, lg, icon, icon-sm), loading, asChild
- Minimum states
- Default, hover, focus, pressed, disabled, loading (keeps its width)
- Native basis
- <button>, or a valid link through asChild
- Styles
- Stable in Ombelle, Papier, Organic, Retro futurism, minimalist, neo-brutalism and flat, light and dark. Liquid glass: stable, accessibility not guaranteed.