Getting Started

Your first component

Render a button, pass it props, and swap the styled component for its headless counterpart.

You have the package installed. This page takes you from an empty file to a button you can click, then shows you the two things you will reach for next: props and the headless layer.

If you have not installed yet, start at Installation.

Render a button

Import the component and render it. label is the text.

src/App.tsx
import { IButton } from "@inkline/react";

export default function App() {
  return <IButton label="Save changes" />;
}

The component renders a native <button> — not a <div> wearing a button costume — so keyboard focus, form submission and assistive technology work without anything extra from you:

<button class="button …" type="button" aria-busy="false">Save changes</button>

Pass props

Three props control appearance: color, variant and size. They compose, and they are the same names in all seven frameworks.

<IButton label="Delete" color="error" variant="outline" size="sm" />

The full set for IButton:

PropTypeDefaultDescription
labelstring—Button text content.
colorprimary | secondary | success | info | warning | error | light | dark | neutralneutralColor variant.
variantsolid | outline | soft | subtle | ghost | linksolidStyle variant.
sizexs | sm | md | lg | xlmdSize variant.
typebutton | submit | resetbuttonNative button type.
disabledbooleanfalseDisables the button.
loadingbooleanfalseShows a loading spinner.
blockbooleanfalseRenders a full-width button.
idstring—The native button's id.
ariaLabelstring—The native button's aria-label.
ariaDescribedbystring—The native button's aria-describedby.

class and style fall through to the native button, merged with the button's own. React spells them className and style. An icon-only button needs ariaLabel, since it has no text to name it. In Angular, bind id as [id]="'save'": a static id="save" also stays on the uf-i-button host, so two elements share it.

The button emits click when it's clicked: onClick in React and Solid, @click in Vue, onclick in Svelte and onClick$ in Qwik. In Angular, listen with (ufClick). A (click) on the host also hears the native click, so bind only one of them. Astro renders on the server, so nothing listens there.

click carries no event object, so its handler can't call preventDefault() or read the modifier keys. When you need the native event, listen to click on an element around the button, where it still bubbles. In Vue, a .prevent or .stop modifier on the button's @click throws, since there's no event to call it on.

On React, Svelte, Solid, Qwik and Astro, nothing else reaches the button: a data-* attribute, another aria-* attribute or another listener is dropped. Wrap the button in an element that carries it. Vue passes other attributes through to the native button, and Angular leaves them on the uf-i-button host element.

Use the content slot instead of label

label is the shortcut for plain text. For anything richer — an icon, a nested element — pass children instead. Children win over label when both are given.

<IButton color="primary">
  <SaveIcon /> Save changes
</IButton>

Drop the styling: the headless layer

Every styled component has a headless counterpart on the /headless subpath. It is the same structure, the same state and the same accessibility wiring, with no classes attached — the escape hatch for when your design has nothing in common with the default theme.

import { IButtonBase } from "@inkline/react/headless";

<IButtonBase className="my-own-button" label="Save changes" />;

Reach for headless only when you are replacing the design wholesale. If you just want different colors and spacing, keep the styled components and change the tokens — that is Theming, and it is one config file.

Next steps

  • Theming — make every component match your brand at once.
  • Components — the other seven, each with a code sample for every framework.
Copyright © 2026