

# UnstyledButton

A native `<button>` with the browser's chrome removed: no background, border, padding or font of its own, so it takes the look of whatever it wraps. It keeps what makes it a button: the pointer cursor, the shared focus ring, keyboard activation and a disabled state.

Use it for small inline toggles ("Show details"), a clickable row or card region, or an icon smaller than the smallest `IconButton`. When the control should look like a button, use [Button](/components/button) or [IconButton](/components/icon-button).

## Examples

### Disclosure toggle

```tsx
import { useState } from 'react';
import { Icon, Text, UnstyledButton } from '@var-ui/react';

const [open, setOpen] = useState(false);

<UnstyledButton aria-expanded={open} onClick={() => setOpen(!open)}>
  <Icon name={open ? 'chevronDown' : 'chevronRight'} size="sm" />
  <Text as="span" size="sm" weight="medium">Build details</Text>
</UnstyledButton>
```

```astro
---
import { UnstyledButton } from '@var-ui/astro';
import { svg as chevronRightSvg } from '@var-ui/icons/glyphs/chevronRight';
---

<UnstyledButton aria-expanded="false">
  <Fragment set:html={chevronRightSvg} />
  Build details
</UnstyledButton>
```

```html
<button type="button" aria-expanded="false" class="var-ui-unstyled-button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M9.5 6l6 6-6 6" /></svg>Build details</button>
```

## Accessibility

It is a real `<button>`, so Enter and Space activate it and it is in the tab order. `type` defaults to `button`, so it never submits a form by accident; pass `type="submit"` when it should. An icon-only `UnstyledButton` needs an accessible name: an `aria-label`, or [VisuallyHidden](/components/visually-hidden) text inside it.

## Astro

`UnstyledButton` from `@var-ui/astro` renders the same `<button>` and class. In plain HTML, put the `var-ui-unstyled-button` class on a `<button>`.

## Props



All native `<button>` attributes and handlers are passed through, and `ref` is the button.


> Also accepts all standard HTML attributes (ARIA attributes, event handlers, styles, …). Run `var-ui component unstyled-button --all-props` for the complete list.
