Skip to content

Button

The action control: primary (green, one per view), secondary, ghost and danger, in three sizes.

Base UI1.6 kB gzipSource Registry JSON

Button playground

Props

variant
size

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/button.json

The CLI writes components/ikada/button.tsx and merges the ikada theme into your CSS. Or take it from the package: import { Button } from "@sproutboat/ikada";

Usage

import { Button } from "@/components/ikada/button";

<Button variant="primary">
  Plant sprout
</Button>

Examples

Variants

One primary per view. Secondary is the default; ghost sits in toolbars; danger pairs with a confirm.

Sizes

Focus

The neutral ring, drawn without focus for this page. Tab to any button to see the real one.

Loading

The label stays in the tree, a spinner takes its place, and the width holds.

Disabled

Props

ButtonProps
PropTypeDescription
classNamestringClasses merged onto the root element, after ikada's own.
loadingbooleanShows a spinner, sets aria-busy, ignores clicks, keeps the width and focus. Default `false`.
styleCSSProperties | ((state: ButtonState) => CSSProperties)Style applied to the element, or a function that returns a style object based on the component's state.
renderReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ButtonState>Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.
variant"danger" | "primary" | "secondary" | "ghost" | null—
size"sm" | "md" | "lg" | null—

Also takes every prop of Omit<ComponentProps<typeof BaseButton>, "className">, ButtonVariants.

Source: src/components/button.tsx